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













2












$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?










share|improve this question











$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 of a and b. Check them with ?a and ?b.
    $endgroup$
    – Roman
    May 17 at 13:30















2












$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?










share|improve this question











$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 of a and b. Check them with ?a and ?b.
    $endgroup$
    – Roman
    May 17 at 13:30













2












2








2





$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?










share|improve this question











$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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 of a and b. 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$
    @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 and b. 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










2 Answers
2






active

oldest

votes


















5












$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]]]


enter image description here






share|improve this answer









$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, use Exp[a*x + c] + b for the model.
    $endgroup$
    – Bob Hanlon
    May 17 at 13:20


















4












$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"]


residuals vs fit



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.






share|improve this answer









$endgroup$













    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
    );



    );













    draft saved

    draft discarded


















    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









    5












    $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]]]


    enter image description here






    share|improve this answer









    $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, use Exp[a*x + c] + b for the model.
      $endgroup$
      – Bob Hanlon
      May 17 at 13:20















    5












    $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]]]


    enter image description here






    share|improve this answer









    $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, use Exp[a*x + c] + b for the model.
      $endgroup$
      – Bob Hanlon
      May 17 at 13:20













    5












    5








    5





    $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]]]


    enter image description here






    share|improve this answer









    $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]]]


    enter image description here







    share|improve this answer












    share|improve this answer



    share|improve this answer










    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, use Exp[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$
      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$
    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











    4












    $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"]


    residuals vs fit



    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.






    share|improve this answer









    $endgroup$

















      4












      $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"]


      residuals vs fit



      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.






      share|improve this answer









      $endgroup$















        4












        4








        4





        $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"]


        residuals vs fit



        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.






        share|improve this answer









        $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"]


        residuals vs fit



        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 17 at 15:01









        JimBJimB

        19k12863




        19k12863



























            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form