Checking technical credit default cases with hypothesis testing My question comes from the field of banking but turns out to be a general statistical one. 
Let us assume a model might exist that tells us the default probability $PD_i$ of case $i$.
However, there are circumstances when a technical deficiency results in a big chunk of cases being marked as default while these are actually performing credits. Such chunks of technical defaults can usually be recognized (by time stamp e.g.) and then analyzed together.
The question is: in statistical terms what is a good model to determine the number of cases that I need to check for being a real default or just a technical one to get confidence for the whole chunk?
I thought about a hypothesis of the following kind:
$$
H_0: \{\text{the fraction of defaults in the chunk is } p  \}
$$
Then if I select $k$ cases and can confirm that none of them was a genuine default the probability (assuming a binomial distribution, a hypergeometric one with some extra care is possible too) is
$$
P[\text{no genuine default among } k \text{ cases}] = (1-p)^k
$$
and I would choose $k$ high enough to get e.g. 
$$
(1-p)^k < 0.05.
$$
The question is how to determine $p$. One could derive $p$ from the PD model of the portfolio. 
If I can reject $H_0$ at the 5% significance level can I accept the alternative hypothesis of 
$$
H_1: \{\text{the fraction of defaults in the chunk is less than } p  \}
$$
or even
$$
H_1': \{\text{the fraction of defaults in the chunk is } 0  \}?
$$
I think this has something to do with sample size choice for survey design. Could anyone please point me in the right direction? Thanks in advance.
 A: You want to do a power analysis. In your case, power is your probability of flagging a technical deficiency appropriately. Formally, power is the probability of rejecting $H_{0}$ given that $H_{1}$ is true. And what you want to know is what sample size you need to attain a certain power and alpha level.
I should mention that $\alpha$ does not have to be .05. You can set its value based on how big of a deal a false alarm is to you.
You can only really do the math for a power analysis if you pick a more specific alternative hypothesis. (Yours is a 'composite' hypothesis, not a 'simple' one.) So let $H_{1}$: the fraction of defaults in the chunk is p*. p* should be the highest proportion of defaults you could see during a technical deficiency.
You reject the null hypothesis based on whether a one-sided confidence interval for the proportion of defaults includes p. 
To do a power analysis, you find the critical value that lets you reject the null hypothesis at a given alpha level and sample size. Then find what fraction of the alternative hypothesis' distribution lies to the right of that cut-off value. That's your power.
You can repeat this process with different sample sizes and plot how your power changes as a function of n. Once you get a power you like, you'll know how big n has to be.
