SVResult.simulate#

SVResult.simulate(n=200, *, seed=None, burn=0)[source]#

A fresh sample path at the fitted parameters.

The log variance starts from its stationary law and the series is read from it with the fitted tails and leverage, so no burn-in is needed; burn is honoured for uniformity with the other results.

Parameters:
  • n (int) – Observations kept.

  • seed (int | Generator | None) – Seed or generator.

  • burn (int) – Periods discarded from the start.

Return type:

NDArray[double]

Returns:

An array of shape (n,).

Raises:

SpecificationError – If the counts are not usable or the parameters leave the stationary region.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> res = SV(rng.standard_normal(200), mean="zero").fit()
>>> path = res.simulate(20000, seed=1)
>>> path.shape, bool(abs(path.var() - res.unconditional_variance) < 0.1)
((20000,), True)
>>> res.simulate(0)
Traceback (most recent call last):
    ...
cultivars.exceptions.SpecificationError: n must be positive and burn non-negative; ...