|
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.
|