Residuals() based on lsquares_residuals (D, x, e, a)
Returns the residuals for the equation e with specified parameters a and data D.
D is a matrix, x is a list of variables, e is an equation or general expression; if not an equation, e is treated as if it were e = 0
. a is a list of equations which specify values for any free parameters in e aside from x.
The residuals are defined as:
lhs(e ) - rhs(e )
i i
where e[i]
is the equation e evaluated with the variables in x assigned values from the i
-th datum, D[i]
, and assigning any remaining free variables from a.
MSE() based on lsquares_residual_mse (D, x, e, a)
Returns the residual mean square error (MSE) for the equation e with specified parameters a and data D.
The residual MSE is defined as:
n
====
1 \ 2
- > (lhs(e ) - rhs(e ))
n / i i
====
i = 1
where e[i]
is the equation e evaluated with the variables in x assigned values from the i
-th datum, D[i]
, and assigning any remaining free variables from a.