Error using copula fit: Rho has become rank-deficient
3 ビュー (過去 30 日間)
Hi, I wanted to estimate kernel densities for 20 variables, correlated by t copulas. Had this formula: [Rho,nu] = copulafit('t',[... my 20 kernel cdf],'Method','ApproximateML');
Got this error:
Error using copulafit/approxProfileNLL_t (line 290) The estimate of Rho has become rank-deficient. You may have too few data, or strong dependencies among variables.
Error in copulafit>bracket1D (line 489) oldnll = nllFun(bound);
Error in copulafit (line 125) [lowerBnd,upperBnd] = bracket1D(profileFun,lowerBnd,5); % 'upper', search ascending from 5
Error in MODELX (line 48) [Rho,nu] = copulafit('t',[... my 20 kernel cdf],'Method','ApproximateML');
Can't really understand why, the database seams fine.
Thanks a lot,
回答 (1 件)
Matt Cohen 2015 年 8 月 18 日
編集済み: Matt Cohen 2015 年 8 月 18 日
I understand that you are trying to use the function "copulafit" to estimate kernel densities for some variables correlated by t copulas, and that you are receiving an error when calling this function.
Based on the error you are receiving from "copulafit", it seems that the likely source of the error is the kernel CDF data which you are inputting into the function. The main error message, which states that Rho has become rank-deficient because there may be too few data or strong dependencies among variables, indicates that the input data should be inspected further to determine what is leading to this error. This error should mean that the data is not linearly independent, so there is some dependency or redundancy across the variables.
Try analyzing the input data some to see what the issue could be. Check to see if the input matrix has more columns than rows; if it does, then this is likely the issue that is causing the rank-deficiency here, so you will need to modify the input data to use column vectors instead of row vectors. Check the rank of the data using the function "rank". If the input matrix has m rows and n columns, the matrix is full rank if the rank value equals either m or n, depending on which value is smaller. If the data is not full rank, then you should expect errors in this process. It might also be the case that you just need to supply it more data.
Additionally, look into the documentation linked to "copulafit". This provides more information about proper ways of using the function and some examples. Included below is an example of using the function with some kernel densities created from stock return data.
x = stocks(:,1);
y = stocks(:,2);
u = ksdensity(x,x,'function','cdf');
v = ksdensity(y,y,'function','cdf');
[Rho,nu] = copulafit('t',[u v],'Method','ApproximateML')
I hope this helps!