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
  • params (ndarray) – Parameters to use when simulating the model. Parameter order is [mean volatility distribution]. There is one parameter in the mean model, mu.

  • nobs (int) – Length of series to simulate

  • burn (int, optional) – Number of values to simulate to initialize the model and remove dependence on initial values.

  • initial_value (None) – This value is not used.

  • x (None) – This value is not used.

  • initial_value_vol ({ndarray, float}, optional) – An array or scalar to use when initializing the volatility process.

Returns

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

Return type

DataFrame

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)