Previous topic

Econometric models

Next topic

fynance.models.econometric_models.ARMA

fynance.models.econometric_models.MA

fynance.models.econometric_models.MA(y, theta, c, q)

Moving Average model of order q s.t:

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

Time series.

theta : np.ndarray[np.float64, ndim=1]

Coefficients of model.

c : np.float64

Constant of the model.

q : int

Order of MA(q) model.

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

Residual of the model.

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])