Regression

daten = {{0, 0}, {4, 0.1}, {7, 0.3}, {8, 0.8}, {9, 2}, {10, 
          10}}

f = Fit[daten, {1, x}, x]

plot1 = Graphics[{PointSize[0.03], Map[Point, daten]}]

plot2 = 
      Plot[f, {x, Min[Transpose[daten][[1]]], 
          Max[Transpose[daten][[1]]]}]

Show[plot2, plot1, PlotRange -> All]

f = Fit[daten, {1, x, (x^2)}, x]

plot3 = 
      Plot[f, {x, Min[Transpose[daten][[1]]], 
          Max[Transpose[daten][[1]]]}]

Show[plot3, plot1, PlotRange -> All]

f = Fit[daten, {1, (E^x)}, x]

plot4 = 
      Plot[f, {x, Min[Transpose[daten][[1]]], 
          Max[Transpose[daten][[1]]]}]

Show[plot4, plot1, PlotRange -> All]

f = Fit[daten, {1, (4^x)}, x]

plot5 = 
      Plot[f, {x, Min[Transpose[daten][[1]]], 
          Max[Transpose[daten][[1]]]}]

Show[plot5, plot1, PlotRange -> All]

Übungsaufgabe

daten = {{0.02, 20}, {0.1, 15}, {0.5, 1}, {0.8, 6}, {1.0, 
          3}}

plot1 = Graphics[{PointSize[0.03], Map[Point, daten]}]

f = Fit[daten, {1, x}, x]

plot2 = 
      Plot[f, {x, Min[Transpose[daten][[1]]], 
          Max[Transpose[daten][[1]]]}]

Show[plot2, plot1, PlotRange -> All]

f = Fit[daten, {1, x, (x^2)}, x]

plot2 = 
      Plot[f, {x, Min[Transpose[daten][[1]]], 
          Max[Transpose[daten][[1]]]}]

Show[plot2, plot1, PlotRange -> All]

f = Fit[daten, {1, x, (x^2), (x^3)}, x]

plot2 = 
      Plot[f, {x, Min[Transpose[daten][[1]]], 
          Max[Transpose[daten][[1]]]}]

Show[plot2, plot1, PlotRange -> All]

f = Fit[daten, {1, x, (x^2), (x^3), (x^4)}, x]

plot2 = 
      Plot[f, {x, Min[Transpose[daten][[1]]], 
          Max[Transpose[daten][[1]]]}]

Show[plot2, plot1, PlotRange -> All]

Approximation im quadratischen Mittel

Übungsaufgabe

f = (x^2) - 1

{a = -1, b = 1}

Plot[f, {x, a, b}, PlotRange -> All]

n = 2

ϕ = (∑_(k = 0)^n) c[k] (x^k)

Map[Factor, Collect[(((f - ϕ))^2), x]]

F = 
      Expand[(∫_a^b)(((f - ϕ))^2) \[DifferentialD]x]

D[F, c[0]]

D[F, c[1]]

D[F, c[2]]

gleichungen = Table[D[F, c[k]], {k, 0, 4}]

sol = 
      Solve[gleichungen == 0, Table[c[k ], {k, 0, 4}]] // 
        FullSimplify

ϕ /. sol

Clear[f, F, ϕ, a, b, n]

Chebyshev-Polynome

Table[TrigExpand[Cos[k ArcCos[x]]], {k, 0, 10}]

Table[ChebyshevT[k, x], {k, 0, 10}]

Clear[T]
T[0] = 1;
T[1] = x;
T[k_] := 2  x T[k - 1] - T[k - 2]

Table[T[k], {k, 0, 10}]

Clear[T]
T[0] = 1;
T[1] = x;
T[k_] := Expand[2  x T[k - 1] - T[k - 2]]

Table[T[k], {k, 0, 10}]

Graphen der Chebyshev-Polynome

Plot[
      Evaluate[Table[ChebyshevT[k, x], {k, 0, 5}]], {x, -1, 
        1}]