logtcopulapdf.m
来自「经济学专业代码」· M 代码 · 共 23 行
M
23 行
function F_U = LogTCopulaPDF(u,nu,Mu,Sigma)
% this function computes the pdf of the copula of the log-t distribution
% at the generic point u in the unit hypercube
% see "Risk and Asset Allocation"-Springer (2005), by A. Meucci
N=length(u);
s=sqrt(diag(Sigma));
x=exp(Mu+s.*tinv(u,nu));
z2=(log(x)-Mu)'*inv(Sigma)*(log(x)-Mu);
K=(nu*pi)^(-N/2) * gamma((nu+N)/2)/gamma(nu/2) * ( (det(Sigma))^(-.5) );
Numerator = K*(1+z2/nu)^(-(nu+N)/2)/prod(x);
fs=(1./(x.*s)).*tpdf((log(x)-Mu)./s,nu);
Denominator = prod(fs);
F_U = Numerator/Denominator;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?