Warning Mathematica FittedModel: The precision of the argument function (MachinePrecision) is less than...
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
add a comment |
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
add a comment |
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
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
wolfram-mathematica precision non-linear-regression
asked Nov 23 '18 at 8:48
T.O.PuelT.O.Puel
52
52
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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?
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 constanta
ina + 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
add a comment |
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
});
}
});
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%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
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?
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 constanta
ina + 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
add a comment |
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?
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 constanta
ina + 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
add a comment |
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?
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?
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 constanta
ina + 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
add a comment |
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 constanta
ina + 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
add a comment |
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.
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%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
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