How to calculate LogLikelihood between real data and predicted data?

조회 수: 12 (최근 30일)
MC3105
MC3105 2014년 10월 15일
댓글: JING QIAO 2022년 6월 23일
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...

채택된 답변

Roger Wohlwend
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
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 CenterFile Exchange에서 Hypothesis Tests에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by