Linear trend has to pass through the origin

867
3
08-14-2012 10:44 AM
JoseLuis_Serrano
New Contributor III
Hi - I need to interpolate a linear trend surface through a really big number of points but with the condition that the surface has to pass exactly through one of them, like the origin point.
I couldn't find any option for that in the trend tool so I though about creating a lot of points really close to the origin point to force the trend but since I already have so many points I get an out of memory error.
Does someone know if there is another way of doing this? I am using python to perform this analysis so I though about converting the points to a numpy array but so far I haven't found anything in numpy to calculate the trend.
Thanks a lot for your help!

Jose Luis Serrano
GIS Programmer/Analyst
Tags (2)
0 Kudos
3 Replies
ChristopherThompson
Occasional Contributor III
I think that almost by definition a trend surface is never going to pass through your data points because it uses a least-squares regression to accomplish this, so a different interpolation method might be needed if this is a requirement - for instance the spline techniques force your interpolated surface through the original data points.
0 Kudos
JoseLuis_Serrano
New Contributor III
You can force a linear regression to pass through the origin of coordinates. The best way I have found so far it is to convert the raster to a numpy array, move the coordinate system so my origin of coordinates is the point I want to pass through, create a least square model using numpy.linalg.lstsq where Z = aX + bY + c and c = 0, and then use the model to create the raster.
I'll let you know if it works.
0 Kudos
ChristopherThompson
Occasional Contributor III
Please do, the math side of this certainly isn't my strong point so I'll be interested to see the results and what you accomplish.
0 Kudos