How to calculate AIC from an fmincon optimization
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have some independent and dependent data measurements in two variables (vectors), called X and Y, respectively. I am using fmincon to minimize the following cost function
function SSerr = ObjFun(C, X, Y)
Yhat = Model(C, X);
T = ( Yhat - Y ).^2;
SSerr = sum(T(:));
end
the function "Model" above just calculates the predicted values (Yhat) based on the measured independent variable data (X) and some fit-parameters (C).
I assume that the errors (deviations between predicted Yhat and measured Y) come from a normal (Gaussian) distribution with mean=0 and variance sigma, G(0, sigma2)
I want to calculate the Akaikes Information Criterion (AIC).
AIC = 2k - 2ln(L)
where k is the number of parameters used for the fit (in my case the length of C) and L is the maximum value of the likelihood function.
So my question is: how do I calculate the maximum value of the likelihood function ?
I have seen here that minimising the sum of the squares of the residuals (RSS), as I do above, is equivalent to maximising the likelihood function if the residuals are normally distributed.
But this does not mean that the RSS is equal to the likelihood function - or does it ?
Thanks in advance
0 commentaires
Réponses (1)
Vaibhav Awale
le 3 Mai 2016
Hi Rozh,
From the link that you have provided, it seems that maximum value of likelihood function will occur at minimum value of RSS. However, for calculating maximum value of likelihood from RSS, you will need to know the variance of the model as well.
Please refer to following documentation link which has MATLAB function 'aic', which is used to find Akaike's Information Criterion for estimated model.
I hope this helps.
Regards,
Vaibhav
0 commentaires
Voir également
Catégories
En savoir plus sur Portfolio Optimization and Asset Allocation dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!