[Thread Prev][Thread Next][Index]
Re: How to fit data with a straight line
Hi,
Thank you very much. Bu now I have another problem,
Suppose I have data temperature with 49 year x 12 months = 588 time steps
currently SET data sets:
1> temp.nc (default)
name title I J K L
TEMP COADS SST 1:97 1:57 ... 1:588
PERIOD Averaging period ... ... ... 1:588
1) First of all I get annual mean temp
yes? def axis/t=1-jan-1945:31-dec-1993:365.25/units=days/edges/modulo tax1
yes? let TMEAN = TEMP[gt=tax1@mod]
2) Then I want to do regress for TMEAN
yes? let q = TMEAN
yes? let p = t
yes? set grid TMEAN
yes? go regresst
Then I got error messages:
**ERROR: unknown defining grid: GT=TAX1@MOD --> g=user-or-pseudo-var not allowed
set grid TMEAN
Command file, command group, or REPEAT execution aborted
Obviously the problem is due to 't', how to give 't' to p here?
And let ferret know this 't' is corresponding to TMEAN?
Thanks a lot.
Haijun Yang
> From ferret_users-owner@ferret.wrc.noaa.gov Wed Mar 22 15:00:35 2000
> From: "Mark Verschell" <verschell@neptune.gsfc.nasa.gov>
> Date: Wed, 22 Mar 2000 15:45:57 -0500
> In-Reply-To: Yang Haijun <navyang@tuna.meteor.wisc.edu>
"How to fit data with a straight line" (Mar 22, 1:48pm)
> References: <200003221948.AA14779@tuna.meteor.wisc.edu>
> X-Mailer: Z-Mail (5.0.0 30July97)
> To: Yang Haijun <navyang@tuna.meteor.wisc.edu>,
ferret_users@ferret.wrc.noaa.gov
> Subject: Re: How to fit data with a straight line
> Mime-Version: 1.0
> Content-Type: text/plain; charset=us-ascii
> Sender: owner-ferret_users@ferret.wrc.noaa.gov
> Precedence: bulk
> Content-Length: 872
>
> Look at the .jnl files regress?.jnl that would be in $FER_DIR/go, since you are
> trying to do this versus time, you would use regresst.jnl. A simple example for
> your case:
>
> yes? let p=temperature
> yes? let q=t
> yes? set grid q
> yes? go regresst
>
> Then:
>
> yes? list slope, intercep, rsquare ! slope is b and intercep is a
>
> You can also plot this with
>
> yes? plot qhat
>
> Mark
>
> On Mar 22, 1:48pm, Yang Haijun wrote:
> > Subject: How to fit data with a straight line
> > Dear ferret users,
> >
> > I have a time-series data, say Temperature with 40 years, now I want to fit
> this data with a
> > straight line, that is, I want to get this line:
> >
> > Y = a + b*t
> >
> > based on Temperature observations. Here Y is temperature, t is time step.
> How do I get 'a' and
> > 'b'? Is there a function to do this in ferret?
> >
> > Thank you very much,
> >
> > Haijun Yang
> >-- End of excerpt from Yang Haijun
>
>
>
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement