[ncl-talk] regression with lag

Sancta Vega sanctavega at gmail.com
Mon Oct 2 08:25:06 MDT 2017


according to this answer  https://www.ncl.ucar.edu/Suppo
rt/talk_archives/2013/2968.html

I need the 10 positive and negative lag regression  of my data x(time),
P1(lat,lon,time) but I dont loop trough lat lon .

This is my code :

dim_s   = dimsizes(P1)  ;;;
 Nend = 5000 ; length of  x
 nlagr= 21 ; +- 10 lag
  yLag = 10

 Regdata              = new((/dim_s(0),dim_s(1),nlagr/),"float")

n=-1
do n=0,nlagr-1
      n= n+1
       Regdata(:,:,n) =regline(x(0:Nend-n-yLag), P1(:,:,yLag+n:Nend))
end do ;


This give me an error :
fatal:Subscript out of range, error in subscript #2
fatal:An error occurred reading P1

I try to replace regline by regCoef and get the same error message.

Thanks in advance!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171002/2f43472d/attachment.html>


More information about the ncl-talk mailing list