How to calculate LogLikelihood between real data and predicted data?
12 次查看(过去 30 天)
显示 更早的评论
Hey everyone!
I have used an AR-model to predict a time series and now I would like to calculate the LogLikelihood between my predicted datapoints and real datapoints to determine what set-up of my AR is the best by using the Akaika and Bayesian Information Criteria. On the internet I found the following idea:
LogL=sum(log(pdf(pd,x)))
I cannot use this command though because matlab tells me it needs to know what kind of probability density function the pdf command should use. How can I solve this problem?
I tried this:
LogL=sum(log(pdf('norm',pd,x,0,1)))
to try out what happens if I use a normal density function but my result is simply NaN...
0 个评论
采纳的回答
Roger Wohlwend
2014-10-15
When you estimate the model (using Matlab's arima class), you get the log-likelihood as the third output variable of the function estimate. I guess, that is the kind of log-likehood you want, because there is no such thing as a log-likelihood between real and predicted data. For the Akaika and BAyesian Information Criterion use the function aicbic (if you possess the Econometrics toolbox).
1 个评论
JING QIAO
2022-6-23
May I ask how can I use aicbic in matlab for user defined functions? I tried to fit a set of data using different combinations of functions (sine, polynomial), I wanted to use aic/bic to test which one is a better function to model the data. From https://jp.mathworks.com/help/econ/aicbic.html, I need to provide the log-likelihood of the models. How can we calculate the log-likelihood?
Refer to https://jp.mathworks.com/help/ident/ref/idgrey.aic.html#buy65_c-model, it seems that the models are the ones defined by the matlab, such as
Is there a way to use aic/bic for the models defined by the user (e.g,, y1= ax+bx^2+c, y2=ax+dx^3+sin(x))? Many thanks in advance!
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Hypothesis Tests 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!