dh-Materialien Einführung in Maple    Übungen
|  Home  |  Back  |  <   >  |

Mathematik
 

Einführung in Maple
  Hinweise
  Übersicht
  Übungen
  Anwendungen
  Stichworte
  Download
 

Nichtlineare Regression

restart;
with (Statistics): with (CurveFitting): with (plots):
Seed:= randomize():

Warning, the name changecoords has been redefined

Simulation der Messung einer Größe y in Abhängigkeit von x:

xWerte:= [seq (n/5, n = 0..20)]:
f:= x -> -x^2 + 4*x + 1;
yWerte:= map (x -> f(x) + (rand(90)() - 45)/70, xWerte):

ScatterPlot (xWerte, yWerte,
               color = black,
               symbol = cross,
               labels = ["x","y"]);

[Maple Plot]

Finden einer Regressionskurve mit der Methode der kleinsten Quadrate:

Punkte:= ScatterPlot (xWerte, yWerte,
                         color = black,
                         symbol = cross,
                         labels = ["x","y"]):
y:= LeastSquares (xWerte, yWerte, x, curve = a*x^2 + b*x + c):
y;

regr(x):= evalf (y, 3);
Regressionskurve:= plot (regr(x), x = 0..4,
                         color = red):
Kurve:= plot (f(x), x = 0..4,
                         color = blue,
                         linestyle = DOT):
display ([Punkte, Kurve, Regressionskurve]);

 [Maple Plot]

Copyright

Valid HTML 4.01 Transitional

|  Home  |  Back  |  Top  |