⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example_ms_ar_simul_2_states_t_dist.m

📁 Autoregressive Markov Switching Model函数用于评估、仿真及预测自回归的马尔可夫转换模型。可以选择用于模型估计的分布函数。用于研究时间序列结构性变化
💻 M
字号:
% Example Script for MS_AR_Sim.m (run it in the same directory - just press f5)

% This script will simulate a 2 states MS autoregressive model with some pre defined parameters
% You can change the coefficients for your own flavor

addpath('m_Files');

clear; 

nr=1000;    % Number of observations in simulation
advOpt.distrib='t';         % Distribution to use ('Normal' or 't' - default = 'Normal')

Coeff.p=[.8 .1 ; ...    % Transition matrix (this also defines the value of k)
         .2 .9 ];
         
Coeff.C(1,1)= .01;   % Setting up the mean constant at State 1
Coeff.C(1,2)=-.01;   % Setting up the mean constant at State 2

Coeff.v(1,1)= 5;   % Setting up the mean constant at State 1
Coeff.v(1,2)= 15;   % Setting up the mean constant at State 2

Coeff.AR(:,1)=[ .2   .1 -.1];   % Setting up the AR param at State 1 (you can increase/decrease it as wanted)
Coeff.AR(:,2)=[-.15 -.1  .1];   % Setting up the AR param at State 2 (you can increase/decrease it as wanted)   

Coeff.Std(1,1)=.02;  % Setting up the standard deviavion at State 1
Coeff.Std(1,2)=.01;  % Setting up the standard deviavion at State 2

ar=size(Coeff.AR,1);    % Number of lags in autoregressive component
k=length(Coeff.p);      % Number of states simulated (according to Coeff.p)

[Simul_Out]=MS_AR_Sim(nr,Coeff,k,advOpt.distrib); % Simulating the series

rmpath('m_Files');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -