varwg.time_series_analysis.models.VAREX_LS_sim

varwg.time_series_analysis.models.VAREX_LS_sim(B, sigma_u, T, ex, m=None, ia=None, m_trend=None, u=None, n_presim_steps=100, prev_data=None, ex_kwds=None)[source]

Based on a least squares estimator, simulate a time-series of the form ..math::y(t) = A1*y(t-1) + … + Ap*y(t-p) + C*x(t-1) + ut B contains (A1, …, Ap, C). See p. 707f

Parameters:
B(K, K*p+1) ndarray

Parameters of the VAR-process as returned from VAR_LS. K is the number of variables, p the autoregressive order.

sigma_u(K, K) ndarray

Covariance matrix of the residuals as returned from VAR_LS.

ex(T,) ndarray or function

External variable. If given as a function, ex_t will be generated by calling ex(Y[:t], **ex_kwds), with Y being the simulated values.

Tint

Number of timesteps to simulate.

m(K,) ndarray, optional

Process means (will be scaled according to B).

ia(K, T) ndarray, optional

Interannual variability. Additional time-varying disturbance to the process means (will be scaled according to B).

m_trend(K,) ndarray, optional

Change in means, that will be applied linearly so that this change is reached after the T timesteps.

u(K, T) ndarray, optional

Residuals to be used instead of multivariate gaussian serially independent random numbers.

n_presim_stepsint, optional

Number of presimulation timesteps that will be thrown away.

ex_kwdsdict, optional

Keyword arguments to be passed to ex.

Returns:
Y(K, T) ndarray

Simulated values.

ex_out(T,) ndarray

External variable.

See also

VAR_LS

Least-squares estimator (to get B and sigma_u).

VAR_order_selection

Helps to find a p for parsimonious estimation.

VAR_residuals

Returns the residuals based on given data and LS estimator

VAR_LS_predict

Predict given prior data and LS estimator.