On 07/12/2010 10:46 AM, Sabeerali(sebi) wrote:
> Does any function in NCL to compute lag regression just like lag
> correlation...?
No.
> Any hint would be highly appreciated...
Shift the time axis manually.
For the simple x(N), y(N)
N = 10
x = random_normal(0.0,1.0,N)
y = random_normal(0.0,1.0,N)
nlagr = 3 ; 0,1,2
rlag = new (nlagr, "float")
Nend = N-1
yLag = 1
do n=0,nlagr-1
rlag(n) = regline(x(0:Nend-n-yLag) , y(yLag+n:Nend) )
end do
print(rlag)
===========
For multidimensional arrays use
http://www.ncl.ucar.edu/Document/Functions/Built-in/regCoef.shtml
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 12 12:04:58 2010
This archive was generated by hypermail 2.1.8 : Mon Jul 19 2010 - 09:39:02 MDT