Thread Subject: AIC for CDF fit

Subject: AIC for CDF fit

From: Xiaoxiao Mao

Date: 24 Feb, 2009 09:09:01

Message: 1 of 5

Dear all,

I am trying to use AIC to choose a best fit CDF.
from matlab help, the syntex is aic(model), i am not sure what to put as the model. maybe i put my codes as following, can anyone try to help me by telling me what to put in the place of 'model'.

% if weibull fitting is used
data = random(1:100);
weibfit = cdf('Weibull',data,parm_weib(1),parm_weib(2));
m = aic(model);

Subject: AIC for CDF fit

From: Peter Perkins

Date: 25 Feb, 2009 19:57:59

Message: 2 of 5

Xiaoxiao Mao wrote:
> Dear all,
>
> I am trying to use AIC to choose a best fit CDF.
> from matlab help, the syntex is aic(model), i am not sure what to put as the model. maybe i put my codes as following, can anyone try to help me by telling me what to put in the place of 'model'.
>
> % if weibull fitting is used
> data = random(1:100);
> weibfit = cdf('Weibull',data,parm_weib(1),parm_weib(2));
> m = aic(model);

You're generating random data, and then evaluating the CDF of a distribution, perhaps a distribution that has been estimated from (other?) data. Perhaps you are using WBLFIT from the Statistics Toolbox to estimate the distribution? (If you're using WEIBFIT as your var name indicates, you either have a very old version, or you should use WBLFIT.) If that's the case, you would compute the AIC using WBLLIKE and the number of parameters:

   aic = 2*(wbllike(params,data) + 2) % 2 * (negative log-likelihood + #params)

The AIC function you're trying to use is, I believe, a function from the System Identification Toolbox, and a function that requires you to pass in a model estimated using the functions in that toolbox.

Subject: AIC for CDF fit

From: Xiaoxiao Mao

Date: 26 Feb, 2009 02:34:01

Message: 3 of 5

Thanks a lot, Peter
yes, the wbllike can give me the likelihood for the weibull fit, so as the lognlike. i am also considering the rician, rayleigh and nakagami, but matlab did not provide such funciton for likelihood estimation except i copy from dfittool.
So i am wondering is there method i can get the likelihood by not accessing dfittool, or can i know how matlab calculate the loglikelihood for funciton lognlike and wbllike? is it simplely
log(sum(error^2)/N) % take log of MSE

Peter Perkins <Peter.PerkinsRemoveThis@mathworks.com> wrote in message <go47s7$s23$1@fred.mathworks.com>...

> You're generating random data, and then evaluating the CDF of a distribution, perhaps a distribution that has been estimated from (other?) data. Perhaps you are using WBLFIT from the Statistics Toolbox to estimate the distribution? (If you're using WEIBFIT as your var name indicates, you either have a very old version, or you should use WBLFIT.) If that's the case, you would compute the AIC using WBLLIKE and the number of parameters:
>
> aic = 2*(wbllike(params,data) + 2) % 2 * (negative log-likelihood + #params)
>
> The AIC function you're trying to use is, I believe, a function from the System Identification Toolbox, and a function that requires you to pass in a model estimated using the functions in that toolbox.

Subject: AIC for CDF fit

From: Peter Perkins

Date: 26 Feb, 2009 14:45:09

Message: 4 of 5

Xiaoxiao Mao wrote:
> Thanks a lot, Peter
> yes, the wbllike can give me the likelihood for the weibull fit, so as the lognlike. i am also considering the rician, rayleigh and nakagami, but matlab did not provide such funciton for likelihood estimation except i copy from dfittool.
> So i am wondering is there method i can get the likelihood by not accessing dfittool, or can i know how matlab calculate the loglikelihood for funciton lognlike and wbllike? is it simplely
> log(sum(error^2)/N) % take log of MSE

"edit lognlike wbllike"

Subject: AIC for CDF fit

From: Xiaoxiao Mao

Date: 27 Feb, 2009 03:39:02

Message: 5 of 5

Peter Perkins <Peter.PerkinsRemoveThis@mathworks.com> wrote in message <go69tl$eg1$1@fred.mathworks.com>...

> "edit lognlike wbllike"

Thanks so much, it works

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
weibull Dawood 11 May, 2009 09:18:44
aic Xiaoxiao Mao 24 Feb, 2009 04:10:05
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com