Skip to main content
added 46 characters in body
Source Link
ubpdqn
  • 69.6k
  • 3
  • 67
  • 168

NB: see comment by @JimB. Original post was wrong.

Updated Post

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
v = {1, x^2, x, y, x y}
exp = y^2 - lm["BestFitParameters"] . v;
{u1, u2} = 
  y^2 - lm["SinglePredictionBands"] /. Thread[{1, a, b, c, e} -> v];
ContourPlot[{exp == 0, u1 == 0, u2 == 0}, {x, 0, 600}, {y, 0, 300}, 
 Epilog -> Point[pts], AspectRatio -> Automatic]

enter image description here

I leave the original post for transparency.

Original Post

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
exp = y^2 - lm["BestFitParameters"] . {1, x^2, x, y, x y}
ci = lm["ParameterConfidenceIntervalTableEntries"];
exp2 = y^2 - ci[[All, 3, 1]] . {1, x^2, x, y, x y}
exp3 = y^2 - ci[[All, 3, 2]] . {1, x^2, x, y, x y}
ContourPlot[{exp == 0, exp2 == 0, exp3 == 0}, {x, 0, 600}, {y, 0, 
  300}, Epilog -> Point[pts], PlotLabel -> Row[{exp, "=0"}], 
 AspectRatio -> Automatic]

enter image description here

NB: see comment by @JimB. Original post was wrong.

Updated Post

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
v = {1, x^2, x, y, x y}
{u1, u2} = 
  y^2 - lm["SinglePredictionBands"] /. Thread[{1, a, b, c, e} -> v];
ContourPlot[{exp == 0, u1 == 0, u2 == 0}, {x, 0, 600}, {y, 0, 300}, 
 Epilog -> Point[pts], AspectRatio -> Automatic]

enter image description here

I leave the original post for transparency.

Original Post

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
exp = y^2 - lm["BestFitParameters"] . {1, x^2, x, y, x y}
ci = lm["ParameterConfidenceIntervalTableEntries"];
exp2 = y^2 - ci[[All, 3, 1]] . {1, x^2, x, y, x y}
exp3 = y^2 - ci[[All, 3, 2]] . {1, x^2, x, y, x y}
ContourPlot[{exp == 0, exp2 == 0, exp3 == 0}, {x, 0, 600}, {y, 0, 
  300}, Epilog -> Point[pts], PlotLabel -> Row[{exp, "=0"}], 
 AspectRatio -> Automatic]

enter image description here

NB: see comment by @JimB. Original post was wrong.

Updated Post

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
v = {1, x^2, x, y, x y}
exp = y^2 - lm["BestFitParameters"] . v;
{u1, u2} = 
  y^2 - lm["SinglePredictionBands"] /. Thread[{1, a, b, c, e} -> v];
ContourPlot[{exp == 0, u1 == 0, u2 == 0}, {x, 0, 600}, {y, 0, 300}, 
 Epilog -> Point[pts], AspectRatio -> Automatic]

enter image description here

I leave the original post for transparency.

Original Post

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
exp = y^2 - lm["BestFitParameters"] . {1, x^2, x, y, x y}
ci = lm["ParameterConfidenceIntervalTableEntries"];
exp2 = y^2 - ci[[All, 3, 1]] . {1, x^2, x, y, x y}
exp3 = y^2 - ci[[All, 3, 2]] . {1, x^2, x, y, x y}
ContourPlot[{exp == 0, exp2 == 0, exp3 == 0}, {x, 0, 600}, {y, 0, 
  300}, Epilog -> Point[pts], PlotLabel -> Row[{exp, "=0"}], 
 AspectRatio -> Automatic]

enter image description here

added 609 characters in body
Source Link
ubpdqn
  • 69.6k
  • 3
  • 67
  • 168

NB: see comment by @JimB. The 95% CI approach usedOriginal post was wrong. I will edit post when I get time.

Updated Post

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
v = {1, x^2, x, y, x y}
{u1, u2} = 
  y^2 - lm["SinglePredictionBands"] /. Thread[{1, a, b, c, e} -> v];
ContourPlot[{exp == 0, u1 == 0, u2 == 0}, {x, 0, 600}, {y, 0, 300}, 
 Epilog -> Point[pts], AspectRatio -> Automatic]

enter image description here

I leave the original post for transparency.

Original Post

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
exp = y^2 - lm["BestFitParameters"] . {1, x^2, x, y, x y}
ci = lm["ParameterConfidenceIntervalTableEntries"];
exp2 = y^2 - ci[[All, 3, 1]] . {1, x^2, x, y, x y}
exp3 = y^2 - ci[[All, 3, 2]] . {1, x^2, x, y, x y}
ContourPlot[{exp == 0, exp2 == 0, exp3 == 0}, {x, 0, 600}, {y, 0, 
  300}, Epilog -> Point[pts], PlotLabel -> Row[{exp, "=0"}], 
 AspectRatio -> Automatic]

enter image description here

NB: see comment by @JimB. The 95% CI approach used was wrong. I will edit post when I get time.

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
exp = y^2 - lm["BestFitParameters"] . {1, x^2, x, y, x y}
ci = lm["ParameterConfidenceIntervalTableEntries"];
exp2 = y^2 - ci[[All, 3, 1]] . {1, x^2, x, y, x y}
exp3 = y^2 - ci[[All, 3, 2]] . {1, x^2, x, y, x y}
ContourPlot[{exp == 0, exp2 == 0, exp3 == 0}, {x, 0, 600}, {y, 0, 
  300}, Epilog -> Point[pts], PlotLabel -> Row[{exp, "=0"}], 
 AspectRatio -> Automatic]

enter image description here

NB: see comment by @JimB. Original post was wrong.

Updated Post

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
v = {1, x^2, x, y, x y}
{u1, u2} = 
  y^2 - lm["SinglePredictionBands"] /. Thread[{1, a, b, c, e} -> v];
ContourPlot[{exp == 0, u1 == 0, u2 == 0}, {x, 0, 600}, {y, 0, 300}, 
 Epilog -> Point[pts], AspectRatio -> Automatic]

enter image description here

I leave the original post for transparency.

Original Post

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
exp = y^2 - lm["BestFitParameters"] . {1, x^2, x, y, x y}
ci = lm["ParameterConfidenceIntervalTableEntries"];
exp2 = y^2 - ci[[All, 3, 1]] . {1, x^2, x, y, x y}
exp3 = y^2 - ci[[All, 3, 2]] . {1, x^2, x, y, x y}
ContourPlot[{exp == 0, exp2 == 0, exp3 == 0}, {x, 0, 600}, {y, 0, 
  300}, Epilog -> Point[pts], PlotLabel -> Row[{exp, "=0"}], 
 AspectRatio -> Automatic]

enter image description here

added 103 characters in body
Source Link
ubpdqn
  • 69.6k
  • 3
  • 67
  • 168

NB: see comment by @JimB. The 95% CI approach used was wrong. I will edit post when I get time.

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
exp = y^2 - lm["BestFitParameters"] . {1, x^2, x, y, x y}
ci = lm["ParameterConfidenceIntervalTableEntries"];
exp2 = y^2 - ci[[All, 3, 1]] . {1, x^2, x, y, x y}
exp3 = y^2 - ci[[All, 3, 2]] . {1, x^2, x, y, x y}
ContourPlot[{exp == 0, exp2 == 0, exp3 == 0}, {x, 0, 600}, {y, 0, 
  300}, Epilog -> Point[pts], PlotLabel -> Row[{exp, "=0"}], 
 AspectRatio -> Automatic]

enter image description here

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
exp = y^2 - lm["BestFitParameters"] . {1, x^2, x, y, x y}
ci = lm["ParameterConfidenceIntervalTableEntries"];
exp2 = y^2 - ci[[All, 3, 1]] . {1, x^2, x, y, x y}
exp3 = y^2 - ci[[All, 3, 2]] . {1, x^2, x, y, x y}
ContourPlot[{exp == 0, exp2 == 0, exp3 == 0}, {x, 0, 600}, {y, 0, 
  300}, Epilog -> Point[pts], PlotLabel -> Row[{exp, "=0"}], 
 AspectRatio -> Automatic]

enter image description here

NB: see comment by @JimB. The 95% CI approach used was wrong. I will edit post when I get time.

I have upvoted @UlrichNeumann answer. For what it is worth you can use LinearModelFit. For example:

d = {#1^2, #1, #2, #1 #2, #2^2} & @@@ pts;
lm = LinearModelFit[d, {a, b, c, e}, {a, b, c, e}];
exp = y^2 - lm["BestFitParameters"] . {1, x^2, x, y, x y}
ci = lm["ParameterConfidenceIntervalTableEntries"];
exp2 = y^2 - ci[[All, 3, 1]] . {1, x^2, x, y, x y}
exp3 = y^2 - ci[[All, 3, 2]] . {1, x^2, x, y, x y}
ContourPlot[{exp == 0, exp2 == 0, exp3 == 0}, {x, 0, 600}, {y, 0, 
  300}, Epilog -> Point[pts], PlotLabel -> Row[{exp, "=0"}], 
 AspectRatio -> Automatic]

enter image description here

Source Link
ubpdqn
  • 69.6k
  • 3
  • 67
  • 168
Loading