arch.univariate.ZeroMean.simulate

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

Simulated data from a zero mean model

Parameters
  • params ({ndarray, DataFrame}) – Parameters to use when simulating the model. Parameter order is [volatility distribution]. There are no mean parameters.

  • 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 no mean and constant volatility

>>> from arch.univariate import ZeroMean
>>> import numpy as np
>>> zm = ZeroMean()
>>> params = np.array([1.0])
>>> sim_data = zm.simulate(params, 1000)

Simulating data with a non-trivial volatility process

>>> from arch.univariate import GARCH
>>> zm.volatility = GARCH(p=1, o=1, q=1)
>>> sim_data = zm.simulate([0.05, 0.1, 0.1, 0.8], 300)