Skip to contents

This generates random spline functions. It is used in the toy nonlinear dataset created in demo_spline(). This is not necessary for the essential multimedia workflow, it is only exported for potential independent interest.

Usage

spline_fun(D = 2, knots = NULL, h_ix = seq_len(10), ...)

Arguments

D

The number random spline functions to generate internally.

knots

The location of knots to use in the spline functions. Defaults to -4, -2, 0, 2, 4.

h_ix

The locations along which to generate the underlying spline function.

...

Additional arguments to pass to rnorm during the random noise generation for each call of the returned function.

Value

A function that can be used to sample points along the random spline functions. Takes argument 'x' giving the input to the spline and returns a D-dimensional response y giving random samples for each of the D splines..

See also

demo_spline