找到了一个 CCAPM的matlab程序 大家一起来研究一下。
发布:taoflower | 分类:Matlab软件培训
关于本站
人大经济论坛-经管之家:分享大学、考研、论文、会计、留学、数据、经济学、金融学、管理学、统计学、博弈论、统计年鉴、行业分析包括等相关资源。
经管之家是国内活跃的在线教育咨询平台!
获取电子版《CDA一级教材》
完整电子版已上线CDA网校,累计已有10万+在读~ 教材严格按考试大纲编写,适合CDA考生备考,也适合业务及数据分析岗位的从业者提升自我。
TOP热门关键词
%GMM_DADemooftheGMMprogram%==========================================================================%WRITEADESCRIPTIONOFTHEPROBLEM%==================================================================== ...
免费学术公开课,扫码加入![]() |
%==========================================================================
% 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)
「经管之家」APP:经管人学习、答疑、交友,就上经管之家!
免流量费下载资料----在经管之家app可以下载论坛上的所有资源,并且不额外收取下载高峰期的论坛币。
涵盖所有经管领域的优秀内容----覆盖经济、管理、金融投资、计量统计、数据分析、国贸、财会等专业的学习宝库,各类资料应有尽有。
来自五湖四海的经管达人----已经有上千万的经管人来到这里,你可以找到任何学科方向、有共同话题的朋友。
经管之家(原人大经济论坛),跨越高校的围墙,带你走进经管知识的新世界。
扫描下方二维码下载并注册APP
免流量费下载资料----在经管之家app可以下载论坛上的所有资源,并且不额外收取下载高峰期的论坛币。
涵盖所有经管领域的优秀内容----覆盖经济、管理、金融投资、计量统计、数据分析、国贸、财会等专业的学习宝库,各类资料应有尽有。
来自五湖四海的经管达人----已经有上千万的经管人来到这里,你可以找到任何学科方向、有共同话题的朋友。
经管之家(原人大经济论坛),跨越高校的围墙,带你走进经管知识的新世界。
扫描下方二维码下载并注册APP
您可能感兴趣的文章
- Matlab软件 ... | 求教高手:怎样用Matlab神经网络 ...
- Matlab软件 ... | matlab传递参数类型的一个问题
- Matlab软件 ... | 利用nvidia CUDA加速MATLAB运算
- Matlab软件 ... | Numerical Analysis using Matla ...
- Matlab软件 ... | [下载]Essential MATLAB for Eng ...
- Matlab软件 ... | 求助高手帮忙改一下matlab程序
- Matlab软件 ... | [分享]matlab画图moive函数 做动 ...
- Matlab软件 ... | [下载]A Guide to Matlab - For ...
人气文章
本文标题:找到了一个 CCAPM的matlab程序 大家一起来研究一下。
本文链接网址:https://bbs.pinggu.org/jg/ruanjianpeixun_matlabruanjianpeixun_899505_1.html
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。



