📄 s_displaymlerecursionfort.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 + -