Warning Mathematica FittedModel: The precision of the argument function (MachinePrecision) is less than...












0















Fellows,



I couldn't figure why I am having the warning message from the following code in Mathematica:



data = {{0, 1}, {1, 0.02307044673005989`}, {2, 
0.00784879347316981`}, {3, 0.0061305265946403195`}, {4,
0.0008550610216054799`}, {5, 0.00010928133254420425`}, {6,
0.000011431049984759768`}, {7, 1.93788101788827`*^-6}, {8,
1.6278670621771263`*^-6}, {9, 2.6661469926370584`*^-7}, {10,
3.443821224260662`*^-8}, {11, 7.413060538191399`*^-9}, {12,
1.4031525687948224`*^-9}, {13, 5.973790450062338`*^-10}, {14,
1.7434844383850214`*^-10}, {15, 2.6053424128998922`*^-11}, {16,
9.887095524831592`*^-12}, {17, 1.2318024865446659`*^-12}, {18,
2.2125640342387203`*^-13}, {19, 1.3176590670511745`*^-13}, {20,
2.7354393146500743`*^-14}};

fit = NonlinearModelFit[data, a + b Exp[-x/c], {a, b, c}, x,
MaxIterations -> [Infinity], PrecisionGoal -> MachinePrecision,
WorkingPrecision -> MachinePrecision];

fit["BestFitParameters"] (* THE WARNING APPEARS AFTER CALLING THIS FUNCTION *)


The warning message is:




FittedModel: The precision of the argument function (MachinePrecision) is less than WorkingPrecision (MachinePrecision).




Thanks in advance.










share|improve this question



























    0















    Fellows,



    I couldn't figure why I am having the warning message from the following code in Mathematica:



    data = {{0, 1}, {1, 0.02307044673005989`}, {2, 
    0.00784879347316981`}, {3, 0.0061305265946403195`}, {4,
    0.0008550610216054799`}, {5, 0.00010928133254420425`}, {6,
    0.000011431049984759768`}, {7, 1.93788101788827`*^-6}, {8,
    1.6278670621771263`*^-6}, {9, 2.6661469926370584`*^-7}, {10,
    3.443821224260662`*^-8}, {11, 7.413060538191399`*^-9}, {12,
    1.4031525687948224`*^-9}, {13, 5.973790450062338`*^-10}, {14,
    1.7434844383850214`*^-10}, {15, 2.6053424128998922`*^-11}, {16,
    9.887095524831592`*^-12}, {17, 1.2318024865446659`*^-12}, {18,
    2.2125640342387203`*^-13}, {19, 1.3176590670511745`*^-13}, {20,
    2.7354393146500743`*^-14}};

    fit = NonlinearModelFit[data, a + b Exp[-x/c], {a, b, c}, x,
    MaxIterations -> [Infinity], PrecisionGoal -> MachinePrecision,
    WorkingPrecision -> MachinePrecision];

    fit["BestFitParameters"] (* THE WARNING APPEARS AFTER CALLING THIS FUNCTION *)


    The warning message is:




    FittedModel: The precision of the argument function (MachinePrecision) is less than WorkingPrecision (MachinePrecision).




    Thanks in advance.










    share|improve this question

























      0












      0








      0








      Fellows,



      I couldn't figure why I am having the warning message from the following code in Mathematica:



      data = {{0, 1}, {1, 0.02307044673005989`}, {2, 
      0.00784879347316981`}, {3, 0.0061305265946403195`}, {4,
      0.0008550610216054799`}, {5, 0.00010928133254420425`}, {6,
      0.000011431049984759768`}, {7, 1.93788101788827`*^-6}, {8,
      1.6278670621771263`*^-6}, {9, 2.6661469926370584`*^-7}, {10,
      3.443821224260662`*^-8}, {11, 7.413060538191399`*^-9}, {12,
      1.4031525687948224`*^-9}, {13, 5.973790450062338`*^-10}, {14,
      1.7434844383850214`*^-10}, {15, 2.6053424128998922`*^-11}, {16,
      9.887095524831592`*^-12}, {17, 1.2318024865446659`*^-12}, {18,
      2.2125640342387203`*^-13}, {19, 1.3176590670511745`*^-13}, {20,
      2.7354393146500743`*^-14}};

      fit = NonlinearModelFit[data, a + b Exp[-x/c], {a, b, c}, x,
      MaxIterations -> [Infinity], PrecisionGoal -> MachinePrecision,
      WorkingPrecision -> MachinePrecision];

      fit["BestFitParameters"] (* THE WARNING APPEARS AFTER CALLING THIS FUNCTION *)


      The warning message is:




      FittedModel: The precision of the argument function (MachinePrecision) is less than WorkingPrecision (MachinePrecision).




      Thanks in advance.










      share|improve this question














      Fellows,



      I couldn't figure why I am having the warning message from the following code in Mathematica:



      data = {{0, 1}, {1, 0.02307044673005989`}, {2, 
      0.00784879347316981`}, {3, 0.0061305265946403195`}, {4,
      0.0008550610216054799`}, {5, 0.00010928133254420425`}, {6,
      0.000011431049984759768`}, {7, 1.93788101788827`*^-6}, {8,
      1.6278670621771263`*^-6}, {9, 2.6661469926370584`*^-7}, {10,
      3.443821224260662`*^-8}, {11, 7.413060538191399`*^-9}, {12,
      1.4031525687948224`*^-9}, {13, 5.973790450062338`*^-10}, {14,
      1.7434844383850214`*^-10}, {15, 2.6053424128998922`*^-11}, {16,
      9.887095524831592`*^-12}, {17, 1.2318024865446659`*^-12}, {18,
      2.2125640342387203`*^-13}, {19, 1.3176590670511745`*^-13}, {20,
      2.7354393146500743`*^-14}};

      fit = NonlinearModelFit[data, a + b Exp[-x/c], {a, b, c}, x,
      MaxIterations -> [Infinity], PrecisionGoal -> MachinePrecision,
      WorkingPrecision -> MachinePrecision];

      fit["BestFitParameters"] (* THE WARNING APPEARS AFTER CALLING THIS FUNCTION *)


      The warning message is:




      FittedModel: The precision of the argument function (MachinePrecision) is less than WorkingPrecision (MachinePrecision).




      Thanks in advance.







      wolfram-mathematica precision non-linear-regression






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 23 '18 at 8:48









      T.O.PuelT.O.Puel

      52




      52
























          1 Answer
          1






          active

          oldest

          votes


















          0














          The problem is that many of the data values are small and close to machine precision. You can try linear fitting to the Log of the data values.



          data2 = {First[#], Log[Last[#]]} & /@ data;
          lm = LinearModelFit[data2, x, x]
          Show[ListPlot[data2], Plot[lm[x], {x, 0, 20}]]


          The first data point {0, 1} does not look right. Are you sure it is correct?



          enter image description here






          share|improve this answer
























          • Thanks @Rohit. Besides still not understanding the reason, I'll keep in mind that the small numbers + machine precision issue is not a good match. I believe that, in the present case, LinearModelFit works nice because the constant a in a + b Exp[-x/c] is basically zero, otherwise NonLinearModelFit would be required. Ps.: the first number is correct by construction, thanks for asking.

            – T.O.Puel
            Nov 26 '18 at 8:41














          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          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: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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%2fstackoverflow.com%2fquestions%2f53443294%2fwarning-mathematica-fittedmodel-the-precision-of-the-argument-function-machine%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          The problem is that many of the data values are small and close to machine precision. You can try linear fitting to the Log of the data values.



          data2 = {First[#], Log[Last[#]]} & /@ data;
          lm = LinearModelFit[data2, x, x]
          Show[ListPlot[data2], Plot[lm[x], {x, 0, 20}]]


          The first data point {0, 1} does not look right. Are you sure it is correct?



          enter image description here






          share|improve this answer
























          • Thanks @Rohit. Besides still not understanding the reason, I'll keep in mind that the small numbers + machine precision issue is not a good match. I believe that, in the present case, LinearModelFit works nice because the constant a in a + b Exp[-x/c] is basically zero, otherwise NonLinearModelFit would be required. Ps.: the first number is correct by construction, thanks for asking.

            – T.O.Puel
            Nov 26 '18 at 8:41


















          0














          The problem is that many of the data values are small and close to machine precision. You can try linear fitting to the Log of the data values.



          data2 = {First[#], Log[Last[#]]} & /@ data;
          lm = LinearModelFit[data2, x, x]
          Show[ListPlot[data2], Plot[lm[x], {x, 0, 20}]]


          The first data point {0, 1} does not look right. Are you sure it is correct?



          enter image description here






          share|improve this answer
























          • Thanks @Rohit. Besides still not understanding the reason, I'll keep in mind that the small numbers + machine precision issue is not a good match. I believe that, in the present case, LinearModelFit works nice because the constant a in a + b Exp[-x/c] is basically zero, otherwise NonLinearModelFit would be required. Ps.: the first number is correct by construction, thanks for asking.

            – T.O.Puel
            Nov 26 '18 at 8:41
















          0












          0








          0







          The problem is that many of the data values are small and close to machine precision. You can try linear fitting to the Log of the data values.



          data2 = {First[#], Log[Last[#]]} & /@ data;
          lm = LinearModelFit[data2, x, x]
          Show[ListPlot[data2], Plot[lm[x], {x, 0, 20}]]


          The first data point {0, 1} does not look right. Are you sure it is correct?



          enter image description here






          share|improve this answer













          The problem is that many of the data values are small and close to machine precision. You can try linear fitting to the Log of the data values.



          data2 = {First[#], Log[Last[#]]} & /@ data;
          lm = LinearModelFit[data2, x, x]
          Show[ListPlot[data2], Plot[lm[x], {x, 0, 20}]]


          The first data point {0, 1} does not look right. Are you sure it is correct?



          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 24 '18 at 0:27









          Rohit NamjoshiRohit Namjoshi

          32119




          32119













          • Thanks @Rohit. Besides still not understanding the reason, I'll keep in mind that the small numbers + machine precision issue is not a good match. I believe that, in the present case, LinearModelFit works nice because the constant a in a + b Exp[-x/c] is basically zero, otherwise NonLinearModelFit would be required. Ps.: the first number is correct by construction, thanks for asking.

            – T.O.Puel
            Nov 26 '18 at 8:41





















          • Thanks @Rohit. Besides still not understanding the reason, I'll keep in mind that the small numbers + machine precision issue is not a good match. I believe that, in the present case, LinearModelFit works nice because the constant a in a + b Exp[-x/c] is basically zero, otherwise NonLinearModelFit would be required. Ps.: the first number is correct by construction, thanks for asking.

            – T.O.Puel
            Nov 26 '18 at 8:41



















          Thanks @Rohit. Besides still not understanding the reason, I'll keep in mind that the small numbers + machine precision issue is not a good match. I believe that, in the present case, LinearModelFit works nice because the constant a in a + b Exp[-x/c] is basically zero, otherwise NonLinearModelFit would be required. Ps.: the first number is correct by construction, thanks for asking.

          – T.O.Puel
          Nov 26 '18 at 8:41







          Thanks @Rohit. Besides still not understanding the reason, I'll keep in mind that the small numbers + machine precision issue is not a good match. I believe that, in the present case, LinearModelFit works nice because the constant a in a + b Exp[-x/c] is basically zero, otherwise NonLinearModelFit would be required. Ps.: the first number is correct by construction, thanks for asking.

          – T.O.Puel
          Nov 26 '18 at 8:41






















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


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


          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%2fstackoverflow.com%2fquestions%2f53443294%2fwarning-mathematica-fittedmodel-the-precision-of-the-argument-function-machine%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

          "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

          Alcedinidae

          Origin of the phrase “under your belt”?