studentmle.m
来自「经济学专业代码」· M 代码 · 共 24 行
M
24 行
function [Nu,Mu,Sigma]=StudentMLE(x)
% This function computes the maximum-likelihood estimate of the
% degrees of freedom Nu, the location vector Mu and the scatter matrix
% Sigma of T i.i.d. observations from the N-variate t
% distribution, organized in the TxN panel x.
% see Section 4.3.1 in "Risk and Asset Allocation" - Springer (2005), by A. Meucci
Tolerance=.01*mean(prctile(x,75)-prctile(x,25)); % robust scale factor
Nus=[1 2 4 7 12 20]; % significant grid of potential degrees of freedom
LL=[]; % log-likelihood
for s=1:length(Nus)
Nu=Nus(s);
[Mu,Sigma] = MleRecursionForT(x,Nu,Tolerance);
LL=[LL LogLik(x,Nu,Mu,Sigma)];
end
%h=plot(Nus,LL);
[a,Index]=max(LL);
Nu=Nus(Index);
[Mu,Sigma] = MleRecursionForT(x,Nu,Tolerance);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?