Lösungen / Statistik 2/03

Remove["Global`*"]

1.

f[ν_, μ_, σ_] := 
        1/(σ Sqrt[2 Pi]) E^(-1/
                  2*(ν - μ)^2/σ^2);
F[x_, μ_, σ_] := 
      Evaluate[Integrate[
          f[ν, μ, σ], {ν, -Infinity, x}]]

a

Plot[f[ν, 0, 1], {ν, -5, 5}];

Plot[F[x, 0, 1], {x, -5, 5}];

Plot[{f[x, 0, 1], F[x, 0, 1]}, {x, -5, 5}];

b

Plot[{f[x, 0, 2], F[x, 0, 2]}, {x, -5, 5}];

c

Plot[{f[x, 0, 1/2], F[x, 0, 1/2]}, {x, -5, 5}];

d

Plot[{f[x, 3, 1], F[x, 3, 1]}, {x, -5, 8}, 
        PlotRange -> {0, 1}];

d

Plot[{f[x, 3, 2], F[x, 3, 2]}, {x, -5, 8}, 
        PlotRange -> {0, 1}];

e

Plot[{f[x, 3, 1/2], F[x, 3, 1/2]}, {x, -5, 8}, 
        PlotRange -> {0, 1}];

2.

Plot[{f[x, 30, 0.02], F[x, 30, 0.02]}, {x, 29.8, 30.2}, 
        PlotRange -> {0, 20}];

Plot[{F[x, 30, 0.02]}, {x, 29.9, 30.1}];

Ausschuss  / Rebut   ( % ) :

((1 - F[30 + 0.03, 30, 0.02])  +  
        F[30 - 0.03, 30, 0.02])

((1 - F[30 + 0.03, 30, 0.02]) + F[30 - 0.03, 30, 0.02]) *100 // 
      N

3.

Remove["Global`*"]

a

n = 400;  p = 0.07;  m = 10;

<< Statistics`DiscreteDistributions`

bdist[n_] := BinomialDistribution[n, p]

pdf[n_, x_] := PDF[bdist[n], x];
cdf[n_, m_] := CDF[bdist[n], m];

1 - cdf[n, m - 1]

Sum[pdf[n, x], {x, m, n}]

b

f[ν_, μ_, σ_] := 
        1/(σ Sqrt[2 Pi]) E^(-1/
                  2*(ν - μ)^2/σ^2);
F[x_, μ_, σ_] := 
      Evaluate[Integrate[
          f[ν, μ, σ], {ν, -Infinity, x}]]

q = 1 - p;  μ = n*p;  σ = Sqrt[μ*q];

1 - F[10, μ, σ] // N

1 - F[9, μ, σ] // N

1 - F[9.5, μ, σ] // N

4.

Remove["Global`*"]

points = {{0, 0.497}, {1, 0.580}, {2, 0.839}, {3, 0.933}, {4, 
            1.044}, {5, 1.141}, {6, 1.151}, {7, 1.313}, {8, 1.404}, {9, 
            1.409}, {10, 1.422}, {11, 1.451}, {12, 1.529}};

a

f1 = FindFit[points, a + b x, {a, b}, x]

fg1[x_] := a + b x /. f1;    fg1[x]

plotpoints = 
        ListPlot[points, PlotStyle -> PointSize[0.02]];

pl1 = Plot[fg1[x], {x, 0, 12}];

Show[pl1, plotpoints];

b

f2 = FindFit[points, a + b x +  c x^2, {a, b, c}, x]

fg2[x_] := a + b x  +  c x^2 /. f2;    fg2[x]

pl2 = Plot[fg2[x], {x, 0, 12}];

Show[pl1, pl2, plotpoints];

c

sin = a + b  Sin[c + d x];

f3 = 
        FindFit[points, sin, {a, b, c,  d}, x];
sin /. f3

Plot[sin /. f3, {x, -1, 12}, AxesOrigin -> {0, 0}, 
        PlotRange -> {Automatic, {0, 2}}, 
        Epilog -> 
          Prepend[Point /@ points, PointSize[0.02]]];

d

trigpoly = 
        c + d Cos[x] + e Cos[x]^2 + f Cos[x]^3 + g Sin[x] + 
          h Sin[x]^2 + i Sin[x]^3;

f4 = FindFit[points, trigpoly, {c, d, e, f, g, h, i}, x]

trigpoly /. f4

Plot[trigpoly /. f4, {x, -1, 12}, AxesOrigin -> {0, 0}, 
        PlotRange -> {Automatic, {0, 2}}, 
        Epilog -> 
          Prepend[Point /@ points, PointSize[0.02]]];

e

?*Fit*