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