[ncl-talk] Question about regressing a time series and a gridded data using regCoef_n
Lyndon Mark Olaguera
olagueralyndonmark429 at gmail.com
Thu Jun 22 00:28:17 MDT 2017
Dear NCL experts,
I am trying to calculate the linear regression coefficient between a single
time series and a gridded sst using the regCoef_n in ncl. I am using ncl
v.6.4.
Attached is my script and the text file that I am regressing. Here is the
link to the sst data:
[Link to the data]
https://drive.google.com/file/d/0B9faET7Bc2o8TjNSWnd1ODREcVU/view?usp=sharing
What I wanted to do:
1. I want to extract and plot significant coefficients (above 95%
confidence level), so I have this line in the script:
df = rc at nptxy-2 ; degrees of freedom
tval = rc at tval ; t-statistic
b = tval ; b must be same size as tval (and df)
b = 0.5
* prob = betainc(df/(df+tval^2),df/2.0,b) *
* rc95 = where(prob.lt.0.95,rc at _FillValue,rc)*
I encountered an error after this:
*fatal:where: condition variable (parameter 0) dimension mismatch with
parameter 2*
I understand that the *"prob"* variable has only one dimension and the "
*rc"* has 2 dimensions (lat & lon).
Is it possible to assign coordinates to "prob" similar to "rc" other than
the copyVarCoords?
I'll appreciate any suggestions on how to do this correctly.
Sincerely,
Lyndz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170622/c6de171f/attachment.html
-------------- next part --------------
4.4954473507
1.5692824762
-2.6254128643
-3.5041942263
-6.0382444055
-0.665126126
-2.7006099969
3.2194616877
-5.0052694951
0.9402502181
-0.0213985274
0.8377412575
-4.9575992442
-0.0518644772
-5.9669182407
-0.3056279181
-1.4163806063
-------------- next part --------------
A non-text attachment was scrubbed...
Name: regress.ncl
Type: application/octet-stream
Size: 2316 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170622/c6de171f/attachment.obj
More information about the ncl-talk
mailing list