【发布时间】:2018-02-18 07:31:27
【问题描述】:
我正在尝试将 MatLab 中的 t copula 拟合到我的数据中,我的函数是:
u = ksdensity(range_1, range_1,'function','cdf');
v = ksdensity(range_2, range_2,'function','cdf');
%fit a t-copula to returns
rng default ; % For reproducibility
[Rho,nu] = copulafit('t',[u v],'Method','ApproximateML');
我收到一条错误消息:
使用 chol 时出错
矩阵必须是正定的。
copulafit/approxProfileNLL_t 中的错误(第 314 行)
nll = negloglike_t(nu,chol(Rho),t_);
copulafit>bracket1D 中的错误(第 494 行)
oldnll = nllFun(绑定);
copulafit 中的错误(第 126 行)
[lowerBnd,upperBnd] = 括号1D(profileFun,lowerBnd,5); % 'upper',从5升序搜索
我知道这是由于chol() 分解而发生的,但我不知道应该更改哪些参数来克服这个问题。任何帮助将不胜感激。
我使用的数据如下:
range_1 range_2
-0.639388612 -0.639388612
1.029603565 1.029603565
1.273883288 1.273883288
0.754717135 0.754717135
1.747817835 1.747817835
1.717787291 1.717787291
-0.120625114 -0.120625114
2.173913469 2.173913469
2.836879977 2.836879977
-0.804601995 -0.804601995
0 0
【问题讨论】:
标签: matlab matrix-inverse decomposition