python - Create a multivariate AR model in MATLAB -


i want create 2 vector time series in matlab, or python following. variances = 1 , 0.7, respectively.

x(t) = 0.9x(t − 1) − 0.5x(t − 2) + ε(t) y(t) = 0.8y (t − 1) − 0.5y (t − 2) + 0.16x(t − 1) − 0.2x(t − 2) + η(t) 

how go doing this... know x(t), can code following in matlab:

xmodel = arima('constant', 0, 'ar', {0.9, -0.5}, 'variance', 0.1); x = simulate(xmodel, 500); 

can provide insight how y(t) in both matlab and/or python. thank you!

in matlab can use arima beta property account additional regression coefficients:

ymodel = arima('constant',0,'ar',{0.8,-0.5},'beta',[0.16,-0.2],'variance',0.7)  ymodel =       arimax(2,0,0) model:     ---------------------     distribution: name = 'gaussian'                p: 2                d: 0                q: 0         constant: 0               ar: {0.8 -0.5} @ lags [1 2]              sar: {}               ma: {}              sma: {}             beta: [0.16 -0.2]         variance: 0.7 

edit: added command simulate illustrate how include x in simulation of y.

y = simulate(ymodel,500,'x',x); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -