- Log-likelihood values derived from fitting the model on data.
- Corresponding number of estimated model parameters.
obtain AIC value for each copula
8 ビュー (過去 30 日間)
古いコメントを表示
hi, good morning. I need to compare the different copulas to figure out which one fits the data best. To do this I have to calculate the IAC for each copula. Can anyone tell me how I can implement this calculation? A thousand thanks
%copula Gaussiana
[grho]=copulafit('Gaussian',[vu2 vu4])
rho = grho(1,2)
cm = 10 % number of evaluation
d = linspace(0,1,cm);
[u2,u4] = meshgrid(d,d);
u = copularnd('Gaussian',rho,n);
0 件のコメント
回答 (1 件)
Moksh
2023 年 9 月 11 日
Hi Silvia,
I understand that you are trying to get the best fitting copula which can be determined using the aic scores for each.
For this you can use the “aicbic” function in MATLAB, which allows any model as input, if you have the following data:
Here is an example code which uses “Rayleigh” distribution and calculates the aic score:
% Generating radnom data through Rayleigh distribution
x = raylrnd(2, 20, 1);
% Fitting the data on Rayleigh distribution and getting the log-likelihood
pd = fitdist(x, "Rayleigh");
logL = pd.NLogL;
% Compuring aic score from the log-likelihood value and number of estimated parameters
% (Assuming 39 model parameters)
aic_score = aicbic(logL, 39);
You can refer to the below documentations to know more about the functionality of “aicbic”, “fitdist” and “rayrnd” functions, respectively.
Hope this helps!
Best Regards,
Moksh Aggarwal
1 件のコメント
Yuki Ueyama
2024 年 6 月 3 日
編集済み: Yuki Ueyama
2024 年 6 月 3 日
Hi Moksh,
I am also interested in computing AIC using MATLAB.
I suspect that pd.NLogL in your code returns the negative log-likelihood.
So the AIC score should be calculated as follows:
aic_score = aicbic(-logL, 39);
Best Regards,
Yuki Ueyama
参考
カテゴリ
Help Center および File Exchange で Probability Distributions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!