[Thread Prev][Thread Next][Index]

Re: [ferret_users] 21 yr running correlation



This could be done in a single Ferret session, most conveniently if the running length isn't too long. All the quantities needed for the calculation can be found from A_bar, B_bar, Asq_bar, Bsq_bar, AB_bar, where A and B are your variables and _bar is taken over the running interval.

These can be defined manually by terms such as (schematically)

let a_bar = ( a[l=@shf:(-n)] + a[l=@shf:(-n+1)] + ... + a[l=@shf:-1] + a + a[l=@shf:1] + ... + a[l=@shf:(n-1)] + a[l=@shf:n] )/(2n+1)

Thus, a_bar is a function of t (and possibly x,y,z).

Similarly for b, a^2, b^2, ab. They're just sums. If the line length is too long, the sum above can be broken into separate variables, then summed.

Then find your variances and correlations algebraically from standard expressions using these 5 sum terms.

It might be a pain to type out (a good text editor would help), but would let you do this in one script without intermediate writes.

Billy K

> On Aug 28, 2018, at 6: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@xxxxxxxxx> 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 like
> 
>       u' = u - mean(u).
> 
> So, indeed the correct solution would be complicated.  I'd like to know if there is an elegant solution.
> 
> Ryo
> 
> 
> 
> 
> -- 
> G Satyesh
> 




[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement