Testowanie hipotez statsytycznych

Grzegorz Siudem

Testowani hipotez

(*obszar krytyczny*)
Manipulate[Plot[{#,If[Abs@x<InverseCDF[NormalDistribution[μ,σ],1-a],1,0]*#}&@ PDF[NormalDistribution[0,2]][x],{x,-6,6},PlotTheme->"Scientific",Filling->Bottom,FrameTicks->{{Automatic,Automatic},{{{-4,"(Subscript[z, α/2])"},{4,"(Subscript[z, 1 - α/2])"}},None}},FrameTicksStyle->Directive[Bold,20]],{a,0.0000001,1}]

σ=1;
μ=0;
hμ=0; (*HIPOTEZA*)
α=0.1;
proba=RandomVariate[NormalDistribution[μ,σ],100]
((Mean[proba]-hμ)/σ)(Sqrt[Length@proba])
InverseCDF[NormalDistribution[μ,σ],{α,1-α}]

Plot[InverseCDF[NormalDistribution[μ,σ],{p,1-p}],{p,0,0.5},PlotTheme->"Scientific",FrameLabel->{"α","przedzial krytyczny"},GridLines->Automatic]

Przyklad na blad 2. rodzaju

σ=1;
μ=1;
hμ=0; (*HIPOTEZA*)
α=0.05;
proba=RandomVariate[NormalDistribution[μ,σ],100]
((Mean[proba]-hμ)/σ)(Sqrt[Length@proba])
InverseCDF[NormalDistribution[μ,σ],{α,1-α}]