How to do an exponential fit for this data?Finding exponential model from dataFit a custom process to a data: inhomogeneous 2-state Markov chainFitting experimental data to ODEs by using NonlinearModelFitProblem with fitting NonlinearModelFit::nrlnum:Discover type of model for a set of dataTrouble fitting exponential with NonLinearModelFitNon linear fit/Find distribution parameters for large gradient data;Exponential fit for time seriesSelecting method and using Abs[] for FindFitNon Linear Model Fit - Fitting ODE to Data
How to melt snow without fire or body heat?
Why did the person in charge of a principality not just declare themself king?
Dad jokes are fun
SFDX: where can set Field-level security and accessibility?
Is my plasma cannon concept viable?
How to cut a climbing rope?
Parallel fifths in the orchestra
Why did Jon Snow do this immoral act if he is so honorable?
If a (distance) metric on a connected Riemannian manifold locally agrees with the Riemannian metric, is it equal to the induced metric?
Why does Bran want to find Drogon?
Why did Theresa May offer a vote on a second Brexit referendum?
Public transport tickets in UK for two weeks
Find this cartoon
How do I superimpose two math symbols?
Why was this character made Grand Maester?
Are black holes spherical during merger?
What did the 'turbo' button actually do?
Why does the hash of infinity have the digits of π?
Mysterious procedure calls without parameters - but no exceptions generated
What are Antecedent & Consequent Phrases in Music?
How was Daenerys able to legitimise this character?
Where is Jon going?
What does kpsewhich stand for?
Why isn't Tyrion mentioned in the in-universe book "A Song of Ice and Fire"?
How to do an exponential fit for this data?
Finding exponential model from dataFit a custom process to a data: inhomogeneous 2-state Markov chainFitting experimental data to ODEs by using NonlinearModelFitProblem with fitting NonlinearModelFit::nrlnum:Discover type of model for a set of dataTrouble fitting exponential with NonLinearModelFitNon linear fit/Find distribution parameters for large gradient data;Exponential fit for time seriesSelecting method and using Abs[] for FindFitNon Linear Model Fit - Fitting ODE to Data
$begingroup$
Whenever I try to use FindFit
or NonlinearModelFit
for the data (shown below), I keep getting the following error thrown at me:
RecursionLimit::reclim: Recursion depth of 1024 exceeded.
I am using an exponential model to try and fit it.
data = 0.19676778483499557`, 0.20885602228466532`, 0.22210833221738427`,
0.23668665287868895`, 0.252783561788831`, 0.2706298263857738`,
0.2905043053747535`, 0.3127471056565888`, 0.3377773233068993`,
0.3661173611964135`, 0.39842687921844677`, 0.43555118981628316`,
0.4785919073537348`, 0.5290129571413393`, 0.5888048389535786`,
0.6607490640587161`;
The particular model that I'm using is FindFit[data, Exp[a*x] + b, a, b, x]
How can I stop getting this error thrown at me/get the model I'm trying to use to work?
fitting
$endgroup$
add a comment |
$begingroup$
Whenever I try to use FindFit
or NonlinearModelFit
for the data (shown below), I keep getting the following error thrown at me:
RecursionLimit::reclim: Recursion depth of 1024 exceeded.
I am using an exponential model to try and fit it.
data = 0.19676778483499557`, 0.20885602228466532`, 0.22210833221738427`,
0.23668665287868895`, 0.252783561788831`, 0.2706298263857738`,
0.2905043053747535`, 0.3127471056565888`, 0.3377773233068993`,
0.3661173611964135`, 0.39842687921844677`, 0.43555118981628316`,
0.4785919073537348`, 0.5290129571413393`, 0.5888048389535786`,
0.6607490640587161`;
The particular model that I'm using is FindFit[data, Exp[a*x] + b, a, b, x]
How can I stop getting this error thrown at me/get the model I'm trying to use to work?
fitting
$endgroup$
$begingroup$
Can you give the exact command you used to fit please? Otherwise it's difficult to tell what's going on. But as a first guess I'd suggest you try again with a fresh kernel.
$endgroup$
– Roman
May 17 at 12:51
$begingroup$
@Roman Updated the question.
$endgroup$
– Spencer Keller
May 17 at 12:55
2
$begingroup$
Runs fine on my computer. Please try your own code with a fresh kernel. Check?a
and?b
to see if there are any lingering definitions.
$endgroup$
– Roman
May 17 at 13:01
$begingroup$
@Roman I took your advice and used a new kernel. Worked just fine. Would you happen to know why using a new kernel worked?
$endgroup$
– Spencer Keller
May 17 at 13:21
$begingroup$
Lingering definitions ofa
andb
. Check them with?a
and?b
.
$endgroup$
– Roman
May 17 at 13:30
add a comment |
$begingroup$
Whenever I try to use FindFit
or NonlinearModelFit
for the data (shown below), I keep getting the following error thrown at me:
RecursionLimit::reclim: Recursion depth of 1024 exceeded.
I am using an exponential model to try and fit it.
data = 0.19676778483499557`, 0.20885602228466532`, 0.22210833221738427`,
0.23668665287868895`, 0.252783561788831`, 0.2706298263857738`,
0.2905043053747535`, 0.3127471056565888`, 0.3377773233068993`,
0.3661173611964135`, 0.39842687921844677`, 0.43555118981628316`,
0.4785919073537348`, 0.5290129571413393`, 0.5888048389535786`,
0.6607490640587161`;
The particular model that I'm using is FindFit[data, Exp[a*x] + b, a, b, x]
How can I stop getting this error thrown at me/get the model I'm trying to use to work?
fitting
$endgroup$
Whenever I try to use FindFit
or NonlinearModelFit
for the data (shown below), I keep getting the following error thrown at me:
RecursionLimit::reclim: Recursion depth of 1024 exceeded.
I am using an exponential model to try and fit it.
data = 0.19676778483499557`, 0.20885602228466532`, 0.22210833221738427`,
0.23668665287868895`, 0.252783561788831`, 0.2706298263857738`,
0.2905043053747535`, 0.3127471056565888`, 0.3377773233068993`,
0.3661173611964135`, 0.39842687921844677`, 0.43555118981628316`,
0.4785919073537348`, 0.5290129571413393`, 0.5888048389535786`,
0.6607490640587161`;
The particular model that I'm using is FindFit[data, Exp[a*x] + b, a, b, x]
How can I stop getting this error thrown at me/get the model I'm trying to use to work?
fitting
fitting
edited May 17 at 12:54
Spencer Keller
asked May 17 at 12:47
Spencer KellerSpencer Keller
265
265
$begingroup$
Can you give the exact command you used to fit please? Otherwise it's difficult to tell what's going on. But as a first guess I'd suggest you try again with a fresh kernel.
$endgroup$
– Roman
May 17 at 12:51
$begingroup$
@Roman Updated the question.
$endgroup$
– Spencer Keller
May 17 at 12:55
2
$begingroup$
Runs fine on my computer. Please try your own code with a fresh kernel. Check?a
and?b
to see if there are any lingering definitions.
$endgroup$
– Roman
May 17 at 13:01
$begingroup$
@Roman I took your advice and used a new kernel. Worked just fine. Would you happen to know why using a new kernel worked?
$endgroup$
– Spencer Keller
May 17 at 13:21
$begingroup$
Lingering definitions ofa
andb
. Check them with?a
and?b
.
$endgroup$
– Roman
May 17 at 13:30
add a comment |
$begingroup$
Can you give the exact command you used to fit please? Otherwise it's difficult to tell what's going on. But as a first guess I'd suggest you try again with a fresh kernel.
$endgroup$
– Roman
May 17 at 12:51
$begingroup$
@Roman Updated the question.
$endgroup$
– Spencer Keller
May 17 at 12:55
2
$begingroup$
Runs fine on my computer. Please try your own code with a fresh kernel. Check?a
and?b
to see if there are any lingering definitions.
$endgroup$
– Roman
May 17 at 13:01
$begingroup$
@Roman I took your advice and used a new kernel. Worked just fine. Would you happen to know why using a new kernel worked?
$endgroup$
– Spencer Keller
May 17 at 13:21
$begingroup$
Lingering definitions ofa
andb
. Check them with?a
and?b
.
$endgroup$
– Roman
May 17 at 13:30
$begingroup$
Can you give the exact command you used to fit please? Otherwise it's difficult to tell what's going on. But as a first guess I'd suggest you try again with a fresh kernel.
$endgroup$
– Roman
May 17 at 12:51
$begingroup$
Can you give the exact command you used to fit please? Otherwise it's difficult to tell what's going on. But as a first guess I'd suggest you try again with a fresh kernel.
$endgroup$
– Roman
May 17 at 12:51
$begingroup$
@Roman Updated the question.
$endgroup$
– Spencer Keller
May 17 at 12:55
$begingroup$
@Roman Updated the question.
$endgroup$
– Spencer Keller
May 17 at 12:55
2
2
$begingroup$
Runs fine on my computer. Please try your own code with a fresh kernel. Check
?a
and ?b
to see if there are any lingering definitions.$endgroup$
– Roman
May 17 at 13:01
$begingroup$
Runs fine on my computer. Please try your own code with a fresh kernel. Check
?a
and ?b
to see if there are any lingering definitions.$endgroup$
– Roman
May 17 at 13:01
$begingroup$
@Roman I took your advice and used a new kernel. Worked just fine. Would you happen to know why using a new kernel worked?
$endgroup$
– Spencer Keller
May 17 at 13:21
$begingroup$
@Roman I took your advice and used a new kernel. Worked just fine. Would you happen to know why using a new kernel worked?
$endgroup$
– Spencer Keller
May 17 at 13:21
$begingroup$
Lingering definitions of
a
and b
. Check them with ?a
and ?b
.$endgroup$
– Roman
May 17 at 13:30
$begingroup$
Lingering definitions of
a
and b
. Check them with ?a
and ?b
.$endgroup$
– Roman
May 17 at 13:30
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Try
fit = FindFit[data, a + b Exp[c x], a, b, c, x]
Show[ListPlot[data],Plot[a + b Exp[c x] /. fit, x, 1, Length[data]]]
$endgroup$
$begingroup$
Thank you. That worked beautifully!
$endgroup$
– Spencer Keller
May 17 at 13:01
$begingroup$
You're welcome.
$endgroup$
– Ulrich Neumann
May 17 at 13:02
$begingroup$
Or, equivalently, useExp[a*x + c] + b
for the model.
$endgroup$
– Bob Hanlon
May 17 at 13:20
add a comment |
$begingroup$
This is just an extended comment. While the fit might "look" good, an examination of the residuals vs the fit shows that there is still a lot more structure that maybe needs explaining:
ListPlot[Transpose[fit["PredictedResponse"], fit["FitResiduals"]],
Frame -> True, FrameLabel -> "Predicted response", "Fit residual"]
Three (of many) possibilities: (1) underlying curve is more complicated than first thought and (2) the measurement system has a floating bias, (3) the observations are correlated across the predictor variable (maybe that's "time"?).
The point is that to make inferences from regressions certain assumptions need to hold at least approximately. Such residual plots are just one kind of check on those assumptions to see if there are any gross deviations from those assumptions. A residual plot should be mandatory.
$endgroup$
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f198565%2fhow-to-do-an-exponential-fit-for-this-data%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Try
fit = FindFit[data, a + b Exp[c x], a, b, c, x]
Show[ListPlot[data],Plot[a + b Exp[c x] /. fit, x, 1, Length[data]]]
$endgroup$
$begingroup$
Thank you. That worked beautifully!
$endgroup$
– Spencer Keller
May 17 at 13:01
$begingroup$
You're welcome.
$endgroup$
– Ulrich Neumann
May 17 at 13:02
$begingroup$
Or, equivalently, useExp[a*x + c] + b
for the model.
$endgroup$
– Bob Hanlon
May 17 at 13:20
add a comment |
$begingroup$
Try
fit = FindFit[data, a + b Exp[c x], a, b, c, x]
Show[ListPlot[data],Plot[a + b Exp[c x] /. fit, x, 1, Length[data]]]
$endgroup$
$begingroup$
Thank you. That worked beautifully!
$endgroup$
– Spencer Keller
May 17 at 13:01
$begingroup$
You're welcome.
$endgroup$
– Ulrich Neumann
May 17 at 13:02
$begingroup$
Or, equivalently, useExp[a*x + c] + b
for the model.
$endgroup$
– Bob Hanlon
May 17 at 13:20
add a comment |
$begingroup$
Try
fit = FindFit[data, a + b Exp[c x], a, b, c, x]
Show[ListPlot[data],Plot[a + b Exp[c x] /. fit, x, 1, Length[data]]]
$endgroup$
Try
fit = FindFit[data, a + b Exp[c x], a, b, c, x]
Show[ListPlot[data],Plot[a + b Exp[c x] /. fit, x, 1, Length[data]]]
answered May 17 at 12:56
Ulrich NeumannUlrich Neumann
10.1k617
10.1k617
$begingroup$
Thank you. That worked beautifully!
$endgroup$
– Spencer Keller
May 17 at 13:01
$begingroup$
You're welcome.
$endgroup$
– Ulrich Neumann
May 17 at 13:02
$begingroup$
Or, equivalently, useExp[a*x + c] + b
for the model.
$endgroup$
– Bob Hanlon
May 17 at 13:20
add a comment |
$begingroup$
Thank you. That worked beautifully!
$endgroup$
– Spencer Keller
May 17 at 13:01
$begingroup$
You're welcome.
$endgroup$
– Ulrich Neumann
May 17 at 13:02
$begingroup$
Or, equivalently, useExp[a*x + c] + b
for the model.
$endgroup$
– Bob Hanlon
May 17 at 13:20
$begingroup$
Thank you. That worked beautifully!
$endgroup$
– Spencer Keller
May 17 at 13:01
$begingroup$
Thank you. That worked beautifully!
$endgroup$
– Spencer Keller
May 17 at 13:01
$begingroup$
You're welcome.
$endgroup$
– Ulrich Neumann
May 17 at 13:02
$begingroup$
You're welcome.
$endgroup$
– Ulrich Neumann
May 17 at 13:02
$begingroup$
Or, equivalently, use
Exp[a*x + c] + b
for the model.$endgroup$
– Bob Hanlon
May 17 at 13:20
$begingroup$
Or, equivalently, use
Exp[a*x + c] + b
for the model.$endgroup$
– Bob Hanlon
May 17 at 13:20
add a comment |
$begingroup$
This is just an extended comment. While the fit might "look" good, an examination of the residuals vs the fit shows that there is still a lot more structure that maybe needs explaining:
ListPlot[Transpose[fit["PredictedResponse"], fit["FitResiduals"]],
Frame -> True, FrameLabel -> "Predicted response", "Fit residual"]
Three (of many) possibilities: (1) underlying curve is more complicated than first thought and (2) the measurement system has a floating bias, (3) the observations are correlated across the predictor variable (maybe that's "time"?).
The point is that to make inferences from regressions certain assumptions need to hold at least approximately. Such residual plots are just one kind of check on those assumptions to see if there are any gross deviations from those assumptions. A residual plot should be mandatory.
$endgroup$
add a comment |
$begingroup$
This is just an extended comment. While the fit might "look" good, an examination of the residuals vs the fit shows that there is still a lot more structure that maybe needs explaining:
ListPlot[Transpose[fit["PredictedResponse"], fit["FitResiduals"]],
Frame -> True, FrameLabel -> "Predicted response", "Fit residual"]
Three (of many) possibilities: (1) underlying curve is more complicated than first thought and (2) the measurement system has a floating bias, (3) the observations are correlated across the predictor variable (maybe that's "time"?).
The point is that to make inferences from regressions certain assumptions need to hold at least approximately. Such residual plots are just one kind of check on those assumptions to see if there are any gross deviations from those assumptions. A residual plot should be mandatory.
$endgroup$
add a comment |
$begingroup$
This is just an extended comment. While the fit might "look" good, an examination of the residuals vs the fit shows that there is still a lot more structure that maybe needs explaining:
ListPlot[Transpose[fit["PredictedResponse"], fit["FitResiduals"]],
Frame -> True, FrameLabel -> "Predicted response", "Fit residual"]
Three (of many) possibilities: (1) underlying curve is more complicated than first thought and (2) the measurement system has a floating bias, (3) the observations are correlated across the predictor variable (maybe that's "time"?).
The point is that to make inferences from regressions certain assumptions need to hold at least approximately. Such residual plots are just one kind of check on those assumptions to see if there are any gross deviations from those assumptions. A residual plot should be mandatory.
$endgroup$
This is just an extended comment. While the fit might "look" good, an examination of the residuals vs the fit shows that there is still a lot more structure that maybe needs explaining:
ListPlot[Transpose[fit["PredictedResponse"], fit["FitResiduals"]],
Frame -> True, FrameLabel -> "Predicted response", "Fit residual"]
Three (of many) possibilities: (1) underlying curve is more complicated than first thought and (2) the measurement system has a floating bias, (3) the observations are correlated across the predictor variable (maybe that's "time"?).
The point is that to make inferences from regressions certain assumptions need to hold at least approximately. Such residual plots are just one kind of check on those assumptions to see if there are any gross deviations from those assumptions. A residual plot should be mandatory.
answered May 17 at 15:01
JimBJimB
19k12863
19k12863
add a comment |
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f198565%2fhow-to-do-an-exponential-fit-for-this-data%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Can you give the exact command you used to fit please? Otherwise it's difficult to tell what's going on. But as a first guess I'd suggest you try again with a fresh kernel.
$endgroup$
– Roman
May 17 at 12:51
$begingroup$
@Roman Updated the question.
$endgroup$
– Spencer Keller
May 17 at 12:55
2
$begingroup$
Runs fine on my computer. Please try your own code with a fresh kernel. Check
?a
and?b
to see if there are any lingering definitions.$endgroup$
– Roman
May 17 at 13:01
$begingroup$
@Roman I took your advice and used a new kernel. Worked just fine. Would you happen to know why using a new kernel worked?
$endgroup$
– Spencer Keller
May 17 at 13:21
$begingroup$
Lingering definitions of
a
andb
. Check them with?a
and?b
.$endgroup$
– Roman
May 17 at 13:30