obtain AIC value for each copula

4 Ansichten (letzte 30 Tage)
Silvia Velocci
Silvia Velocci am 28 Okt. 2022
Bearbeitet: Yuki Ueyama am 3 Jun. 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);

Antworten (1)

Moksh
Moksh am 11 Sep. 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 Kommentar
Yuki Ueyama
Yuki Ueyama am 3 Jun. 2024
Bearbeitet: Yuki Ueyama am 3 Jun. 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

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by