mirror of
https://github.com/vale981/TUD_MATH_BA
synced 2025-03-06 01:51:38 -05:00
add some graphs
This commit is contained in:
parent
5dd923991b
commit
a40c5a4d3e
3 changed files with 52 additions and 5 deletions
Binary file not shown.
|
@ -52,7 +52,7 @@ From the 200 simulated samples above (Monte Carlo simulation), it seems very unl
|
|||
\end{align}
|
||||
The p-value can be evaluated using the statistical distance of 16.8 from 18.3 (a z statistic).
|
||||
\begin{align}
|
||||
z = \frac{\bar{x} - 18.3}{\underbrace{\frac{7.1}{\sqrt{30}}}_{\text{standard error}}} = -1.155 \notag
|
||||
z = \frac{\bar{x} - 18.3}{\underbrace{\frac{7.1}{\sqrt{30}}}_{\text{standard error}}} = -1.157 \notag
|
||||
\end{align}
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
|
@ -64,20 +64,27 @@ From the 200 simulated samples above (Monte Carlo simulation), it seems very unl
|
|||
axis x line=middle,
|
||||
]
|
||||
\addplot[name path=f,blue] {1/(sqrt(2*pi))*exp(-0.5*x^2)};
|
||||
\path[name path=axis] (axis cs:-3,0) -- (axis cs:-1.155,0);
|
||||
\addplot [thick,color=blue,fill=blue,fill opacity=0.3] fill between[of=f and axis,soft clip={domain=-3:-1.155},];
|
||||
\draw [dotted,] (axis cs:-1.155,0) -- (axis cs:-1.155,0.6);
|
||||
\path[name path=axis] (axis cs:-3,0) -- (axis cs:-1.157,0);
|
||||
\addplot [thick,color=blue,fill=blue,fill opacity=0.3] fill between[of=f and axis,soft clip={domain=-3:-1.157},];
|
||||
\draw [dotted] (axis cs:-1.157,0) -- (axis cs:-1.157,0.6);
|
||||
\node at (axis cs:-2.5,0.25) (node) {p-value};
|
||||
\draw (axis cs:-2.5,0.23) -- (axis cs:-1.5,0.08);
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
\begin{align}
|
||||
\text{p-value} = P(z \le -1.155) = 0.124 \notag
|
||||
\text{p-value} = P(z \le -1.157) = 0.124 \notag
|
||||
\end{align}
|
||||
The p-value is reasonably large, meaning that a sample mean as low as 16.8 would not be unusual if $\mu=18.3$, so there is no evidence against $H_0$.
|
||||
\end{example}
|
||||
|
||||
\begin{*anmerkung}
|
||||
To compute the p-value you can use
|
||||
\begin{align}
|
||||
\text{p-value} = \texttt{CDF(NormalDistribution(0,1),-1.157)}\notag
|
||||
\end{align}
|
||||
\end{*anmerkung}
|
||||
|
||||
\begin{example}[normal distribution with known $\sigma$, two-tailed test]
|
||||
Companies test their products to ensure that the amount of active ingredient is within some limits. However the chemical analysis is not precise and repeated measurements of the same specimen usually differ slightly. One type of analysis gives results that are normally distributed with a mean that depend on the actual product being tested and standard deviation 0.0068 grams per litre. A product is tested three times with the following concentrations of the active ingredient: 0.8403, 0.8363, 0.8447 grams per litre. are the data consistent with the target concentration of 0.85 grams per litre?
|
||||
\begin{center}
|
||||
|
@ -93,6 +100,28 @@ From the 200 simulated samples above (Monte Carlo simulation), it seems very unl
|
|||
p-value interpretation & There is moderately strong evidence that the true concentration is not 0.85.
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
\begin{axis}[
|
||||
xmin=-3, xmax=3, xlabel=$z$,
|
||||
ymin=0, ymax=0.6,
|
||||
samples=400,
|
||||
axis y line=middle,
|
||||
axis x line=middle,
|
||||
]
|
||||
\addplot[name path=f,blue] {1/(sqrt(2*pi))*exp(-0.5*x^2)};
|
||||
\path[name path=axis] (axis cs:-3,0) -- (axis cs:-2.437,0);
|
||||
\path[name path=axis2] (axis cs:2.437,0) -- (axis cs:3,0);
|
||||
\addplot [thick,color=blue,fill=blue,fill opacity=0.3] fill between[of=f and axis,soft clip={domain=-3:-2.437},];
|
||||
\addplot [thick,color=blue,fill=blue,fill opacity=0.3] fill between[of=f and axis2,soft clip={domain=2.437:3},];
|
||||
\draw [dotted] (axis cs:-2.437,0) -- (axis cs:-2.437,0.6);
|
||||
\draw [dotted] (axis cs:2.437,0) -- (axis cs:2.437,0.6);
|
||||
\node at (axis cs:-1.5,0.25) (node) {p-value};
|
||||
\draw (axis cs:-1.7,0.23) -- (axis cs:-2.7,0.002);
|
||||
\draw (axis cs:-1.3,0.23) -- (axis cs:2.7,0.002);
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
\end{example}
|
||||
|
||||
\begin{example}[normal distribution with unknown $\sigma$, one-tailed test]
|
||||
|
@ -108,6 +137,24 @@ From the 200 simulated samples above (Monte Carlo simulation), it seems very unl
|
|||
p-value interpretation & Since this is below 0.05, we conclude that there is moderately strong evidence that the mean saturated fat content of the oils is higher than the claimed 15\%.
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
\begin{axis}[
|
||||
xmin=-3, xmax=3, xlabel=$z$,
|
||||
ymin=0, ymax=0.6,
|
||||
samples=400,
|
||||
axis y line=middle,
|
||||
axis x line=middle,
|
||||
]
|
||||
\addplot[name path=f,blue] {4041576*(1/(x^2 + 12))^(13/2)};
|
||||
\path[name path=axis] (axis cs:-3,0) -- (axis cs:-1.906,0);
|
||||
\addplot [thick,color=blue,fill=blue,fill opacity=0.3] fill between[of=f and axis,soft clip={domain=-3:-1.906},];
|
||||
\draw [dotted] (axis cs:-1.906,0) -- (axis cs:-1.906,0.6);
|
||||
\node at (axis cs:-2.5,0.25) (node) {p-value};
|
||||
\draw (axis cs:-2.5,0.23) -- (axis cs:-2.2,0.03);
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
\end{example}
|
||||
|
||||
A hypothesis test is based on two competing hypotheses about the value of a parameter $\theta$. \\
|
||||
|
|
Loading…
Add table
Reference in a new issue