[ncl-talk] Effective Degree of Freedom

dickson mbigi dickson.mbigi at gmail.com
Thu Dec 3 20:23:49 MST 2020


Okay got it.
Thanks

On Fri, Dec 4, 2020 at 2:21 AM <ncl-talk-request at mailman.ucar.edu> wrote:

> Send ncl-talk mailing list submissions to
>         ncl-talk at mailman.ucar.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mailman.ucar.edu/mailman/listinfo/ncl-talk
> or, via email, send a message with subject or body 'help' to
>         ncl-talk-request at mailman.ucar.edu
>
> You can reach the person managing the list at
>         ncl-talk-owner at mailman.ucar.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ncl-talk digest..."
>
>
> Today's Topics:
>
>    1. Effective Degree of Freedom (dickson mbigi)
>    2. Re: NCARG_COLORMAPS in conda (Jian Zheng)
>    3. Re: Effective Degree of Freedom (Dennis Shea)
>    4. Plot csv file (Anahita Amiri Farahani)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 3 Dec 2020 08:25:59 +0800
> From: dickson mbigi <dickson.mbigi at gmail.com>
> To: NCL-talk <ncl-talk at ucar.edu>
> Subject: [ncl-talk] Effective Degree of Freedom
> Message-ID:
>         <CALUZNzOzszoPZz5xRtZeLVbZYaNkXpVy=
> q+RRBY5sVm4uxUiqw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi everyone,
> I have sst(time) and pre(lon,lat,time) low pass filtered data sets. I can
> calculate spatial correlation, but for the significance test   using
> Student's t- test I need to use effective degrees of freedom because  my
> data have been filtered. I went through NCL website and found ''equivalent
> sample size'' function which I think is quite different from the effective
> degrees of freedom. Is there a function or a way to use Effective Degree of
> freedom to perform significance tests in spatial correlation analysis?
>
> Ndof =N(1-r1r2)/(1+r1r2), where N is sample size, r1&r2 are the lag-1
> autocorrelations of the two time series.
>
> Thanks in advance.
> Dickson.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201203/cfbd359e/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Thu, 3 Dec 2020 11:13:39 +0800
> From: Jian Zheng <jzheng8606 at gmail.com>
> To: Rick Brownrigg <brownrig at ucar.edu>
> Cc: Ncl-talk <ncl-talk at ucar.edu>
> Subject: Re: [ncl-talk] NCARG_COLORMAPS in conda
> Message-ID:
>         <
> CAFMEVXN2tHnLXEYVyhdMb4iR3OL0Swd+3FEZNp8PETiNL09SxA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Rick,
>
> I find that defining NCARG_COLORMAPS after the conda-initializing part in
> the .bash_profile can solve the problem.
>
> Thanks a lot for all your help.
> Jian
>
> On Sat, Nov 21, 2020 at 12:22 AM Rick Brownrigg <brownrig at ucar.edu> wrote:
>
> > Hi Jian,
> >
> > When you say it is not working, are you getting messages such as this
> when
> > you try to reference your custom colormap:
> >
> > fatal:CvtStringToCmap:Unable to convert string "foo" to ColorMap
> > warning:Error retrieving resource wkColorMap from args - Ignoring Arg
> >
> > I don't know where the OLD_NCARG_COLORMAPS setting would be coming from
> in
> > your environment. I would note that the second path in it --
> > /lib/ncarg/colormaps -- would be incorrect. I don't know that it would
> > break things if the first path is correct however.
> >
> > I have a stock ncl installation from conda. I copied an arbitrary
> colormap
> > from $NCARG_ROOT/lib/colormaps into /tmp, renamed it "foo.rgb", and set
> > NCARG_COLORMAPS=/tmp. Then when I run this little script, everything
> works:
> >
> > ncl 1>   wks = gsn_open_wks("x11","test")
> > ncl 2>   gsn_define_colormap(wks,"foo")
> > ncl 3> gsn_draw_colormap(wks)
> >
> > if I unset NCARG_COLORMAPS, and re-run, then I get the fatal/warning
> > errors mentioned above.
> >
> > So I would have to conclude something is not quite right in your
> > environment. Perhaps before trying to set envvars via .bash_profile,
> > perhaps try setting them on the command line. Are you certain your
> colormap
> > is in the directory you cite? Are you certain its format is valid for
> NCL?
> > Perhaps try what I did -- copying a known colormap into your custom
> > directory, rename it to something that does not collide with NCL's
> colormap
> > names, and see if you  can get the little scriptlet above to work.
> >
> > I hope that helps...
> > Rick
> >
> >
> > On Fri, Nov 20, 2020 at 8:54 AM Jian Zheng <jzheng8606 at gmail.com> wrote:
> >
> >> Hi Rick,
> >>
> >> When I ran "env | grep NCARG", I got
> >>
> >>
> >>
> OLD_NCARG_COLORMAPS=/Users/jzheng/Documents/nclcolormap:/lib/ncarg/colormaps
> >>
> >> NCARG_ROOT=/Users/jzheng/opt/miniconda3
> >>
> >>
> >> Does it show you more information?
> >>
> >>
> >> On Fri, Nov 20, 2020 at 12:49 PM Rick Brownrigg <brownrig at ucar.edu>
> >> wrote:
> >>
> >>> Hi Jian,
> >>>
> >>> Offhand that all looks reasonable. Only you can verify the custom path.
> >>> Did you "source" your .bash_profile after you modified it?  I'm not
> sure
> >>> what else to suggest.
> >>>
> >>> Rick
> >>>
> >>> On Thu, Nov 19, 2020 at 9:34 PM Jian Zheng <jzheng8606 at gmail.com>
> wrote:
> >>>
> >>>> Hi Rick,
> >>>>
> >>>> NCARG_COLORMAPS (export
> >>>>
> NCARG_COLORMAPS=/Users/jzheng/Documents/nclcolormap:$NCARG_ROOT/lib/ncarg/colormaps)
> >>>> contains the directory where I put my user-defined colormap files.
> When I
> >>>> run ncl, it doesn't see these colormaps.
> >>>>
> >>>> Thanks,
> >>>> Jian
> >>>>
> >>>> On Thu, Nov 19, 2020 at 9:33 PM Rick Brownrigg <brownrig at ucar.edu>
> >>>> wrote:
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>> What do you mean "it does not work"?  What happens?  Normally one
> >>>>> should not need to set that environment variable unless there's
> something
> >>>>> unusual about the way the code is installed.  It is common however
> to set
> >>>>> NCARG_ROOT, and that should point to the directory containing the NCL
> >>>>> installation; i.e., the directory with the bin/ lib/ include/ and
> man/
> >>>>> directories belonging to NCL.  I don't recall offhand where a stock
> conda
> >>>>> install places those directories.
> >>>>>
> >>>>> Rick
> >>>>>
> >>>>>
> >>>>> On Thu, Nov 19, 2020 at 1:47 AM Jian Zheng via ncl-talk <
> >>>>> ncl-talk at mailman.ucar.edu> wrote:
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> I installed ncl6.6.2 in conda root environment. When I set
> NCARG_COLORMAPS
> >>>>>> in my ~/.bash_profile file, it did not work. How should I set
> NCARG_COLORMAPS
> >>>>>> with conda correctly?
> >>>>>>
> >>>>>> Thanks,
> >>>>>> Jian
> >>>>>> _______________________________________________
> >>>>>> ncl-talk mailing list
> >>>>>> ncl-talk at mailman.ucar.edu
> >>>>>> List instructions, subscriber options, unsubscribe:
> >>>>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >>>>>
> >>>>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201203/e73faef6/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 3
> Date: Thu, 3 Dec 2020 09:44:35 -0700
> From: Dennis Shea <shea at ucar.edu>
> To: dickson mbigi <dickson.mbigi at gmail.com>
> Cc: NCL-talk <ncl-talk at ucar.edu>
> Subject: Re: [ncl-talk] Effective Degree of Freedom
> Message-ID:
>         <CAOF1d_6CO1djz=
> ZCQgjRGhqtuw1yEoxe4n62APfcgJHaXJ7sgw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> I believe you have asked this question before.
>
> ****ncl-talk is not a statistics forum. ****
> * ***Please talk to a statistician****
>
> ====
> (1) Possibly:
> You could use *esacr*
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/esacr.shtml> or
> *esacr_n*
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/esacr_n.shtml>
> (esacr_n is available in NCL 6.5.0 and later) on the filtered series to get
> the lag_1 autocorrelation coefficients.
>
> r_sst   = esacr(sst,1)
> r1_sst = r_sst(1)              ; scalar; r1_sst(1)
> r1_sst at long_name = "Lag-1 autocorrelation: sst
> print(r1_sst)
>                                         ; pre(lat,lon,time)  ... time is
> rightmost dimension
> r_pre  = esacr(pre,1)       ; r_pre(2,lat,lon,time)
> r1_pre = r_pre(1,:,:)        ; r1_pre(nlat,mlom)
> r1_pre at long_name = "Lag-1 autocorrelation: pre"
> printVarSummary(r1_pre)
> printMinMax(r1_pre)
>
>
> r1_sst *:=* conform(r1_pre, r1_sst, -1)   ; := overwrite
> printVarSummary(r1_sst)                 ; (nlat,mlon)
>
> r1_sst_pre = r1_sst*r1_pre              ; array (grid point-by-grid
> point) multiply
>
> Ndof = N*(1-r1_sst_pre)/(1+r1_sst_pre), where N is the original sample
> size of time series
>
> printVarSummary(Ndof)                   ; (nlat,mlon)
>
> printMinMax(Ndof,0)
>
>
> ====
> (2)
> Perhaps, a better approach:
>
> DOI: 10.1016/S0275-1062(04)90014-8
> (2004) Determination of the degree of freedom of digital filtered time
> series with an application to the correlation analysis between the length
> of day and the Southern oscillation index
> ====
>
> Again, it is best to talk with a statistician.
>
>
> On Wed, Dec 2, 2020 at 5:26 PM dickson mbigi via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
> > Hi everyone,
> > I have sst(time) and pre(lon,lat,time) low pass filtered data sets. I can
> > calculate spatial correlation, but for the significance test   using
> > Student's t- test I need to use effective degrees of freedom because  my
> > data have been filtered. I went through NCL website and found
> ''equivalent
> > sample size'' function which I think is quite different from the
> effective
> > degrees of freedom. Is there a function or a way to use Effective Degree
> of
> > freedom to perform significance tests in spatial correlation analysis?
> >
> > Ndof =N(1-r1r2)/(1+r1r2), where N is sample size, r1&r2 are the lag-1
> > autocorrelations of the two time series.
> >
> > Thanks in advance.
> > Dickson.
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk at mailman.ucar.edu
> > List instructions, subscriber options, unsubscribe:
> > https://mailman.ucar.edu/mailman/listinfo/ncl-talk
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201203/7b26972c/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 4
> Date: Thu, 3 Dec 2020 13:21:04 -0500
> From: Anahita Amiri Farahani <aamir003 at ucr.edu>
> To: "ncl-talk [ncl-talk]" <ncl-talk at ucar.edu>
> Subject: [ncl-talk] Plot csv file
> Message-ID:
>         <
> CAABdVry-zwn-y4omPNi2VNYVJPQOUP_W5ZqEUb7ZhsBTphScvA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello all,
>
> I tried to read and plot the csv data, but I faced some errors. I've
> attached both data and the code.
>
> Thank you,
> ana
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201203/a266e1eb/attachment.html
> >
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: Book4.csv
> Type: text/csv
> Size: 1320725 bytes
> Desc: not available
> URL: <
> https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201203/a266e1eb/attachment.csv
> >
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: test.ncl
> Type: application/octet-stream
> Size: 2564 bytes
> Desc: not available
> URL: <
> https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201203/a266e1eb/attachment.obj
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> ------------------------------
>
> End of ncl-talk Digest, Vol 205, Issue 3
> ****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201204/539c7862/attachment.html>


More information about the ncl-talk mailing list