design_matrix Subroutine

public subroutine design_matrix(order, intercept, x, c, err)

Computes the design matrix for the linear least-squares regression problem of , where is the matrix computed here, is the vector of coefficients to be determined, and is the vector of measured dependent variables.

See Also

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: order

The order of the equation to fit. This value must be at least one (linear equation), but can be higher as desired.

logical, intent(in) :: intercept

Set to true if the intercept is being computed as part of the regression; else, false.

real(kind=real64), intent(in) :: x(:)

An N-element array containing the independent variable measurement points.

real(kind=real64), intent(out) :: c(:,:)

An N-by-K matrix where the results will be written. K must equal order + 1 in the event intercept is true; however, if intercept is false, K must equal order.

class(errors), intent(inout), optional, target :: err

A mechanism for communicating errors and warnings to the caller. Possible warning and error codes are as follows. - FS_NO_ERROR: No errors encountered. - FS_ARRAY_SIZE_ERROR: Occurs if c is not properly sized. - FS_INVALID_INPUT_ERROR: Occurs if order is less than 1.


Contents