Least Squares Notation

Problems with syntax of GAMS
Post Reply
ayledith
User
User
Posts: 9
Joined: 4 years ago

Least Squares Notation

Post by ayledith »

I'm having a hard time interpreting what i, 'x', and 'y' are on this page: https://www.gams.com/latest/docs/S_LS.html.

How do I format this accordingly?
objectiveFunction.. tc =e= sum((k,tau), sqr(a(k,tau) - e(k,tau)) );
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Least Squares Notation

Post by Renger »

Hi
The 'x' and 'y' are just the column headings for a table with the x and y values.

Code: Select all

set o Observations /o1*o12/;

table data(o,*) Table with data
      	x     	y
ob1 	1     	2
ob2 	2     	3.9
...
Your example looks fine.
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Post Reply