楼主: taoflower
3117 5

找到了一个 CCAPM的matlab程序 大家一起来研究一下。 [推广有奖]

  • 0关注
  • 2粉丝

讲师

41%

还不是VIP/贵宾

-

威望
0
论坛币
-20 个
通用积分
1.0000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
98 点
帖子
267
精华
0
在线时间
693 小时
注册时间
2009-7-17
最后登录
2016-5-31

楼主
taoflower 发表于 2010-9-1 14:27:43 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
% GMM_D  A Demo of the GMM program
%==========================================================================
%   WRITE A DESCRIPTION OF THE PROBLEM
%==========================================================================
disp('---------------------------------------------------------------------')
disp('GMM Demo:  Application is (nonlinear) Asset Pricing Test')
disp(' The economic structure is E[Rm] = 1')
disp('  R is a NxT matrix of returns, N assets, T dates')
disp('  m is the Intertemporal Marginal Rate of Substitution (IMRS)')
disp('  it is a discount rate that makes the price of the asset 1')
disp('  It is T-dimensional vector.')
disp(' ')
disp('The model for m is m = b(1)*cg^(-b(2))')
disp('  b(1) is an impatience parameter')
disp('  b(2) is the risk aversion parameter (>0)')
disp('  cg is the consumption growth rate c_t/c_(t-1)')
disp(' The returns are real value-weighted market return and T-bill')
disp(' For instruments we will use lagged values of R and cg and a constant')
disp('---------------------------------------------------------------------')
disp(' ')
disp('Hit a key to continue')
pause
%==========================================================================
%  READ IN DATA AND INITIALIZATIONS
%==========================================================================
gmmdata                             % Sample data from Ogaki
rawdata = rawdata(1:330,:);         % The last few obs are weird
nz = 1;                             % Number of lags used as instruments
T = rows(rawdata)-nz;
neq = cols(rawdata)-1;
cg = rawdata(1+nz:T+nz,1);
R = rawdata(1+nz:T+nz,2:3);
y = ones(T,neq);
X = [cg R];
Z = ones(T,1);
for i = 1:nz
  Z = [Z rawdata(1+nz-i:T+nz-i,1:3)];
end

% --- Set GMM options ----------------------------------------------------
disp('---------------------------------------------------------------------')
disp(' We give GMM instructions through the gmmopt and infoz structures:')
disp(' We refernce the moment conditions and derivatives')
disp(' and specify a Newey-West weighting matrix with 12 lags')
disp(' Starting values are b(1)=.98 and b(2) = 4')
infoz.momt='gmmexm';   % moment conditions
infoz.jake='gmmexj';   % Deriv of moment cond.
infoz.step='step2';   % Step length algorithm
infoz.hess='bfgs'   % Hessian (search direction)
gmmopt.infoz = infoz;
gmmopt.gmmit = 2;   % Number of GMM iterations
gmmopt.W0 = 'Z';   % Initial weighting matrix
gmmopt.W='S';    % Subsequent wtg matrix optimal
gmmopt.S='NW';    % Select subsequent wtg matrix
%gmmopt.wtvec=[0 0 1]';
gmmopt.lags=12;    % Lags in weighting matrix
gmmopt.prt=1    % Control printing
gmmopt.vname = strvcat('beta','gamma'); % variable names
b=[.98;5];    % Starting values
gmmopt.null = [1;0];   % Null hypothesis
disp('Hit a key to begin the estimation')
pause
% --- Estimate the model with gmm() -------------------------------------
gout=gmm(b,gmmopt,y,X,Z);
% --- Draws Objective Function ------------------------------------------
objplot(gmmopt.infoz,y,X,Z,gout.W,gout.b,[1 2],[.9 1.1],...
  [0 3],gmmopt.vname);
figure(1)
view(110,30)
二维码

扫码加我 拉你入群

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

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

关键词:MATLAB程序 MATLAB matla 大家一起来 CCAPM 研究 MATLAB 程序 CCAPM

沙发
taoflower 发表于 2010-9-1 14:28:05
遗憾的是, 我现在还没弄好,大家谁会帮帮小弟

藤椅
Laura_enen 发表于 2011-5-3 01:49:30
顶!!!!!!!!!同求
80 字节以内
不支持自定义 Discuz! 代码

板凳
不想告别夏天 发表于 2015-8-12 05:08:08
请问现在弄好了吗

报纸
magicsun 发表于 2015-8-13 08:49:28
回头看看

地板
shizelong 发表于 2016-10-31 10:47:25
haodongxi



您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-15 13:24