# a regression question, clarification

```

Hi, I wanted to clarify my regression question as I think I've found a
suitable workaround, I just don't understand why the way outlined in the
first post doesn't work.

Trying to regress 40 years of daily data onto a 40year daily time series
by simply summing the product of each day's data with that day's index
value.

So I tried something like:
let tempa58=hgtanom[d=2,z=1000,t=1-jan-1958:28-feb-1958]*ao[d=1,z=1000,gt=`hgtanom[d=2],return=GRID`@asn]
let testa58=tempa58[t=1-jan-1958:28-feb-1958@sum]
save/file=hgtanomtemp.1000.nc/clobber testa58

and kept doing this for each time period that I wanted to sum up (each
winter).  But when I do this the final answer appears to be wrong.

So now I do:

let tempa60=hgtanom[d=2,z=1000,t=1-jan-1960:28-feb-1960]*ao[d=1,z=1000,t=1-jan-1960:28-feb-1960]
let testa60=tempa60[t=1-jan-1960:28-feb-1960@sum]

and sum up all the test#'s.  When I do this I get a message such as:

*** NOTE: Ambiguous coordinates on T axis:
HGTANOM[D=2,Z=1000,T=1-JAN-1987:28-FEB-1987]*AO[D=1,Z=1000,T=1-JAN-1987:28-FEB-1987]

BUT, when I look at the final answer, this way works correctly!

Can someone fill me in on what's going wrong in the regridding? (assuming
that's where the problem is).

Thanks,
Brent
--
Brent A. McDaniel

Dept of Earth and Atmospheric Sciences
Georgia Institute of Technology
Atlanta, Ga.  USA

______EARLIER POST____________________

Hi Ferret Users,

I'm trying to regress a dataset onto a seperate time series.  The time
series has 17 levels with each level having 14610 time points.  I've
normalized the time series so that it has 0 mean and variance of 1.  I
only want to regress the djf data onto the djf time series.  I couldn't
really think of a good way to do this so here's a sample of the .jnl file
that I'm using to just do the 1000mb surface:

set memory/size=100
use aoindex.cdf
use hgtanom.1958.nc
let tempa58=hgtanom[d=2,z=1000,t=1-jan-1958:28-feb-1958]*ao[d=1,z=1000,gt=`hgtanom[d=2],return=GRID`@asn]
let testa58=tempa58[t=1-jan-1958:28-feb-1958@sum]
save/file=hgtanomtemp.1000.nc/clobber testa58
cancel data/all
cancel variables/all
use aoindex.cdf
use hgtanom.1958.nc
let
tempb58=hgtanom[d=2,z=1000,t=1-dec-1958:31-dec-1958]*ao[d=1,z=1000,gt=`hgtanom[d=2],return=GRID`@asn]
let testb58=tempb58[t=1-dec-1958:31-dec-1958@sum]
use hgtanomtemp.1000.nc
let test58=testa58+testb58
save/file=hgtanomtemp.1000.nc/clobber test58
cancel variables/all
cancel data/all
use aoindex.cdf
use hgtanom.1959.nc
let
tempa59=hgtanom[d=2,z=1000,t=1-jan-1959:28-feb-1959]*ao[d=1,z=1000,gt=`hgtanom[d=2],return=GRID`@asn]
let testa59=tempa59[t=1-jan-1959:28-feb-1959@sum]
let tempb59=hgtanom[d=2,z=1000,t=1-dec-1959:31-dec-1959]*ao[d=1,z=1000,gt=`hgtanom[d=2],return=GRID`@asn]
let testb59=tempb59[t=1-dec-1959:31-dec-1959@sum]
use hgtanomtemp.1000.nc
let test59=testa59+testb59+test58[d=3]
save/file=hgtanomtemp.1000.nc/clobber test59
.....

and it continues to the end of the time series.

The problem with this is...it's seems to give the wrong answer.  After
plotting the final results and comparing them with the pattern I should
have gotten, they really don't match up.  More importantly, I picked a
point in space and did the regression in excel and it's very different
than the result returned by my ferret routine (-1.5 returned by ferret, 45
returned by excel).  This says to me that something is buggy in my ferret
better way to do this that doesn't rely on temp variables but I couldn't
find a clean way around them because a) no recursions in the variables and
b) I needed to open up more than 30 different files at a time that were
not continuous in time.

Thanks for the help,

Brent

--
Brent A. McDaniel

Dept of Earth and Atmospheric Sciences
Georgia Institute of Technology
Atlanta, Ga.  USA

```