I found them in two scripts - jzplot.ijs and plexam.ijs. The both look the
same. Here are the definitions:

NB. =========================================================
NB. cubicspline        - calculate cubic spline
NB. y is a 2-row matrix x ,: f(x)
NB. result is x values;coefficient matrix,one row per interval.
cubicspline=: 3 : 0
diff=. }.-}:
'x y'=. y
h=. diff x
k=. diff y
w=. 3 * diff k % *: h
n=. +:(2}.x)-_2}.x
sm=. ,~_2+#x
m=. sm$}.,(sm+0 1){.(}:h),.n,.}.h
c=. 0,w %. m
a=. }:y
b=. (k%h) - h * ((+:c) + }.c,0) % 3
d=. (diff c,0) % 3 * h
(}:x);a,.b,.c,.d
)

NB. =========================================================
NB. interspline        - interpolate spline
NB. x is a result from cubicspline
NB. y is a set of x coordinates
NB. returns corresponding f(x) values
interspline=: 4 : 0
'i m'=. x
n=. <: +/ i <:/ y
(n{m) p. y-n{i
)


On Sun, Oct 10, 2010 at 4:38 PM, Robert O'Boyle <[email protected]>wrote:

> Thanks for this. The demo uses two verbs that must be in an addon or
> somewhere else - cubicspline and interspline. Do you know where these might
> be?
>
> Bob
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Don Guinn
> Sent: October 10, 2010 12:00 PM
> To: Programming forum
> Subject: Re: [Jprogramming] Splines
>
> Look at demos, plot, gallery, curve fitting. There is a cubic and quintic
> spline example.
>
> On Sun, Oct 10, 2010 at 9:34 AM, Robert O'Boyle <[email protected]
> >wrote:
>
> >
> >
> > Hi Forum
> >
> >
> >
> > Are there any J scripts available on splines? I searched the forum
> archive
> > and website but nothing obvious emerged. I have some time series and
> > surfaces that I need to fit.
> >
> >
> >
> > Bob
> >
> >
> >
> > ----------------------------------------------------------------------
> > 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
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to