Approximation Module

Approximation

Types

Type Description

Spacing

Functions and values

Function or value Description

approx xData yData v ties

Full Usage: approx xData yData v ties

Parameters:
    xData : seq<float> - unsorted x values
    yData : seq<float> - y values of corresponding x values
    v : seq<float> - Collection of x values of which the y values should be predicted using straight interpolating lines between the input knots.
    ties : seq<float> -> float - function to transform a collection of y values, that have equal x values (e.g. Seq.average, Seq.max, Seq.min)

Returns: seq<float> Collection of predicted v,y tuples.

Return a sequence of points which interpolate the given data points by straight lines.

xData : seq<float>

unsorted x values

yData : seq<float>

y values of corresponding x values

v : seq<float>

Collection of x values of which the y values should be predicted using straight interpolating lines between the input knots.

ties : seq<float> -> float

function to transform a collection of y values, that have equal x values (e.g. Seq.average, Seq.max, Seq.min)

Returns: seq<float>

Collection of predicted v,y tuples.

chebyshevNodes interval n

Full Usage: chebyshevNodes interval n

Parameters:
    interval : Interval<float> - start and end value of interpolation range
    n : int - number of points that should be placed within the interval (incl. start and end)

Returns: Vector<float> Collection of chebyshev spaced x values.

Creates a collection of ordered x values within a given interval. The spacing is according to Chebyshev to remove runges phenomenon when approximating a given function.

www.mscroggs.co.uk/blog/57

interval : Interval<float>

start and end value of interpolation range

n : int

number of points that should be placed within the interval (incl. start and end)

Returns: Vector<float>

Collection of chebyshev spaced x values.

equalNodes interval n

Full Usage: equalNodes interval n

Parameters:
    interval : Interval<float> - start and end value of interpolation range
    n : int - number of points that should be placed within the interval (incl. start and end)

Returns: Vector<float> Collection of equally spaced x values.

Creates a collection of ordered x values within a given interval. The spacing of the values is always the same.

interval : Interval<float>

start and end value of interpolation range

n : int

number of points that should be placed within the interval (incl. start and end)

Returns: Vector<float>

Collection of equally spaced x values.

regularizeValues xData yData ties

Full Usage: regularizeValues xData yData ties

Parameters:
    xData : seq<float> - unsorted x values
    yData : seq<float> - y values of corresponding x values
    ties : seq<float> -> float - function to transform a collection of y values, that have equal x values (e.g. Seq.average, Seq.max, Seq.min)

Returns: seq<float * float> Collection of sorted x,y tuples with unique x values

Zips x and y values, sorts them by x values and applies a given function to y values of x duplicate (like R! regularize.values). 1. pairs x-y values 2. filters non finite entries and sorts value pairs by x values 3. handles y values of x value ties by given function

xData : seq<float>

unsorted x values

yData : seq<float>

y values of corresponding x values

ties : seq<float> -> float

function to transform a collection of y values, that have equal x values (e.g. Seq.average, Seq.max, Seq.min)

Returns: seq<float * float>

Collection of sorted x,y tuples with unique x values