楼主: stanleyjunjun
1909 1

Matlab code for Markov Switching model - SWARCHFIT_6 [推广有奖]

  • 4关注
  • 10粉丝

已卖:1484份资源

副教授

19%

还不是VIP/贵宾

-

威望
0
论坛币
3588 个
通用积分
195.5870
学术水平
22 点
热心指数
32 点
信用等级
4 点
经验
18439 点
帖子
378
精华
0
在线时间
1015 小时
注册时间
2007-6-5
最后登录
2026-1-1

楼主
stanleyjunjun 发表于 2009-7-30 01:20:22 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
function [param,sumlike, output] = SWARCHFIT_6(y)
%%%%% model: Switching Variance model; to check why SWARCH failed
%%%%% y = mean(y) + c(s) + e
%%%%% e = u*h(s)^1/2; u - iid.N(0,1)
%%%%% reference Cai 1992
%%%%% coeff = [c(1) c(2) h(1) h(2) pro11 pro12(=1-pro11) pro21(=1-pro22) pro22]
%%%%% ATTENTION: Model results are very sensitive to initial starting value
%%%%% of params, get the right starting value will lead you to the global
%%%%% optimum.
% Linear inequality related to
% SumConA =  [0 0 0 0 1 0 1 0
%            0 0 0 0 0 1 0 1];  
% SumConB =  [1; 1];                     
% pro = [pro11 pro21; pro12 pro22]; param(pro part) = [pro11 pro21 pro12 pro22];
SumConEqA =  [0 0 0 0 1 0 1 0      
               0 0 0 0 0 1 0 1];  
SumConEqB =  [1; 1];   

lowerBounds  =  [-1 -1 0 0 0 0 0 0];   
% as lower bounds constraints.
upperBounds  =  [ 1 1 1 1 1 1 1 1];     
% options  =  optimset('fmincon');
options = optimset('Display','iter');
options = optimset(options, 'MaxIter',100);
% options = optimset(options, 'Algorithm','Active-set');
% options = optimset(options, 'Algorithm','Trust-region-reflective');
options = optimset(options, 'Algorithm','interior-point');
%%%%%%%%%%%%%%%   Trust-region-reflective ; interior-point :  Active-set
%%%%%%%%%%%%%%%   with interior-point we get the global maximum. with  
%%%%%%%%%%%%%%%   Trust only local maximum
  param0 = [0.01 0.05 0.0017 0.0017 0.9 0.1 0.1 0.9]';
% param0 = [0.04 0.42 -0.01 0.13 0.67 0.3 0.9 0.1 0.13 0.87];
% param0 = [0.05 -0.01 -0.01 0.01 049 0.51 0.9 0.9 0.1 0.1]';

% [param,sumlike, output] =  fmincon(@(param)SWATCH2_LIKE(y, param), param0,[],[],[],[],lowerBounds,upperBounds, @confuneq_SWATCH2, options);

% param0 = param;
[param,sumlike, output] =  fmincon(@(param)SWARCHLIKE_6(y, param), param0,[],[],SumConEqA,SumConEqB,lowerBounds,upperBounds, [], options);
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:matlab code switching Markov switch SWARCH

沙发
cwnikeboy 发表于 2009-10-17 09:39:55
非常感谢了

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2026-1-4 00:17