ORTHPOLYNOMIAL procedure

Calculates orthogonal polynomials (P.W. Lane).


Options

MAXDEGREE = scalar
Maximum degree of polynomial to be calculated; default is the number of identifiers in the pointer specified by the POLYNOMIAL parameter

WEIGHTS = variate
Weights to be used in orthogonalization; default * gives an equal weight to each unit


Parameters

X = variates
Values from which to calculate the polynomials; no default - this parameter must be set

POLYNOMIAL = pointers
Identifiers of variates to store results; no default - this parameter must be set


Description

Polynomials of low degree can be fitted by ordinary linear regression, estimating effects of terms X, X**2, X**3, and so on for a variate X. However, it is sometimes preferable to arrange that successive polynomial terms are orthogonal to each other; certainly, there are likely to be numerical problems with polynomials of degree five or more, if they are not orthogonal. ORTHPOLYNOMIAL calculates orthogonal polynomials up to a specified maximum degree from a given variate. The orthogonalization can be weighted by specifying a variate of weights.


Options: MAXDEGREE, WEIGHTS. Parameters: X, POLYNOMIAL.


Method

Successive formation of polynomials, starting with p1 = x - mean(x), ensuring orthogonality of pi with p1 ...pi-1; that is:

∑ ( weight × pi × pj ) = 0


Action with RESTRICT

A variate in the X parameter can be restricted: the restriction is transferred to the calculated polynomials, and to the weight variate if specified.