Finding AIC for an exponential model
显示 更早的评论
Is there any way to find the AIC for an exponential model? I know fitlm gives me the AIC for a linear regression, but I can't seem to calculate the AIC for an exponential fit as described by the code at the bottom. I have tried expfit, which returned a single parameter, and the aic() function, but I can't figure out how to turn this into a state-space model that would work with the aic function.
exp_fit = fittype(@(a,b,c,d,x) a+b*exp(c*x+d));
exp_fit_options = fitoptions(exp_fit);
exp_fit_options.Upper = [Inf, Inf, Inf];
exp_fit_options.Lower = [-Inf, 0, 0];
linear_model = fitlm(x,y)
exp_model = fit(x, y, exp_fit)
回答(1 个)
Phil Steindel
2021-7-30
0 个投票
Hi Alice,
Assuming you have access to Machine Learning Toolbox (as you've used fitlm and expfit), you can try fitnlm. As with fitlm, the AIC is in the ModelCriterion property of the output. Note that you will also have to specify an initial guess for the parameters, and you won't be able to specify upper and lower bounds for them as you have done here.
类别
在 帮助中心 和 File Exchange 中查找有关 Fit Postprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!