The power function describes the probability of a [[Type I Error]] as a function of the [[estimator]]. In other words, for any given value of the estimator $\hat \theta$, what is the probability of rejecting the null hypothesis when the null hypothesis is true?
$\gamma(\theta) = P(\text{Reject } H_0 ;\ \theta)$
The power function is related to the [[level of significance]].
$\begin{align}
\alpha &= max \ P(\text{Reject } H_0 ; \ \theta_0 \in \Theta_0) \\
&= max \ \gamma(\theta ; \ \theta_0 \in \Theta_0)
\end{align}
$
Power functions can be used to compare hypothesis tests to find the [[best test]]. A "good" power function will be low in the parameter space where the null hypothesis is true and high in the parameter space where the null hypothesis is not true. This correlates to the lowest probability of rejecting the null hypothesis when it is true and the highest probability of rejecting the null hypothesis when it is not true.
#diagram
![[../../extras/assets/Pasted image 20240502173145.png]]
![[../../extras/assets/Pasted image 20240502173307.png]]
## Example
Consider the hypotheses
$\begin{align}H_0: \mu \ge \mu_0 && H_1: \mu < \mu_0\end{align}$
A test of size $\alpha$ would be to reject $H_0$ if
$\bar X < \mu_0 + z_{1-\alpha}\frac{\sigma}{\sqrt{n}}$
Plugging this into our power function we have
$
\begin{align}
\gamma(\mu) &= P(\text{Reject } H_0; \ \mu) \\
&= P(\bar X < \mu_0 + z_{1-\alpha}\frac{\sigma}{\sqrt{n}}; \ \mu_0)
\end{align}
$
Transform to a standard normal variable
$= P \Big ( \frac{\bar X - \mu}{\sigma / \sqrt{n}} < \frac{\mu_0 + z_{1-\alpha} \sigma / \sqrt{n} - \mu)}{\sigma / \sqrt{n}} \Big )$
The probability that a standard normal random variable is less than some value is the equivalent to the [[cumulative density function]] evaluated at those values.
$= \Phi \Big ( \frac{\mu_0 + z_{1-\alpha} \sigma / \sqrt{n} - \mu)}{\sigma / \sqrt{n}} \Big ))$
#diagram