varwg.time_series_analysis.models.VAR_LS_sim¶
- varwg.time_series_analysis.models.VAR_LS_sim(B, sigma_u, T, m=None, ia=None, m_trend=None, u=None, n_presim_steps=100, fixed_data=None, prev_data=None, transform=None, phase_randomize=False, rphases=None, return_rphases=False, p_kwds=None, taboo_period_min=None, taboo_period_max=None)[source]¶
Based on a least squares estimator, simulate a time-series of the form ..math::y(t) = nu + A1*y(t-1) + … + Ap*y(t-p) + ut B contains (nu, A1, …, Ap). 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.
- 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.
- fixed_data(K, T) ndarray, optional
Data that will be fixed, i.e. at each timestep, these will be put in instead of the actual simulated values. Where fixed_data is nan, the simulated values will not be overwritten.
- transformcallable, optional
On-the-fly transformation that accepts a sequence of length K (values of all variables at one time step) and the time index t.
- Returns:
- Y(K, T) ndarray
Simulated values.
See also
VAR_LSLeast-squares estimator (to get B and sigma_u).
VAR_order_selectionHelps to find a p for parsimonious estimation.
VAR_residualsReturns the residuals based on given data and LS estimator
VAR_LS_predictPredict given prior data and LS estimator.