(Multi)Linear regression

Syntax

FIT …sequence-expr…

Typing

numeric[] -> FLOAT

numeric[n] -> FLOAT

(numeric; …; numeric)[] -> FLOAT

(numeric; …; numeric)[n] -> FLOAT

Description

General fitting function that takes one operands: an array or vector of observations of either unique numeric values or tuples of numeric values.

In the former case the unique value is supposed to be the value to predict (the dependent variable in math jargon), using the start event time as the predictor (if available).

In the later case, the first value of the tuple is the variable to predict and the others are the predictors (aka. the explanatory variables ).

Notice that the value that is predicted is the last of the observations rather than the next observations, which makes that function more handy when comparing the last observation with the prediction. Obviously, that last observed value is not taken into account to compute the prediction (but the last predictors are of course).

The result will be the predicted value.

Examples

expression evaluates to
FIT [1; 2; 3; 99] 4
FIT [(2; 1); (4; 2); (6; 3); (99; 4)] 8

See Also