# Re: using regCoef for a regression-based model

From: Rob Nicholas <rnicholas_at_nyahnyahspammersnyahnyah>
Date: Sat, 22 Aug 2009 23:06:39 -0700

All,

Just to follow up -- the method suggested below and eof2data() produce
essentially identical results. The very small differences I found are
on the order of 0.001% or less, so rounding errors I presume.

Thanks to Dennis Shea for his suggestions and for providing the source
code for eof2data().

~Rob

On Fri, Aug 21, 2009 at 8:35 AM, Rob
Nicholas<rnicholas_at_atmos.washington.edu> wrote:
> Dennis et al,
>
>> I may be misunderstanding but would you not want to multiply
>> ts_X with rc
>>
>>   Y' = ts_X # rc
>
> I think it's a little more complicated than this.  First off, rc has
> dimensions (evn,lat,lon) and # only works with 1-D and 2-D arrays, so
> rc would have to be reshaped to (evn, lat * lon); there doesn't seem
> to be anything like an 'ndto2d' function in NCL, but this could be
> done by looping over evn and using 'ndtooned'.  Also, we'd need the
> transpose of ts_X to do the inner product, since it has dimensions
> (evn,time).
>
> So, maybe something like this...
>
>     rc_reshaped = new( (/ dimsizes(evn), dimsizes(lat)*dimsizes(lon) /) )
>     do i = 0,  1 - dimsizes(evn)
>          rc_reshaped( i, : ) = ndtooned( rc(i, :, : ) )
>     end do
>     almost_Y_prime = transpose( ts_X ) # rc_reshaped
>     Y_prime = onedtond( almost_Y_prime, (/ dimsizes(time),
> dimsizes(lat), dimsizes(lon) /)
>
> Offhand, I would have guessed that this is essentially what 'eof2data'
> is doing internally -- or is it completely different?
>
> ~Rob
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Aug 23 2009 - 00:06:39 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 24 2009 - 11:15:23 MDT