arch.univariate.ConstantMean.simulate

ConstantMean.simulate(params, nobs, burn=500, initial_value=None, x=None, initial_value_vol=None)[source]

Simulated data from a constant mean model

Parameters
paramsndarray

Parameters to use when simulating the model. Parameter order is [mean volatility distribution]. There is one parameter in the mean model, mu.

nobsint

Length of series to simulate

burnint, optional

Number of values to simulate to initialize the model and remove dependence on initial values.

initial_valueNone

This value is not used.

xNone

This value is not used.

initial_value_vol{ndarray, float}, optional

An array or scalar to use when initializing the volatility process.

Returns
simulated_dataDataFrame

DataFrame with columns data containing the simulated values, volatility, containing the conditional volatility and errors containing the errors used in the simulation

Examples

Basic data simulation with a constant mean and volatility

>>> import numpy as np
>>> from arch.univariate import ConstantMean, GARCH
>>> cm = ConstantMean()
>>> cm.volatility = GARCH()
>>> cm_params = np.array([1])
>>> garch_params = np.array([0.01, 0.07, 0.92])
>>> params = np.concatenate((cm_params, garch_params))
>>> sim_data = cm.simulate(params, 1000)
Return type

DataFrame