Splines are another good way, but I think a lot has to do with
how accurate you think the data are.  I'm not an expert on this either.

Or, you could use the fft to strip out the high-frequency information.
This has the benefit of matching at the endpoints.
Download the fftw addon, and then

plot [EMAIL PROTECTED] ((%#)i._6)&(] * [EMAIL PROTECTED] |. [EMAIL PROTECTED] 
{. |[EMAIL PROTECTED] , 1 , [)&.fftw 30 # tave

(Bartlett window, where the _6 is the size of the window - increase
to keep more high frequencies) 

Henry Rich

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Anssi Seppälä
> Sent: Friday, June 08, 2007 4:34 PM
> To: General forum
> Subject: Re: [Jgeneral] Interpolating monthly temperatures
> 
> Thank you, there surely is a lot of ways, but fit seems most suitable 
> at first glance. The resulting curves monthly averages are very close 
> to the original monthly averages.
> 
> Indeed the correct data is:  tave=:_7.3 _6.6 _1.8 3.6 11.1 17.1 19.8 
> 17.1 11.3  4.7 _1.3 _5.0
> 
> Anssi
> 
> At 22:19 8.6.2007, you wrote:
> There's all kinds of curve fitting.
> 
> >For example, here's a fairly trivial fit that might or might not be
> >close to what you are looking for:
> >
> >extend=: +/ .*&2 _1@(2&{.) , ] , +/ .*&_1 2@(_2&{.)
> >zero=: {. -:@+ {:
> >ct=: 2 o. 1r29p1*i.30
> >fit=: 15 }. _15 }. [: , 2&((zero + ct * zero - {:)\)@extend
> >
> >Here's a somewhat different approach, emphasizing appearance:
> >
> >arbitraryConstant=:300
> >curve=:3 :0
> >  rough=.30#y
> >  basis=.^((*-)  -/~ i.#rough)%arbitraryConstant
> >  shape=.basis +/ .*basis%.rough
> >  max=.(i.>./)|shape
> >  shape*rough%&(max&{)shape
> >)
> >
> >Contrast:
> >   plot (curve tave),(fit tave),:30#tave
> >
> >(As an aside, I'm no expert on curve fitting issues.)
> >
> >--
> >Raul
> >-------------------------------------------------------------
> ---------
> >For information about J forums see 
> http://www.jsoftware.com/forums.htm
> 
> ----------------------------------------------------------------------
> For information about J forums see 
> http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to