⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s_displaymlerecursionfort.m

📁 经济学专业代码
💻 M
字号:
% this script demonstrates the recursive ML estimation of the location and scatter
% parameters of a multivariate Student t distribution
% see Section 4.3.1 in "Risk and Asset Allocation" - Springer (2005), by A. Meucci


clear; clc; close all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% inputs
N=5;
T=1000;

nu=8;
Mu=rand(N,1);
A=rand(N,N)-.5;
Sigma=A*A';
    
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
s=sqrt(diag(Sigma));
C=diag(1./s)*Sigma*diag(1./s);
X=ones(T,1)*Mu'+ mvtrnd(C,nu,T)*diag(s);

Tolerance=10^(-10);
[Mu_hat,Sigma_hat] = MleRecursionForT(X,nu,Tolerance);

Mu
Mu_hat

Sigma
Sigma_hat

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -