# Re: using regCoef for a regression-based model

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri, 21 Aug 2009 08:22:44 -0600

I may be misunderstanding but would you not want to multiply
ts_X with rc

Y' = ts_X # rc
D

Rob Nicholas wrote:
> Hi all,
>
> I'm trying to use NCL to create a linear regression model such that
> the leading EOFs of a scalar field X are used to "predict" another
> scalar field Y. Assuming both X and Y have dimensions (lat,lon,time)
> and we want to restrict the model to the first 5 EOFs, the NCL code
> for obtaining the regression coefficients might look something like
> this:
>
> n = 5
> eof_X = eofunc( X, n, False )
> ts_X = eofunc_ts( X, eof_X, False )
> rc = regCoef( ts_X, Y )
>
> Here eof_X contains the leading five EOFs and has dimensions
> (evn,lat,lon), ts_X contains the associated PCs and has dimensions
> (evn,time), and rc contains the regression coefficents and has
> dimensions (evn,lat,lon). Dimension evn is of size 5, one element for
> each mode (EOF).
>
> Now, here's the question: How can I use the regression coefficients rc
> and PCs ts_X to reconstruct Y?
>
> Ideally, what I'm looking for is something equivalent to the
> 'eof2data' function [say 'Y_reconst = regCoef2data( rc, ts_X )' ], but
> a more "mathematically explicit" representation would be fine too.
> Has anyone else done this successfully with NCL? Or am I missing
> something fundamental here?
>
> Thanks...
>
> ~Rob
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> 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 Fri Aug 21 2009 - 08:22:44 MDT

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