[Thread Prev][Thread Next][Index]
Re: [ferret_users] 21 yr running correlation
- To: Satyesh Ghetiya <satyeshghetiya@xxxxxxxxx>
- Subject: Re: [ferret_users] 21 yr running correlation
- From: "William S. Kessler" <william.s.kessler@xxxxxxxx>
- Date: Tue, 28 Aug 2018 12:01:04 -0700
- Arc-authentication-results: i=2; mx.google.com; dkim=pass header.i=@noaa.gov header.s=google header.b=HusCDTYa; spf=pass (google.com: domain of william.s.kessler@xxxxxxxx designates 209.85.220.41 as permitted sender) smtp.mailfrom=william.s.kessler@xxxxxxxx; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=noaa.gov
- Arc-authentication-results: i=1; mx.google.com; dkim=pass header.i=@noaa.gov header.s=google header.b=HusCDTYa; spf=pass (google.com: domain of william.s.kessler@xxxxxxxx designates 209.85.220.41 as permitted sender) smtp.mailfrom=william.s.kessler@xxxxxxxx; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=noaa.gov
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-archive:list-help:list-post:list-id:mailing-list:precedence:to :references:message-id:content-transfer-encoding:cc:date:in-reply-to :from:subject:mime-version:arc-authentication-results :arc-message-signature:dkim-signature:arc-authentication-results; bh=g07MlPL2Hql7KZ0YNyoRr9/+r+MSzZKCGpla9vfA+0Y=; b=D/RFxxbBne6TME7cPLHQNofbyIlyWQi4YsJf7boVsZV9tdRji2zlq6/AY8tDLjidDb KzokWKAqkxeDYkTEQG6J79FiA1Sej1VNbeKCje6tvy0GnVMjGhHE61/iln3ODQMKEZBt aijl0dPwbmoXFI70fcqdRiKLPcFzAhiJHCfIPg1FdBTLvFiA70V4A2JscjwZoTMegf0q ihH8INedfs2KgUtnA6LcZ3p2+so6DnE9T85GEPviRK4NiJs9Zgz7HxqMS+tlHovOoi5D BvOYPEJAm3nfwnUi+I0G3luk+ADq9jD5M6RtIfG8+1vmkVAUPJ76t2Gs3/gSfTPWGm1O qiLQ==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:dkim-signature :arc-authentication-results; bh=g07MlPL2Hql7KZ0YNyoRr9/+r+MSzZKCGpla9vfA+0Y=; b=YW+4Ne/kGL6jHHWYkKrRt33t1O/BbLaqWpBrOB8qsVCgWxnIdbFcIG6I368TeVJMHz L9sgOrtT6zLSRaI1H87JI/q91JNmKic5UprGwpTivtsaomNLRVkrBas4ggkg5Rq2+sRD 9Hiuwabo/TGd7rFINvOTOCXyh8endDGqi0lYGJp8Zt7juAuyij8OmcgTIUXk0gLLPj2U O+oo936FUakZJ1CjIO7L/0GjFqLBC2RodGNtEpCPoEmQCneSLtyvhZHvHhlXUKnD+Tx5 Qc5kWRWpxIs/XsZ+hVNMEr5BlfkHz+hDHVNwM1YhPUBsDvHt+rPZSbw+v1kNJx/Id7fk Lz0A==
- Arc-seal: i=2; a=rsa-sha256; t=1535482881; cv=pass; d=google.com; s=arc-20160816; b=bcLcPZW673XiI0sD0pwYkNLobJSN8c0CJimt30vPWsp1L765YKTzDpfS/D/+ufiWGe hGfO+AsJ3EzIVbnUmzf9+jGCoKG+W55FLEJsWyeWpIyOJiQ2Xho/aPExxNuO7H5tooHE K0QFm15KMTUAJVL/Jw0JztxpWsxu5CXt0rxL0JfN681ObJRGetDh+CA6hLtveBSZFPKJ pFtI8hUO5ZcjMSFv9BCS5MvKC03RQHCVIImjfWQWUXyLSQuaqXFQjOxSUaOEgxj60HY3 EuHAZ0UuakHdmj2OEdz33anPZ3Vq8MzALb4EX1kpMk+rHc5gPUsd9Q8A0/vuCPgmdlM0 DmmQ==
- Arc-seal: i=1; a=rsa-sha256; t=1535482880; cv=none; d=google.com; s=arc-20160816; b=Wr/mGAg0Gzu18OCLrKUM4hNVv3HPcMeUHxMsJ2r9c1jy9Rh3V2DEbQW6qsnpRRb3Gz 5MzqcpJIyEYlSF8aMFzmoQ2vDF8xY5hmkc6ItECLzBTYZ7do312lXM+POfT32A90xoYN JjdN0OPK4FSp5GxOLRWujunZJ/E4O/tkmTOpY7ije+RkrLQ5/nTy6gzX6h9l2j8RPOHe JwALlzav6EzFa/CgXXA6mQxzBMu9OsKdvCu7eLy81jaG4w+rOEp3sFJIwfM50pJntMa8 3tx6FkEoXNB5LKjLAZuFBJNxkrJfIH26CKUvMpwxxdcxRZbkV0nxI8BScsecQVaIj7m8 HQ4Q==
- Cc: "William S. Kessler" <william.s.kessler@xxxxxxxx>, Sandeep Mohapatra <sandeepmohapatra21@xxxxxxxxx>, ferret users <ferret_users@xxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=noaa.gov; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive; bh=g07MlPL2Hql7KZ0YNyoRr9/+r+MSzZKCGpla9vfA+0Y=; b=n8/QQofx64/l1yXFBi6I4D0ECVUIDExNKpv2t+fL4BV9uYRdRBvQ9ub/lTuFOHsrfg lFC6rQLm4b4uME8dFT+Sw1t2sumIWL7ABFZl2sk0nCkSDif2F/gOgPTu48ts15VsonOp 9FSX2da/BfZYa7q8dAkbsQ5v7CAY0gCT9Jej/VkMKEf+9ivKCGjJidXR+gw0PkulKeUQ 2TtEvjliPtqRwLWBUFZd6XeB7YFLddDtrYz1cyU9Povy1Khr5F8I3nUUYRCRmm1wn8aH KB8vOmKzzyeOKnEwiGiKWNDnUEwcUZI6fkLrjyzmu1rC+PpPkm4bkg6Fgub3T5T0B1RK ADtA==
- In-reply-to: <CALC=m4r0OjBk=-Yp38EkdJPD0KtQmYRUKBUYo3HxJEoZS3oRXg@mail.gmail.com>
- List-archive: <https://groups.google.com/a/noaa.gov/group/ferret_users/>
- List-help: <https://support.google.com/a/noaa.gov/bin/topic.py?topic=25838>, <mailto:ferret_users+help@noaa.gov>
- List-id: <ferret_users.noaa.gov>
- List-post: <https://groups.google.com/a/noaa.gov/group/ferret_users/post>, <mailto:ferret_users@noaa.gov>
- Mailing-list: list ferret_users@xxxxxxxx; contact ferret_users+owners@xxxxxxxx
- References: <CAOhUinKa=DqR6q8Vi12PjJcxeWrr21PL6POVLv6SHXjWo1HsYQ@mail.gmail.com> <CAEwQpaLc1bXQ3cs5b9856QO_rN4Ac1Xa6VxQ2BAD5hNcbdTPCg@mail.gmail.com> <CAFXLzPg2ZzetV4ZaZJbMKWmXfFO=Fyj0UhoPr+hmUkx0Uw-PtA@mail.gmail.com> <CAEwQpaLZmifxe9KNkK=UUAbyOsfuQCgERVbaUkEDFm7rpX8KPQ@mail.gmail.com> <CAFXLzPjBx83KX5n40Ex+vSn2qeLzbEX5+srnb7bNEFm1FoR_ow@mail.gmail.com> <CAEwQpaJrtt9RH9RXwJM_cD=Mme2_y5pFQ1afg7CbkRYq32xjgA@mail.gmail.com> <CALC=m4r0OjBk=-Yp38EkdJPD0KtQmYRUKBUYo3HxJEoZS3oRXg@mail.gmail.com>
- Sender: owner-ferret_users@xxxxxxxx
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