obtain AIC value for each copula

8 ビュー (過去 30 日間)
Silvia Velocci
Silvia Velocci 2022 年 10 月 28 日
編集済み: Yuki Ueyama 2024 年 6 月 3 日
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);

回答 (1 件)

Moksh
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:
  • Log-likelihood values derived from fitting the model on data.
  • Corresponding number of estimated model parameters.
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
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 ExchangeProbability Distributions についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by