Basis

scalaglm.Basis$
object Basis

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Basis.type

Members list

Value members

Concrete methods

def bs(x: DVD, degree: Int, intercept: Boolean)(intKnots: Seq[Double], lb: Double, ub: Double): DMD

Construct a B-spline covariate matrix using input vector x.

Construct a B-spline covariate matrix using input vector x.

Value parameters

degree

The degree of the required B-spline basis (3 for cubic, default).

intKnots

Interior knots.

intercept

Include first basis function?

lb

Lower boundary knot.

ub

Upper boundary knot.

x

A covariate vector.

Attributes

def bspline(x: Double, i: Int, deg: Int, knots: Vector[Double]): Double

B-spline basis function. Evaluated using the de Boor recurrence.

B-spline basis function. Evaluated using the de Boor recurrence.

Value parameters

deg

The degree of the B-spline.

i

The index of the B-spline function (starting from 0).

knots

The knot sequence.

x

The argument of the B-spline function.

Attributes

Returns

The value of the B-spline function at x.

def cosine(x: DVD, n: Int): DMD

Construct a cosine series basis matrix with n columns using input vector x.

Construct a cosine series basis matrix with n columns using input vector x.

Value parameters

n

The number of cosine series basis functions required.

x

A covariate vector.

Attributes

Returns

A matrix with rows matching the length of x and n columns.

def cosine(x: Double, j: Int): Double

Cosine orthogonal basis function. Normalised with sqrt(2).

Cosine orthogonal basis function. Normalised with sqrt(2).

Value parameters

j

The order of the basis function (assumed >= 1).

x

The argument of the cosine function, nominally between 0 and 1.

Attributes

Returns

The value of the cosine basis function at x.

def legendre(x: Double, n: Int): Double

Legendre orthogonal polynomial function. Evaluated using Bonnet's recursion.

Legendre orthogonal polynomial function. Evaluated using Bonnet's recursion.

Value parameters

n

The degree of the polynomial.

x

The argument of the polynomial, nominally between -1 and 1.

Attributes

Returns

The value of the nth polynomial at x.

def poly(x: DVD, degree: Int, raw: Boolean): DMD

Construct a polynomial basis matrix with degree columns using input vector x. Defaults to orthogonal Legendre polynomials, but raw monomials can be requested.

Construct a polynomial basis matrix with degree columns using input vector x. Defaults to orthogonal Legendre polynomials, but raw monomials can be requested.

Value parameters

degree

The maximum degree of the polynomial basis.

raw

Raw monomial basis (true) or orthogonal polynomials (false, default).

x

A covariate vector.

Attributes

Returns

A matrix with rows matching the length of x and degree columns.