MAΒΆ

Defined in fynance.models.econometric_models

MA(y, theta, c, q)[source]

Moving Average model of order q s.t:

\[y_t = c + \theta_1 * u_{t-1} + ... + \theta_q * u_{t-q} + u_t\]
Parameters:
ynp.ndarray[np.float64, ndim=1]

Time series.

thetanp.ndarray[np.float64, ndim=1]

Coefficients of model.

cnp.float64

Constant of the model.

qint

Order of MA(q) model.

Returns:
unp.ndarray[ndim=1, dtype=np.float64]

Residual of the model.

See also

ARMA_GARCH, ARMA, ARMAX_GARCH

Examples

>>> y = np.array([3, 4, 6, 8, 5, 3])
>>> MA(y=y, theta=np.array([0.8]), c=3, q=1)
array([ 0.    ,  1.    ,  2.2   ,  3.24  , -0.592 ,  0.4736])