Finding AIC for an exponential model

조회 수: 13 (최근 30일)
Alice Lam
Alice Lam 2021년 7월 30일
답변: Phil Steindel 2021년 7월 30일
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
Phil Steindel 2021년 7월 30일
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.

카테고리

Help CenterFile Exchange에서 Fit Postprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by