Can I find likelihood function of an objective function?
1 view (last 30 days)
Show older comments
Sorry this is not a question 100% related to MATLAB.
I have some data. I used
nlinfit
and got the parameters for these three functions (model), as well as MSE
$f_1=b1*x1+b2*x2+b3$
$f_2=b1*x1^b2+b3*x2+b4$
$f_3=b1*x1^b2+b3*x2^b4+b5$
Besides comparing their MSE, I read some model selection method, but they need maximized value of the likelihood function for the model. What I know about liklihood is for some data with dirstributions
So is there a way or is that ok to find likelihood function for f1, f2, and f3?
0 Comments
Answers (2)
Star Strider
on 28 Nov 2022
If you have the Statistics and Machine Learning Toolbox, see if the mle function (and associated functions) will do what you want. It estimated the parameters of a probability distribution. There are several to choose from, dependong on how your data are distributed.
Search the documentation for ‘likelihood’ for all the functions that mention it.
0 Comments
Jeff Miller
on 29 Nov 2022
A lot depends on the details of these models, but one way to proceed would be in terms of the error scores. Consider the full model to be
$f_1=b1*x1+b2*x2+b3 + e_{1i}$
where
is the residual for case i according to model 1 (and similarly for models 2 & 3). If you assume that the e values are normally distributed with mean 0 and some unknown variance
(as I believe would be appropriate for some models), then you can use the computed e values for each model to get the maximum likelihood estimate of
for that model, compute the likelihood of each e value within the model's estimated normal(0,
) distribution, and finally compute the likelihood of the whole dataset under the model as the product of the likelihood values of the individual e's.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1211733/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1211738/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1211743/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1211748/image.png)
Looking at the models this way, the only random values are the e's, so they are the only quantities relevant to the computation of likelihood.
HTH,
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!