repeat/range=1:28/name=ii (set region/l=`ii`:`ii+19`; save/file=data1_`ii`.nc/append $data1)
repeat/range=1:28/name=ii (set region/l=`ii`:`ii+19`; save/file=data2_`ii`.nc/append $data2)
repeat/range=1:28/name=ii (set da data1_`ii`.nc; set da data2_`ii`.nc; let p = $data1; let q = $data2; go variance; let mobs=correl; list/file=correl.txt/nohead/append mobs; cancel da/all)
Then you open the correlations, put it in a time axis (following is an example, set your time axis), and then plot
file/var="corh"/col=1 "correl.txt"
def axis/edge/t="1-Jul-1959":"1-Jul-1995":1/np=37/unit=years/cal=noleap tyear
let tt=t[gt=tyear]
let corrh=reshape(corh,tt)
list corrh
So, can you please share code for sliding window correlation.Hi Sulagna,yes you are right.I need to do the 21 sliding window correlation as the way it's mentioned in your paper.On Tue, Aug 28, 2018 at 7:54 PM Sulagna <sulagna.ray@xxxxxxxxx> wrote:Hi Sandeep,If I understand you correctly, is Fig 10, and Fig 13 of the attached paper is what you would like to do? i.e. a correlation over a sliding 20-year window? If yes, then you could do the same in ferret. Although it is a multi-step approach but is very straight-forward, where you simply save the correlations in a file, and re-open to plot it.However, if I understood you wrongly, then am sorry.Best,SulagnaOn Tue, Aug 28, 2018 at 9:47 AM, Satyesh Ghetiya <satyeshghetiya@xxxxxxxxx> wrote:Hi Sandeep,Do you have, for each year, correlation r in XY dimension ? I mean r for each grid point of XY for each year ? Also can you elaborate the dimensions of two data sets ?On Tue, Aug 28, 2018 at 11:48 AM, Sandeep Mohapatra <sandeepmohapatra21@gmail.com > wrote:Hi,can anyone tell me how to do 21 yr running correlation in ferret between two data sets.Regards,G Satyesh,India.--On Tue, Aug 28, 2018 at 6:16 PM, Ryo Furue <furue@xxxxxxxxxx> wrote:On Tue, Aug 28, 2018 at 4:31 PM saurabh rathore <rohitsrb2020@xxxxxxxxx> wrote:Dear Ryo,Are you saying that the plot of such running correlation and trends will be like a time series ?I'm sorry, Saurabh, Sandeep, and other Ferret users. I've begun to think that my idea was wrong. I thought @SBX was the solution, but it doesn't keep the same mean value over the window, in formulae likeu' = u - mean(u).So, indeed the correct solution would be complicated. I'd like to know if there is an elegant solution.RyoG Satyesh