How to calculate LogLikelihood between real data and predicted data?
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MC3105
el 15 de Oct. de 2014
Comentada: JING QIAO
el 23 de Jun. de 2022
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 comentarios
Respuesta aceptada
Roger Wohlwend
el 15 de Oct. de 2014
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 comentario
JING QIAO
el 23 de Jun. de 2022
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!
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with Econometrics Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!