# Re: svdcov_sv

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 25 2013 - 16:43:42 MDT

[1] Sorry, I have no experience with "squared covariance"
[2] anomalies: I would make the original input (x, y) be anomalies
Then project the various 'right/left' arrays onto the original
anomaly data. As in [1]: no experience with this.

[3[ if it takes too much time, input a smaller subset of the data
for testing.

On 7/24/13 2:53 PM, Ahmad Farsyud wrote:
> Thank you expert, for your kind hints. this function consumed so much time
> to work in ncl, though!! One last question how could i calculate a squared
> covariance (sc) for each svd analysis in each mode? and also how could i
> get the values in anomalies from each mode, in eof is really clear how to
> do that.
>
> thank you so much,
>
> AF
>
>
>
>
> On Thursday, July 18, 2013, Dennis Shea wrote:
>
>> ??? 2d fields [timexlatxlon] <=== this is 3d
>>
>>
>> [1]
>> Let x(time,lat,lon) ; sizes ==> (ntim,nlat,mlon)
>> y(time,lat,lon)
>>
>> nxy = nlat*mlon
>> ; reorder so time varying fastest
>> X = x(lat|:,lon|:,time|:) ; sizes ===>(nlat,mlon,ntim)
>> X2 = onedtond( ndtooned(X), (/ nxy, ntim /) ) ; (:,:)
>>
>> Y = ...
>> Y2 = ...
>> delete( [/x,y,X,Y/])
>>
>> nsvd = ...
>>
>> svLeft = new((/nsvd,nxy/),typeof(x)) ; pre-allocate space
>> svRight = new((/nsvd,nxy/),typeof(x))
>>
>> pc = svdcov_sv(X2,Y2,nsvd,svLeft,**svRight)
>>
>> printVarSummary(pc)
>>
>>
>> [2]
>> No. You can write your own plot code.
>>
>> do ns=0,nsvd-1
>> left = onedtond(svLeft(ns,:) , (/nlat,mlon/) ) ; reshape
>> rght = onedtond(svRight(ns,:), (/nlat,mlon/) )
>>
>> left!0 = "lat"
>> left!1 = "lon"
>> left&lon = x&lon
>> left&lat = x&lat
>>
>> rght!0 = "lat"
>> rght!1 = "lon"
>> rght&lon = x&lon
>> rght&lat = x&lat
>>
>> ; plot code here
>>
>>
>> end do
>>
>> [3] lags .. the following is untested
>>
>> ntim = dimsizes(x&time)
>>
>> nlag = 3
>>
>> nxStrt = 0
>> nxLast = ntim-1-nlag
>> nxTime = nxLast-nxStrt+1
>> X = x(lat|:,lon|:,time|nxStrt:**nxLast) ; sizes ===>(nlat,mlon,ntim)
>> X2 = onedtond( ndtooned(X), (/ nxy, nxTime /) ) ; (:,:)
>>
>> nyStrt = nlag
>> nyLast = ntim-1
>> nyTime = nyLast-nyStrt+1
>> Y = y(lat|:,lon|:,time|nyStrt:**nyLast) ; sizes ===>(nlat,mlon,ntim)
>> Y2 = onedtond( ndtooned(X), (/ nxy, nyTime /) ) ; (:,:)
>>
>> X2 leads Y2 by 'nlag' time steps
>>
>> ++++++++++++++++++++++++++++++**+++++++++++++
>> ++++++++++++++++++++++++++++++**+++++++++++++
>> NOTE: I do not have the time for multiple emails.
>> You will have to figure the rest out yourself.
>> ++++++++++++++++++++++++++++++**+++++++++++++
>> ++++++++++++++++++++++++++++++**+++++++++++++
>>
>> On 07/11/2013 12:31 AM, Ahmad Farsyud wrote:
>>
>>> Hi NCL,
>>>
>>> I have several question regarding this function "svdcov_sv":
>>> http://www.ncl.ucar.edu/**Document/Functions/Built-in/**svdcov_sv.shtml<http://www.ncl.ucar.edu/Document/Functions/Built-in/svdcov_sv.shtml>
>>> 1. How could I apply this function for 2d fields [timexlatxlon]
>>> 2. Is there any example of the display output using this function in NCL?
>>> 3. One can give me suggestion , what should I do if I want to use svd
>>> for time-lagged analysis?
>>>
>>> Thank you,
>>> - AF
>>>
>>>
>>> ______________________________**_________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/**mailman/listinfo/ncl-talk<http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>>>
>>>
>>
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 25 16:43:53 2013

This archive was generated by hypermail 2.1.8 : Thu Jul 25 2013 - 21:02:42 MDT