Lösungen / Statistik 2/05

Remove["Global`*"]

1.

Selbststudium

2.

f[x_, y_, z_] := E^(x^2 - y^2) + Tan[x - y^3] + 1/Log[z]

f[4, 6, 2]

N[%]

k = {x -> 4, y -> 6, z -> 2}

w = 
      0.02*Abs[D[f[x, y, z], x] /. k] + 0.03*Abs[D[f[x, y, z], y] /. k] + 
        0.01*Abs[D[f[x, y, z], z] /. k]

-15.928191816576632 +/- 986.9679423798987

3.

a

Remove["Global`@*"]

<< Statistics`LinearRegression`

m = {{0, 1}, {1, 2}, {2, 3}, {3, 5}, {4, 5}, {5, 6}, {6, 5}, {7, 
          5}, {8, 4}, {9, 4}}

dPlot = 
        ListPlot[m, PlotStyle -> {PointSize[0.03]}];

Remove[func]

Fit[m, {1, x}, x]

fu[x_] := Fit[m, {1, x}, x]

fu[x]

Fit[m, {1, x}, x]

fu[x_] = Fit[m, {1, x}, x]

fu[x]

fPlot = Plot[fu[x], {x, 0, 9}];

fPlot = Plot[Evaluate[fu[x]], {x, 0, 9}];

Show[dPlot, fPlot];

Remove[fu1]

fuq[x_] := Fit[m, {1, x, x^2}, x]

fuq[x]

Fit[m, {1, x, x^2}, x]

?fuq

fPlotq = Plot[Evaluate[fuq[x]], {x, -3, 10}];

So geht es nicht:

Plot[fuq[x], {x, -3, 10}];

Show[dPlot, fPlot, fPlotq];

Plot[
        Evaluate[Fit[m, {1, x, x^2, x^3}, x]], {x, -10, 
          60}];

b

m1 = 
      Table[{m[[r]][[2]], m[[r]][[1]]}, {r, 1, 
          Length[m]}]

dPlot1 = 
        ListPlot[m1, PlotStyle -> {PointSize[0.03]}];

Remove[func]

Fit[m1, {1, x}, x]

fu1[x_] := Fit[m, {1, x}, x]

fu1[x]

Fit[m1, {1, x}, x]

fu1[x_] = Fit[m1, {1, x}, x]

fu1[x]

fPlot1 = Plot[fu1[x], {x, 0, 9}];

fPlot1 = Plot[Evaluate[fu1[x]], {x, 0, 9}];

Show[dPlot1, fPlot1];

Remove[fu1]

fuq1[x_] := Fit[m1, {1, x, x^2}, x]

fuq1[x]

Fit[m1, {1, x, x^2}, x]

?fuq1

fPlotq1 = Plot[Evaluate[fuq1[x]], {x, -3, 10}];

Show[dPlot1, fPlot1, fPlotq1];

c

m11 = Table[m[[r]][[1]], {r, 1, Length[m]}]

m22 = Table[m[[r]][[2]], {r, 1, Length[m]}]

<< Statistics`DescriptiveStatistics`

sxx = 
      1/(Length[m] - 1) Sum[(m11[[k]] - Mean[m11])^2, {k, 1, 
            Length[m]}]

syy = 
      1/(Length[m] - 1) Sum[(m22[[k]] - Mean[m22])^2, {k, 1, 
            Length[m]}]

sxy = 
      1/(Length[m] - 
              1) Sum[(m11[[k]] - Mean[m11]) (m22[[k]] - 
                Mean[m22]), {k, 1, Length[m]}]

r = sxy/Sqrt[sxx syy]

r // N