Path: news.mathworks.com!not-for-mail
From: Peter Perkins <Peter.PerkinsRemoveThis@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: AIC for CDF fit
Date: Wed, 25 Feb 2009 14:57:59 -0500
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <go47s7$s23$1@fred.mathworks.com>
References: <go0dfd$h9$1@fred.mathworks.com>
NNTP-Posting-Host: perkinsp.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1235591879 28739 172.31.57.88 (25 Feb 2009 19:57:59 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 25 Feb 2009 19:57:59 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
In-Reply-To: <go0dfd$h9$1@fred.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:520817


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.