obtain AIC value for each copula

4 visualizzazioni (ultimi 30 giorni)
Silvia Velocci
Silvia Velocci il 28 Ott 2022
Modificato: Yuki Ueyama il 3 Giu 2024
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);

Risposte (1)

Moksh
Moksh il 11 Set 2023
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 Commento
Yuki Ueyama
Yuki Ueyama il 3 Giu 2024
Modificato: Yuki Ueyama il 3 Giu 2024
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

Accedi per commentare.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by