This vignette describes normal, nonparametric, and Poisson prediction intervals for future environmental observations. Derivations of prediction factors and simultaneous coverage are followed by the associated power calculations for normal and nonparametric monitoring procedures.

Related vignettes:

predIntNormK

Help topic: predIntNormK.

A prediction interval for some population is an interval on the real line constructed so that it will contain kk future observations or averages from that population with some specified probability (1−α)100%(1-\alpha)100\%, where 0<α<10 < \alpha < 1 and kk is some pre-specified positive integer. The quantity (1−α)100%(1-\alpha)100\% is called the confidence coefficient or confidence level associated with the prediction interval.

Let x_=x1,x2,…,xn\underline{x} = x_1, x_2, \ldots, x_n denote a vector of nn observations from a normal distribution with parameters mean=μ\mu and sd=σ\sigma. Also, let mm denote the sample size associated with the kk future averages (i.e., n.mean=mm). When m=1m=1, each average is really just a single observation, so in the rest of this section the term “averages” will replace the phrase “observations or averages”.

For a normal distribution, the form of a two-sided (1−α)100%(1-\alpha)100\% prediction interval is:

[x‾−Ks,x‾+Ks](1) [\bar{x} - Ks, \bar{x} + Ks] \;\;\;\;\;\; (1)

where x‾\bar{x} denotes the sample mean:

x‾=1n∑i=1nxi(2) \bar{x} = \frac{1}{n} \sum_{i=1}^n x_i \;\;\;\;\;\; (2)

ss denotes the sample standard deviation:

s2=1n−1∑i=1n(xi−x‾)2(3) s^2 = \frac{1}{n-1} \sum_{i=1}^n (x_i - \bar{x})^2 \;\;\;\;\;\; (3)

and KK denotes a constant that depends on the sample size nn, the confidence level, the number of future averages kk, and the sample size associated with the future averages, mm. Do not confuse the constant KK (uppercase K) with the number of future averages kk (lowercase k). The symbol KK is used here to be consistent with the notation used for tolerance intervals (see tolIntNorm).

Similarly, the form of a one-sided lower prediction interval is:

[x‾−Ks,∞](4) [\bar{x} - Ks, \infty] \;\;\;\;\;\; (4)

and the form of a one-sided upper prediction interval is:

[−∞,x‾+Ks](5) [-\infty, \bar{x} + Ks] \;\;\;\;\;\; (5)

but KK differs for one-sided versus two-sided prediction intervals. The derivation of the constant KK is explained below. The function predIntNormK computes the value of KK and is called by predIntNorm.

The Derivation of K for One Future Observation or Average (k = 1)
Let XX denote a random variable from a normal distribution with parameters mean=μ\mu and sd=σ\sigma, and let xpx_p denote the pp’th quantile of XX.

A true two-sided (1−α)100%(1-\alpha)100\% prediction interval for the next k=1k=1 observation of XX is given by:

[xα/2,x1−α/2]=[μ−z1−α/2σ,μ+z1−α/2σ](6) [x_{\alpha/2}, x_{1-\alpha/2}] = [\mu - z_{1-\alpha/2}\sigma, \mu + z_{1-\alpha/2}\sigma] \;\;\;\;\;\; (6)

where zpz_p denotes the pp’th quantile of a standard normal distribution.

More generally, a true two-sided (1−α)100%(1-\alpha)100\% prediction interval for the next k=1k=1 average based on a sample of size mm is given by:

[μ−z1−α/2σm,μ+z1−α/2σm](7) [\mu - z_{1-\alpha/2}\frac{\sigma}{\sqrt{m}}, \mu + z_{1-\alpha/2}\frac{\sigma}{\sqrt{m}}] \;\;\;\;\;\; (7)

Because the values of μ\mu and σ\sigma are unknown, they must be estimated, and a prediction interval then constructed based on the estimated values of μ\mu and σ\sigma.

For a two-sided prediction interval (pi.type="two-sided"), the constant KK for a (1−α)100%(1-\alpha)100\% prediction interval for the next k=1k=1 average based on a sample size of mm is computed as:

K=tn−1,1−α/21m+1n(8) K = t_{n-1, 1-\alpha/2} \sqrt{\frac{1}{m} + \frac{1}{n}} \;\;\;\;\;\; (8)

where tν,pt_{\nu, p} denotes the pp’th quantile of the Student’s t-distribution with ν\nu degrees of freedom. For a one-sided prediction interval (pi.type="lower" or pi.type="lower"), the prediction interval is given by:

K=tn−1,1−α1m+1n(9) K = t_{n-1, 1-\alpha} \sqrt{\frac{1}{m} + \frac{1}{n}} \;\;\;\;\;\; (9)

.

The formulas for these prediction intervals are derived as follows. Let y‾\bar{y} denote the future average based on mm observations. Then the quantity y‾−x‾\bar{y} - \bar{x} has a normal distribution with expectation and variance given by:

E(y‾−x‾)=0(10) E(\bar{y} - \bar{x}) = 0 \;\;\;\;\;\; (10)

Var(y‾−x‾)=Var(y‾)+Var(x‾)=σ2m+σ2n=σ2(1m+1n)(11) Var(\bar{y} - \bar{x}) = Var(\bar{y}) + Var(\bar{x}) = \frac{\sigma^2}{m} + \frac{\sigma^2}{n} = \sigma^2(\frac{1}{m} + \frac{1}{n}) \;\;\;\;\;\; (11)

so the quantity

t=y‾−x‾s1m+1n(12) t = \frac{\bar{y} - \bar{x}}{s\sqrt{\frac{1}{m} + \frac{1}{n}}} \;\;\;\;\;\; (12)

has a Student’s t-distribution with n−1n-1 degrees of freedom.

The Derivation of K for More than One Future Observation or Average (k >1)
When k>1k > 1, the function predIntNormK allows for two ways to compute KK: an exact method due to Dunnett (1955) (method="exact"), and an approximate (conservative) method based on the Bonferroni inequality (method="Bonferroni"; see Miller, 1981a, pp.8, 67-70; Gibbons et al., 2009, p.4). Each of these methods is explained below.

Exact Method Due to Dunnett (1955) (method="exact")
Dunnett (1955) derived the value of KK in the context of the multiple comparisons problem of comparing several treatment means to one control mean. The value of KK is computed as:

K=c1m+1n(13) K = c \sqrt{\frac{1}{m} + \frac{1}{n}} \;\;\;\;\;\; (13)

where cc is a constant that depends on the sample size nn, the number of future observations (averages) kk, the sample size associated with the kk future averages mm, and the confidence level (1−α)100%(1-\alpha)100\%.

When pi.type="lower" or pi.type="upper", the value of cc is the number that satisfies the following equation (Gupta and Sobel, 1957; Hahn, 1970a):

1−α=∫0∞F1(cs,k,ρ)h(sn−1,n−1)n−1ds(14) 1 - \alpha = \int_{0}^{\infty} F_1(cs, k, \rho) h(s\sqrt{n-1}, n-1) \sqrt{n-1} ds \;\;\;\;\;\; (14)

where

F1(x,k,ρ)=∫∞∞[Φ(x+ρ1/2y1−ρ)]kϕ(y)dy(15) F_1(x, k, \rho) = \int_{\infty}^{\infty} [\Phi(\frac{x + \rho^{1/2}y}{\sqrt{1 - \rho}})]^k \phi(y) dy \;\;\;\;\;\; (15)

ρ=1/(nm+1)(16) \rho = 1 / (\frac{n}{m} + 1) \;\;\;\;\;\; (16)

h(x,ν)=xν−1e−x2/22(ν/2)−1Γ(ν2)(17) h(x, \nu) = \frac{x^{\nu-1}e^{-x^2/2}}{2^{(\nu/2) - 1} \Gamma(\frac{\nu}{2})} \;\;\;\;\;\; (17)

and Φ()\Phi() and ϕ()\phi() denote the cumulative distribution function and probability density function, respectively, of the standard normal distribution. Note that the function h(x,ν)h(x, \nu) is the probability density function of a chi random variable with ν\nu degrees of freedom.

When pi.type="two-sided", the value of cc is the number that satisfies the following equation:

1−α=∫0∞F2(cs,k,ρ)h(sn−1,n−1)n−1ds(18) 1 - \alpha = \int_{0}^{\infty} F_2(cs, k, \rho) h(s\sqrt{n-1}, n-1) \sqrt{n-1} ds \;\;\;\;\;\; (18)

where

F2(x,k,ρ)=∫∞∞[Φ(x+ρ1/2y1−ρ)−Φ(−x+ρ1/2y1−ρ)]kϕ(y)dy(19) F_2(x, k, \rho) = \int_{\infty}^{\infty} [\Phi(\frac{x + \rho^{1/2}y}{\sqrt{1 - \rho}}) - \Phi(\frac{-x + \rho^{1/2}y}{\sqrt{1 - \rho}})]^k \phi(y) dy \;\;\;\;\;\; (19)

Approximate Method Based on the Bonferroni Inequality (method="Bonferroni")
As shown above, when k=1k=1, the value of KK is given by Equation (8) or Equation (9) for two-sided or one-sided prediction intervals, respectively. When k>1k > 1, a conservative way to construct a (1−α*)100%(1-\alpha^*)100\% prediction interval for the next kk observations or averages is to use a Bonferroni correction (Miller, 1981a, p.8) and set α=α*/k\alpha = \alpha^*/k in Equation (8) or (9) (Chew, 1968). This value of KK will be conservative in that the computed prediction intervals will be wider than the exact predictions intervals. Hahn (1969, 1970a) compared the exact values of KK with those based on the Bonferroni inequality for the case of m=1m=1 and found the approximation to be quite satisfactory except when nn is small, kk is large, and α\alpha is large. For example, Gibbons (1987a) notes that for a 99% prediction interval (i.e., α=0.01\alpha = 0.01) for the next kk observations, if n>4n > 4, the bias of KK is never greater than 1% no matter what the value of kk.

predIntNormSimultaneousK

Help topic: predIntNormSimultaneousK.

What is a Simultaneous Prediction Interval?
A prediction interval for some population is an interval on the real line constructed so that it will contain kk future observations from that population with some specified probability (1−α)100%(1-\alpha)100\%, where 0<α<10 < \alpha < 1 and kk is some pre-specified positive integer. The quantity (1−α)100%(1-\alpha)100\% is called the confidence coefficient or confidence level associated with the prediction interval. The function predIntNorm computes a standard prediction interval based on a sample from a normal distribution.

The function predIntNormSimultaneous computes a simultaneous prediction interval that will contain a certain number of future observations with probability (1−α)100%(1-\alpha)100\% for each of rr future sampling “occasions”, where rr is some pre-specified positive integer. The quantity rr may refer to rr distinct future sampling occasions in time, or it may for example refer to sampling at rr distinct locations on one future sampling occasion, assuming that the population standard deviation is the same at all of the rr distinct locations.

The function predIntNormSimultaneous computes a simultaneous prediction interval based on one of three possible rules:

  • For the kk-of-mm rule (rule="k.of.m"), at least kk of the next mm future observations will fall in the prediction interval with probability (1−α)100%(1-\alpha)100\% on each of the rr future sampling occasions. If obserations are being taken sequentially, for a particular sampling occasion, up to mm observations may be taken, but once kk of the observations fall within the prediction interval, sampling can stop. Note: When k=mk=m and r=1r=1, the results of predIntNormSimultaneous are equivalent to the results of predIntNorm.
  • For the California rule (rule="CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else all of the next m−1m-1 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, m−1m-1 more observations must be taken.
  • For the Modified California rule (rule="Modified.CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else at least 2 out of the next 3 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, up to 3 more observations must be taken.

Simultaneous prediction intervals can be extended to using averages (means) in place of single observations (USEPA, 2009, Chapter 19). That is, you can create a simultaneous prediction interval that will contain a specified number of averages (based on which rule you choose) on each of rr future sampling occassions, where each each average is based on ww individual observations. For the functions predIntNormSimultaneous and predIntNormSimultaneousK, the argument n.mean corresponds to ww.

The Form of a Prediction Interval for 1 Future Observation
Let x_=x1,x2,…,xn\underline{x} = x_1, x_2, \ldots, x_n denote a vector of nn observations from a normal distribution with parameters mean=μ\mu and sd=σ\sigma. Also, let ww denote the sample size associated with the future averages (i.e., n.mean=ww). When w=1w=1, each average is really just a single observation, so in the rest of this section the term “averages” will sometimes replace the phrase “observations or averages”.

For a normal distribution, the form of a two-sided (1−α)100%(1-\alpha)100\% simultaneous prediction interval is:

[x‾−Ks,x‾+Ks](1) [\bar{x} - Ks, \bar{x} + Ks] \;\;\;\;\;\; (1)

where x‾\bar{x} denotes the sample mean:

x‾=1n∑i=1nxi(2) \bar{x} = \frac{1}{n} \sum_{i=1}^n x_i \;\;\;\;\;\; (2)

ss denotes the sample standard deviation:

s2=1n−1∑i=1n(xi−x‾)2(3) s^2 = \frac{1}{n-1} \sum_{i=1}^n (x_i - \bar{x})^2 \;\;\;\;\;\; (3)

and KK denotes a constant that depends on the sample size nn, the confidence level, the number of future sampling occassions rr, and the sample size associated with the future averages, ww. Do not confuse the constant KK (uppercase K) with the number of future averages kk (lowercase k) in the kk-of-mm rule. The symbol KK is used here to be consistent with the notation used for tolerance intervals (see tolIntNorm).

Similarly, the form of a one-sided lower prediction interval is:

[x‾−Ks,∞](4) [\bar{x} - Ks, \infty] \;\;\;\;\;\; (4)

and the form of a one-sided upper prediction interval is:

[−∞,x‾+Ks](5) [-\infty, \bar{x} + Ks] \;\;\;\;\;\; (5)

The derivation of the constant KK for 1 future observation is explained in the section on predIntNormK.

The Form of a Simultaneous Prediction Interval
For simultaneous prediction intervals, only lower (pi.type="lower") and upper (pi.type="upper") prediction intervals are available. Two-sided simultaneous prediction intervals were available in Versions 2.4.0 - 2.8.1 of EnvStats, but these prediction intervals were based on an incorrect algorithm for KK.

Equations (4) and (5) above hold for simultaneous prediction intervals, but the derivation of the constant KK is more difficult, and is explained below.

The Derivation of K for Future Observations
First we will show the derivation based on future observations (i.e., w=1w=1, n.mean=1), and then extend the formulas to future averages.

The Derivation of K for the k-of-m Rule (rule="k.of.m")
For the kk-of-mm rule (rule="k.of.m") with w=1w=1 (i.e., n.mean=1), at least kk of the next mm future observations will fall in the prediction interval with probability (1−α)100%(1-\alpha)100\% on each of the rr future sampling occasions. If observations are being taken sequentially, for a particular sampling occasion, up to mm observations may be taken, but once kk of the observations fall within the prediction interval, sampling can stop. Note: When k=mk=m and r=1r=1, this kind of simultaneous prediction interval becomes the same as a standard prediction interval for the next kk observations (see predIntNorm).

For the case when r=1r=1 future sampling occasion, both Hall and Prairie (1973) and Fertig and Mann (1977) discuss the derivation of KK. Davis and McNichols (1987) extend the derivation to the case where rr is a positive integer. They show that for a one-sided upper prediction interval (pi.type="upper"), the probability pp that at least kk of the next mm future observations will be contained in the interval given in Equation (5) above, for each of rr future sampling occasions, is given by:

p=∫01T(nK;n−1,n[Φ−1(v)+Δσ])r[I(v;k,m+1−k)]r−1[vk−1(1−v)m−kB(k,m+1−k)]dv(6) p = \int_0^1 T(\sqrt{n}K; n-1, \sqrt{n}[\Phi^{-1}(v) + \frac{\Delta}{\sigma}]) r[I(v; k, m+1-k)]^{r-1} [\frac{v^{k-1}(1-v)^{m-k}}{B(k, m+1-k)}] dv \;\;\;\;\;\; (6)

where T(x;ν,δ)T(x; \nu, \delta) denotes the cdf of the non-central Student’s t-distribution with parameters df=ν\nu and ncp=δ\delta evaluated at xx; Φ(x)\Phi(x) denotes the cdf of the standard normal distribution evaluated at xx; I(x;ν,ω)I(x; \nu, \omega) denotes the cdf of the beta distribution with parameters shape1=ν\nu and shape2=ω\omega; and B(ν,ω)B(\nu, \omega) denotes the value of the beta function with parameters a=ν\nu and b=ω\omega.

The quantity Δ\Delta (upper case delta) denotes the difference between the mean of the population that was sampled to construct the prediction interval, and the mean of the population that will be sampled to produce the future observations. The quantity σ\sigma (sigma) denotes the population standard deviation of both of these populations. Usually you assume Δ=0\Delta=0 unless you are interested in computing the power of the rule to detect a change in means between the populations (see predIntNormSimultaneousTestPower).

For given values of the confidence level (pp), sample size (nn), minimum number of future observations to be contained in the interval per sampling occasion (kk), number of future observations per sampling occasion (mm), and number of future sampling occasions (rr), Equation (6) can be solved for KK. The function predIntNormSimultaneousK uses the R function nlminb to solve Equation (6) for KK.

When pi.type="lower", the same value of KK is used as when pi.type="upper", but Equation (4) is used to construct the prediction interval.

The Derivation of K for the California Rule (rule="CA")
For the California rule (rule="CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else all of the next m−1m-1 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, m−1m-1 more observations must be taken.

The formula for KK is the same as for the kk-of-mm rule, except that Equation (6) becomes the following (Davis, 1998b):

p=∫01T(nK;n−1,n[Φ−1(v)+Δσ])r{v[1+vm−2(1−v)]}r−1[1+vm−2(m−1−mv)]dv(7) p = \int_0^1 T(\sqrt{n}K; n-1, \sqrt{n}[\Phi^{-1}(v) + \frac{\Delta}{\sigma}]) r\{v[1+v^{m-2}(1-v)]\}^{r-1} [1+v^{m-2}(m-1-mv)] dv \;\;\;\;\;\; (7)

The Derivation of K for the Modified California Rule (rule="Modified.CA")
For the Modified California rule (rule="Modified.CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else at least 2 out of the next 3 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, up to 3 more observations must be taken.

The formula for KK is the same as for the kk-of-mm rule, except that Equation (6) becomes the following (Davis, 1998b):

p=∫01T(nK;n−1,n[Φ−1(v)+Δσ])r{v[1+v(3−v[5−2v])]}r−1{1+v[6−v(15−8v)]}dv(8) p = \int_0^1 T(\sqrt{n}K; n-1, \sqrt{n}[\Phi^{-1}(v) + \frac{\Delta}{\sigma}]) r\{v[1+v(3-v[5-2v])]\}^{r-1} \{1+v[6-v(15-8v)]\} dv \;\;\;\;\;\; (8)

The Derivation of K for Future Means
For each of the above rules, if we are interested in using averages instead of single observations, with w≥1w \ge 1 (i.e., n.mean≥1\ge 1), the first term in the integral in Equations (6)-(8) that involves the cdf of the non-central Student’s t-distribution becomes:

T(nK;n−1,nw[Φ−1(v)+wΔσ])(9) T(\sqrt{n}K; n-1, \frac{\sqrt{n}}{\sqrt{w}}[\Phi^{-1}(v) + \frac{\sqrt{w}\Delta}{\sigma}]) \;\;\;\;\;\; (9)

predIntNormSimultaneousTestPower

Help topic: predIntNormSimultaneousTestPower.

What is a Simultaneous Prediction Interval?
A prediction interval for some population is an interval on the real line constructed so that it will contain kk future observations from that population with some specified probability (1−α)100%(1-\alpha)100\%, where 0<α<10 < \alpha < 1 and kk is some pre-specified positive integer. The quantity (1−α)100%(1-\alpha)100\% is called the confidence coefficient or confidence level associated with the prediction interval. The function predIntNorm computes a standard prediction interval based on a sample from a normal distribution.

The function predIntNormSimultaneous computes a simultaneous prediction interval that will contain a certain number of future observations with probability (1−α)100%(1-\alpha)100\% for each of rr future sampling “occasions”, where rr is some pre-specified positive integer. The quantity rr may refer to rr distinct future sampling occasions in time, or it may for example refer to sampling at rr distinct locations on one future sampling occasion, assuming that the population standard deviation is the same at all of the rr distinct locations.

The function predIntNormSimultaneous computes a simultaneous prediction interval based on one of three possible rules:

  • For the kk-of-mm rule (rule="k.of.m"), at least kk of the next mm future observations will fall in the prediction interval with probability (1−α)100%(1-\alpha)100\% on each of the rr future sampling occasions. If obserations are being taken sequentially, for a particular sampling occasion, up to mm observations may be taken, but once kk of the observations fall within the prediction interval, sampling can stop. Note: When k=mk=m and r=1r=1, the results of predIntNormSimultaneous are equivalent to the results of predIntNorm.
  • For the California rule (rule="CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else all of the next m−1m-1 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, m−1m-1 more observations must be taken.
  • For the Modified California rule (rule="Modified.CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else at least 2 out of the next 3 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, up to 3 more observations must be taken.

Simultaneous prediction intervals can be extended to using averages (means) in place of single observations (USEPA, 2009, Chapter 19). That is, you can create a simultaneous prediction interval that will contain a specified number of averages (based on which rule you choose) on each of rr future sampling occassions, where each each average is based on ww individual observations. For the function predIntNormSimultaneous, the argument n.mean corresponds to ww.

The Form of a Prediction Interval
Let x_=x1,x2,…,xn\underline{x} = x_1, x_2, \ldots, x_n denote a vector of nn observations from a normal distribution with parameters mean=μ\mu and sd=σ\sigma. Also, let ww denote the sample size associated with the future averages (i.e., n.mean=ww). When w=1w=1, each average is really just a single observation, so in the rest of this section the term “averages” will replace the phrase “observations or averages”.

For a normal distribution, the form of a two-sided (1−α)100%(1-\alpha)100\% prediction interval is:

[x‾−Ks,x‾+Ks](1) [\bar{x} - Ks, \bar{x} + Ks] \;\;\;\;\;\; (1)

where x‾\bar{x} denotes the sample mean:

x‾=1n∑i=1nxi(2) \bar{x} = \frac{1}{n} \sum_{i=1}^n x_i \;\;\;\;\;\; (2)

ss denotes the sample standard deviation:

s2=1n−1∑i=1n(xi−x‾)2(3) s^2 = \frac{1}{n-1} \sum_{i=1}^n (x_i - \bar{x})^2 \;\;\;\;\;\; (3)

and KK denotes a constant that depends on the sample size nn, the confidence level, the number of future sampling occassions rr, and the sample size associated with the future averages, ww. Do not confuse the constant KK (uppercase K) with the number of future averages kk (lowercase k) in the kk-of-mm rule. The symbol KK is used here to be consistent with the notation used for tolerance intervals (see tolIntNorm).

Similarly, the form of a one-sided lower prediction interval is:

[x‾−Ks,∞](4) [\bar{x} - Ks, \infty] \;\;\;\;\;\; (4)

and the form of a one-sided upper prediction interval is:

[−∞,x‾+Ks](5) [-\infty, \bar{x} + Ks] \;\;\;\;\;\; (5)

Note: For simultaneous prediction intervals, only lower (pi.type="lower") and upper
(pi.type="upper") prediction intervals are available.

The derivation of the constant KK is explained in the section on predIntNormSimultaneousK.

Computing Power
The “power” of the prediction interval is defined as the probability that at least one set of future observations violates the given rule based on a simultaneous prediction interval for the next rr future sampling occasions, where the population mean for the future observations is allowed to differ from the population mean for the observations used to construct the prediction interval.

The quantity Δ\Delta (upper case delta) denotes the difference between the mean of the population that was sampled to construct the prediction interval, and the mean of the population that will be sampled to produce the future observations. The quantity σ\sigma (sigma) denotes the population standard deviation of both of these populations. The argument delta.over.sigma corresponds to the quantity Δ/σ\Delta/\sigma.

Power Based on the k-of-m Rule (rule="k.of.m")
For the kk-of-mm rule (rule="k.of.m") with w=1w=1 (i.e., n.mean=1), at least kk of the next mm future observations will fall in the prediction interval with probability (1−α)100%(1-\alpha)100\% on each of the rr future sampling occasions. If observations are being taken sequentially, for a particular sampling occasion, up to mm observations may be taken, but once kk of the observations fall within the prediction interval, sampling can stop. Note: When k=mk=m and r=1r=1, this kind of simultaneous prediction interval becomes the same as a standard prediction interval for the next kk observations (see predIntNorm).

Davis and McNichols (1987) show that for a one-sided upper prediction interval (pi.type="upper"), the probability pp that at least kk of the next mm future observations will be contained in the interval given in Equation (5) above, for each of rr future sampling occasions, is given by:

p=∫01T(nK;n−1,n[Φ−1(v)+Δσ])r[I(v;k,m+1−k)]r−1[vk−1(1−v)m−kB(k,m+1−k)]dv(6) p = \int_0^1 T(\sqrt{n}K; n-1, \sqrt{n}[\Phi^{-1}(v) + \frac{\Delta}{\sigma}]) r[I(v; k, m+1-k)]^{r-1} [\frac{v^{k-1}(1-v)^{m-k}}{B(k, m+1-k)}] dv \;\;\;\;\;\; (6)

where T(x;ν,δ)T(x; \nu, \delta) denotes the cdf of the non-central Student’s t-distribution with parameters df=ν\nu and ncp=δ\delta evaluated at xx; Φ(x)\Phi(x) denotes the cdf of the standard normal distribution evaluated at xx; I(x;ν,ω)I(x; \nu, \omega) denotes the cdf of the beta distribution with parameters shape1=ν\nu and shape2=ω\omega; and B(ν,ω)B(\nu, \omega) denotes the value of the beta function with parameters a=ν\nu and b=ω\omega.

The quantity Δ\Delta (upper case delta) denotes the difference between the mean of the population that was sampled to construct the prediction interval, and the mean of the population that will be sampled to produce the future observations. The quantity σ\sigma (sigma) denotes the population standard deviation of both of these populations. Usually you assume Δ=0\Delta=0 unless you are interested in computing the power of the rule to detect a change in means between the populations, as we are here.

If we are interested in using averages instead of single observations, with w≥1w \ge 1 (i.e., n.mean≥1\ge 1), the first term in the integral in Equation (6) that involves the cdf of the non-central Student’s t-distribution becomes:

T(nK;n−1,nw[Φ−1(v)+wΔσ])(7) T(\sqrt{n}K; n-1, \frac{\sqrt{n}}{\sqrt{w}}[\Phi^{-1}(v) + \frac{\sqrt{w}\Delta}{\sigma}]) \;\;\;\;\;\; (7)

For a given confidence level (1−α)100%(1-\alpha)100\%, the power of the rule to detect a change in means is simply given by:

Power=1−p(8) Power = 1 - p \;\;\;\;\;\; (8)

where pp is defined in Equation (6) above using the value of KK that corresponds to Δ/σ=0\Delta/\sigma = 0. Thus, when the argument delta.over.sigma=0, the value of pp is 1−α1-\alpha and the power is simply α100%\alpha 100\%. As delta.over.sigma increases above 0, the power increases.

When pi.type="lower", the same value of K is used as when pi.type="upper", but Equation (4) is used to construct the prediction interval. Thus, the power increases as delta.over.sigma decreases below 0.

Power Based on the California Rule (rule="CA")
For the California rule (rule="CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else all of the next m−1m-1 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, m−1m-1 more observations must be taken.

The derivation of the power is the same as for the kk-of-mm rule, except that Equation (6) becomes the following (Davis, 1998b):

p=∫01T(nK;n−1,n[Φ−1(v)+Δσ])r{v[1+vm−2(1−v)]}r−1[1+vm−2(m−1−mv)]dv(9) p = \int_0^1 T(\sqrt{n}K; n-1, \sqrt{n}[\Phi^{-1}(v) + \frac{\Delta}{\sigma}]) r\{v[1+v^{m-2}(1-v)]\}^{r-1} [1+v^{m-2}(m-1-mv)] dv \;\;\;\;\;\; (9)

Power Based on the Modified California Rule (rule="Modified.CA")
For the Modified California rule (rule="Modified.CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else at least 2 out of the next 3 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, up to 3 more observations must be taken.

The derivation of the power is the same as for the kk-of-mm rule, except that Equation (6) becomes the following (Davis, 1998b):

p=∫01T(nK;n−1,n[Φ−1(v)+Δσ])r{v[1+v(3−v[5−2v])]}r−1{1+v[6−v(15−8v)]}dv(10) p = \int_0^1 T(\sqrt{n}K; n-1, \sqrt{n}[\Phi^{-1}(v) + \frac{\Delta}{\sigma}]) r\{v[1+v(3-v[5-2v])]\}^{r-1} \{1+v[6-v(15-8v)]\} dv \;\;\;\;\;\; (10)

predIntNparSimultaneous

Help topic: predIntNparSimultaneous.

What is a Nonparametric Simultaneous Prediction Interval?
A nonparametric prediction interval for some population is an interval on the real line constructed so that it will contain at least kk of mm future observations from that population with some specified probability (1−α)100%(1-\alpha)100\%, where 0<α<10 < \alpha < 1 and kk and mm are some pre-specified positive integers and k≤mk \le m. The quantity (1−α)100%(1-\alpha)100\% is called the confidence coefficient or confidence level associated with the prediction interval. The function predIntNpar computes a standard nonparametric prediction interval.

The function predIntNparSimultaneous computes a nonparametric simultaneous prediction interval that will contain a certain number of future observations with probability (1−α)100%(1-\alpha)100\% for each of rr future sampling “occasions”, where rr is some pre-specified positive integer. The quantity rr may refer to rr distinct future sampling occasions in time, or it may for example refer to sampling at rr distinct locations on one future sampling occasion, assuming that the population standard deviation is the same at all of the rr distinct locations.

The function predIntNparSimultaneous computes a nonparametric simultaneous prediction interval based on one of three possible rules:

  • For the kk-of-mm rule (rule="k.of.m"), at least kk of the next mm future observations will fall in the prediction interval with probability (1−α)100%(1-\alpha)100\% on each of the rr future sampling occasions. If obserations are being taken sequentially, for a particular sampling occasion, up to mm observations may be taken, but once kk of the observations fall within the prediction interval, sampling can stop. Note: For this rule, when r=1r=1, the results of predIntNparSimultaneous are equivalent to the results of predIntNpar.
  • For the California rule (rule="CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else all of the next m−1m-1 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, m−1m-1 more observations must be taken.
  • For the Modified California rule (rule="Modified.CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else at least 2 out of the next 3 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, up to 3 more observations must be taken.

Nonparametric simultaneous prediction intervals can be extended to using medians in place of single observations (USEPA, 2009, Chapter 19). That is, you can create a nonparametric simultaneous prediction interval that will contain a specified number of medians (based on which rule you choose) on each of rr future sampling occassions, where each each median is based on bb individual observations. For the function predIntNparSimultaneous, the argument n.median corresponds to bb.

The Form of a Nonparametric Prediction Interval
Let x_=x1,x2,…,xn\underline{x} = x_1, x_2, \ldots, x_n denote a vector of nn independent observations from some continuous distribution, and let x(i)x_{(i)} denote the the ii’th order statistics in x_\underline{x}. A two-sided nonparametric prediction interval is constructed as:

[x(u),x(v)](1) [x_{(u)}, x_{(v)}] \;\;\;\;\;\; (1)

where uu and vv are positive integers between 1 and nn, and u<vu < v. That is, uu denotes the rank of the lower prediction limit, and vv denotes the rank of the upper prediction limit. To make it easier to write some equations later on, we can also write the prediction interval (1) in a slightly different way as:

[x(u),x(n+1−w)](2) [x_{(u)}, x_{(n + 1 - w)}] \;\;\;\;\;\; (2)

where

w=n+1−v(3) w = n + 1 - v \;\;\;\;\;\; (3)

so that ww is a positive integer between 1 and n−1n-1, and u<n+1−wu < n+1-w. In terms of the arguments to the function predIntNparSimultaneous, the argument lpl.rank corresponds to uu, and the argument n.plus.one.minus.upl.rank corresponds to ww.

If we allow u=0u=0 and w=0w=0 and define lower and upper bounds as:

x(0)=lb(4) x_{(0)} = lb \;\;\;\;\;\; (4)

x(n+1)=ub(5) x_{(n+1)} = ub \;\;\;\;\;\; (5)

then Equation (2) above can also represent a one-sided lower or one-sided upper prediction interval as well. That is, a one-sided lower nonparametric prediction interval is constructed as:

[x(u),x(n+1)]=[x(u),ub](6) [x_{(u)}, x_{(n + 1)}] = [x_{(u)}, ub] \;\;\;\;\;\; (6)

and a one-sided upper nonparametric prediction interval is constructed as:

[x(0),x(n+1−w)]=[lb,x(n+1−w)](7) [x_{(0)}, x_{(n + 1 - w)}] = [lb, x_{(n + 1 - w)}] \;\;\;\;\;\; (7)

Usually, lb=−∞lb = -\infty or lb=0lb = 0 and ub=∞ub = \infty.

Note: For nonparametric simultaneous prediction intervals, only lower (pi.type="lower") and upper (pi.type="upper") prediction intervals are available.

Constructing Nonparametric Simultaneous Prediction Intervals for Future Observations
First we will show how to construct a nonparametric simultaneous prediction interval based on future observations (i.e., b=1b=1, n.median=1), and then extend the formulas to future medians.

Simultaneous Prediction Intervals for the k-of-m Rule (rule="k.of.m")
For the kk-of-mm rule (rule="k.of.m") with w=1w=1 (i.e., n.median=1), at least kk of the next mm future observations will fall in the prediction interval with probability (1−α)100%(1-\alpha)100\% on each of the rr future sampling occasions. If observations are being taken sequentially, for a particular sampling occasion, up to mm observations may be taken, but once kk of the observations fall within the prediction interval, sampling can stop. Note: When r=1r=1, this kind of simultaneous prediction interval becomes the same as a standard nonparametric prediction interval (see predIntNpar).

Chou and Owen (1986) developed the theory for nonparametric simultaneous prediction limits for various rules, including the 1-of-mm rule. Their theory, however, does not cover the California or Modified California rules, and uses an rr-fold summation involving a minimum of 2r2^r terms. Davis and McNichols (1994b; 1999) extended the results of Chou and Owen (1986) to include the California and Modified California rule, and developed algorithms that involve summing far fewer terms.

Davis and McNichols (1999) give formulas for the probabilities associated with the one-sided upper simultaneous prediction interval shown in Equation (7). For the kk-of-mm rule, the probability that at least kk of the next mm future observations will be contained in the interval given in Equation (7) for each of rr future sampling occasions is given by:

1−α1 - \alpha == E[∑i=0m−k(k−1+ik−1)Yk(1−Y)i]rE[\sum_{i=0}^{m-k} {{k-1+i} \choose{k-1}} Y^k (1-Y)^i]^r
  == ∫01[∑i=0m−k(k−1+ik−1)yk(1−y)i]rf(y)dy(8)\int_0^1 [\sum_{i=0}^{m-k} {{k-1+i} \choose{k-1}} y^k (1-y)^i]^r f(y) dy \;\;\;\;\;\; (8)

where YY denotes a random variable with a beta distribution with parameters vv and n+1−vn+1-v, and f()f() denotes the pdf of this distribution. Note that vv denotes the rank of the order statistic used as the upper prediction limit (i.e., n.plus.one.minus.upl.rank=n+1−vn+1-v), and that vv is usually equal to nn.

Also note that the summation term in Equation (8) corresponds to the cumulative distribution function of a Negative Binomial distribution with parameters size=kk and prob=yy evaluated at q=m−km-k.

When pi.type="lower", YY denotes a random variable with a beta distribution with parameters n+1−un+1-u and uu. Note that uu denotes the rank of the order statistic used as the lower prediction limit (i.e., lpl.rank=uu), and that uu is usually equal to 11.

Simultaneous Prediction Intervals for the California Rule (rule="CA")
For the California rule (rule="CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else all of the next m−1m-1 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, m−1m-1 more observations must be taken.

In this case, the probability is given by:

1−α1 - \alpha == E[∑i=0r(ri)Yr−i+(m−1)i(1−Y)i]E[\sum_{i=0}^r {r \choose i} Y^{r - i + (m-1)i} (1-Y)^i]
  == ∫01[∑i=0r(ri)yr−i+(m−1)i(1−y)i]f(y)dy(9)\int_0^1 [\sum_{i=0}^r {r \choose i} y^{r - i + (m-1)i} (1-y)^i] f(y) dy \;\;\;\;\;\; (9)

Simultaneous Prediction Intervals for the Modified California Rule (rule="Modified.CA")
For the Modified California rule (rule="Modified.CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else at least 2 out of the next 3 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, up to 3 more observations must be taken.

In this case, the probability is given by:

1−α1 - \alpha == E[Yr(1+Q+Q2−2Q3)r]E[Y^r (1 + Q + Q^2 - 2Q^3)^r]
  == ∫01[yr(1+q+q2−2q3)r]f(y)dy(10)\int_0^1 [y^r (1 + q + q^2 - 2q^3)^r] f(y) dy \;\;\;\;\;\; (10)

where Q=1−YQ = 1 - Y and q=1−yq = 1 - y.

Davis and McNichols (1999) provide algorithms for computing the probabilities based on expanding polynomials and the formula for the expected value of a beta random variable. In the discussion section of Davis and McNichols (1999), however, Vangel points out that numerical integration is adequate, and this is how these probabilities are computed in the function predIntNparSimultaneous.

Constructing Nonparametric Simultaneous Prediction Intervals for Future Medians
USEPA (2009, Chapter 19; Cameron, 2011) extends nonparametric simultaneous prediction intervals to testing future medians for the case of the 1-of-1 and 1-of-2 plans for medians of order 3. In general, each of the rules (kk-of-mm, California, and Modified California) can be easily extended to the case of using medians as long as the medians are based on an odd (as opposed to even) sample size.

For each of the above rules, if we are interested in using medians instead of single observations (i.e., b≥1b \ge 1; n.median≥1\ge 1), and we force bb to be odd, then a median will be less than a prediction limit once (b+1)/2(b+1)/2 observations are less than the prediction limit. Thus, Equations (8) - (10) are modified by replacing yy with the term:

∑i=0b−b′(b′−1+ib′−1)yb′(1−y)i(11) \sum_{i=0}^{b - b'} {{b' - 1 + i} \choose{b' - 1}} y^{b'} (1 - y)^i \;\;\;\;\;\; (11)

where

b′=b+12(12) b' = \frac{b+1}{2} \;\;\;\;\;\; (12)

predIntNparSimultaneousTestPower

Help topic: predIntNparSimultaneousTestPower.

What is a Nonparametric Simultaneous Prediction Interval?
A nonparametric prediction interval for some population is an interval on the real line constructed so that it will contain at least kk of mm future observations from that population with some specified probability (1−α)100%(1-\alpha)100\%, where 0<α<10 < \alpha < 1 and kk and mm are some pre-specified positive integers and k≤mk \le m. The quantity (1−α)100%(1-\alpha)100\% is called the confidence coefficient or confidence level associated with the prediction interval. The function predIntNpar computes a standard nonparametric prediction interval.

The function predIntNparSimultaneous computes a nonparametric simultaneous prediction interval that will contain a certain number of future observations with probability (1−α)100%(1-\alpha)100\% for each of rr future sampling “occasions”, where rr is some pre-specified positive integer. The quantity rr may refer to rr distinct future sampling occasions in time, or it may for example refer to sampling at rr distinct locations on one future sampling occasion, assuming that the population standard deviation is the same at all of the rr distinct locations.

The function predIntNparSimultaneous computes a nonparametric simultaneous prediction interval based on one of three possible rules:

  • For the kk-of-mm rule (rule="k.of.m"), at least kk of the next mm future observations will fall in the prediction interval with probability (1−α)100%(1-\alpha)100\% on each of the rr future sampling occasions. If obserations are being taken sequentially, for a particular sampling occasion, up to mm observations may be taken, but once kk of the observations fall within the prediction interval, sampling can stop. Note: For this rule, when r=1r=1, the results of predIntNparSimultaneous are equivalent to the results of predIntNpar.
  • For the California rule (rule="CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else all of the next m−1m-1 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, m−1m-1 more observations must be taken.
  • For the Modified California rule (rule="Modified.CA"), with probability (1−α)100%(1-\alpha)100\%, for each of the rr future sampling occasions, either the first observation will fall in the prediction interval, or else at least 2 out of the next 3 observations will fall in the prediction interval. That is, if the first observation falls in the prediction interval then sampling can stop. Otherwise, up to 3 more observations must be taken.

Nonparametric simultaneous prediction intervals can be extended to using medians in place of single observations (USEPA, 2009, Chapter 19). That is, you can create a nonparametric simultaneous prediction interval that will contain a specified number of medians (based on which rule you choose) on each of rr future sampling occassions, where each each median is based on bb individual observations. For the function predIntNparSimultaneous, the argument n.median corresponds to bb.

The Form of a Nonparametric Prediction Interval
Let x_=x1,x2,…,xn\underline{x} = x_1, x_2, \ldots, x_n denote a vector of nn independent observations from some continuous distribution, and let x(i)x_{(i)} denote the the ii’th order statistics in x_\underline{x}. A two-sided nonparametric prediction interval is constructed as:

[x(u),x(v)](1) [x_{(u)}, x_{(v)}] \;\;\;\;\;\; (1)

where uu and vv are positive integers between 1 and nn, and u<vu < v. That is, uu denotes the rank of the lower prediction limit, and vv denotes the rank of the upper prediction limit. To make it easier to write some equations later on, we can also write the prediction interval (1) in a slightly different way as:

[x(u),x(n+1−w)](2) [x_{(u)}, x_{(n + 1 - w)}] \;\;\;\;\;\; (2)

where

w=n+1−v(3) w = n + 1 - v \;\;\;\;\;\; (3)

so that ww is a positive integer between 1 and n−1n-1, and u<n+1−wu < n+1-w. In terms of the arguments to the function predIntNparSimultaneous, the argument lpl.rank corresponds to uu, and the argument n.plus.one.minus.upl.rank corresponds to ww.

If we allow u=0u=0 and w=0w=0 and define lower and upper bounds as:

x(0)=lb(4) x_{(0)} = lb \;\;\;\;\;\; (4)

x(n+1)=ub(5) x_{(n+1)} = ub \;\;\;\;\;\; (5)

then Equation (2) above can also represent a one-sided lower or one-sided upper prediction interval as well. That is, a one-sided lower nonparametric prediction interval is constructed as:

[x(u),x(n+1)]=[x(u),ub](6) [x_{(u)}, x_{(n + 1)}] = [x_{(u)}, ub] \;\;\;\;\;\; (6)

and a one-sided upper nonparametric prediction interval is constructed as:

[x(0),x(n+1−w)]=[lb,x(n+1−w)](7) [x_{(0)}, x_{(n + 1 - w)}] = [lb, x_{(n + 1 - w)}] \;\;\;\;\;\; (7)

Usually, lb=−∞lb = -\infty or lb=0lb = 0 and ub=∞ub = \infty.

Note: For nonparametric simultaneous prediction intervals, only lower (pi.type="lower") and upper (pi.type="upper") prediction intervals are available.

Computing Power
The “power” of the prediction interval is defined as the probability that at least one set of future observations violates the given rule based on a simultaneous prediction interval for the next rr future sampling occasions, where the population for the future observations is allowed to differ from the population for the observations used to construct the prediction interval.

For the function predIntNparSimultaneousTestPower, power is computed assuming both the background and future the observations come from normal distributions with the same standard deviation, but the means of the distributions are allowed to differ. The quantity Δ\Delta (upper case delta) denotes the difference between the mean of the population that was sampled to construct the prediction interval, and the mean of the population that will be sampled to produce the future observations. The quantity σ\sigma (sigma) denotes the population standard deviation of both of these populations. The argument delta.over.sigma corresponds to the quantity Δ/σ\Delta/\sigma.

Approximate Power (method="approx")
Based on Gansecki (2009), the power of a nonparametric simultaneous prediction interval when the underlying observations come from a nomral distribution can be approximated by the power of a normal simultaneous prediction interval (see predIntNormSimultaneousTestPower) where the multiplier KK is replaced with the expected value of the normal order statistic that corresponds to the rank of the order statistic used for the upper or lower bound of the prediction interval. Gansecki (2009) uses the approximation:

K=Φ−1(i−0.5n)(8) K = \Phi^{-1}(\frac{i - 0.5}{n}) \;\;\;\;\;\; (8)

where Φ\Phi denotes the cumulative distribution function of the standard normal distribution and ii denotes the rank of the order statistic used as the prediction limit. By default, the value of the argument
evNormOrdStats.method="royston", so the function predIntNparSimultaneousTestPower uses the exact value of the expected value of the normal order statistic in the call to evNormOrdStatsScalar. You can change the method of computing the expected value of the normal order statistic by changing the value of the argument evNormOrdStats.method.

Power Based on Monte Carlo Simulation (method="simulate")
When method="simulate", the power of the nonparametric simultaneous prediction interval is estimated based on a Monte Carlo simulation. The argument NMC determines the number of Monte Carlo trials. If ci=TRUE, a confidence interval for the power is created based on the NMC Monte Carlo estimates of power.

predIntPois

Help topic: predIntPois.

A prediction interval for some population is an interval on the real line constructed so that it will contain kk future observations or averages from that population with some specified probability (1−α)100%(1-\alpha)100\%, where 0 < α\alpha < 1 and kk is some pre-specified positive integer. The quantity (1−α)100%(1-\alpha)100\% is call the confidence coefficient or confidence level associated with the prediction interval.

In the case of a Poisson distribution, we have modified the usual meaning of a prediction interval and instead construct an interval that will contain kk future observations or kk future sums with a certain confidence level.

A prediction interval is a random interval; that is, the lower and/or upper bounds are random variables computed based on sample statistics in the baseline sample. Prior to taking one specific baseline sample, the probability that the prediction interval will contain the next kk averages is (1−α)100%(1-\alpha)100\%. Once a specific baseline sample is taken and the prediction interval based on that sample is computed, the probability that that prediction interval will contain the next kk averages is not necessarily (1−a)100%(1-a)100\%, but it should be close.

If an experiment is repeated NN times, and for each experiment:

  1. A sample is taken and a (1−a)100%(1-a)100\% prediction interval for k=1k=1 future observation is computed, and
  2. One future observation is generated and compared to the prediction interval,

then the number of prediction intervals that actually contain the future observation generated in step 2 above is a binomial random variable with parameters size=NN and prob=(1−α)100%(1-\alpha)100\% (see Binomial).

If, on the other hand, only one baseline sample is taken and only one prediction interval for k=1k=1 future observation is computed, then the number of future observations out of a total of NN future observations that will be contained in that one prediction interval is a binomial random variable with parameters size=NN and prob=(1−α*)100%(1-\alpha^*)100\%, where α*\alpha^* depends on the true population parameters and the computed bounds of the prediction interval.

Because of the discrete nature of the Poisson distribution, even if the true mean of the distribution λ\lambda were known exactly, the actual confidence level associated with a prediction limit will usually not be exactly equal to (1−α)100%(1-\alpha)100\%. For example, for the Poisson distribution with parameter lambda=2, the interval 0,40, 4 contains 94.7% of this distribution and the interval 0,50,5 contains 98.3% of this distribution. Thus, no interval can contain exactly 95% of this distribution, so it is impossible to construct an exact 95% prediction interval for the next k=1k=1 observation for a Poisson distribution with parameter lambda=2.

The Form of a Poisson Prediction Interval
Let x_=x1,x2,…,xn\underline{x} = x_1, x_2, \ldots, x_n denote a vector of nn observations from a Poisson distribution with parameter lambda=λ\lambda. Also, let XX denote the sum of these nn random variables, i.e.,

X=∑i=1nxi(1) X = \sum_{i=1}^n x_i \;\;\;\;\;\; (1)

Finally, let mm denote the sample size associated with the kk future sums (i.e., n.sum=mm). When m=1m=1, each sum is really just a single observation, so in the rest of this section the term “sums” replaces the phrase “observations or sums”.

Let y_=y1,y2,…,ym\underline{y} = y_1, y_2, \ldots, y_m denote a vector of mm future observations from a Poisson distribution with parameter lambda=λ*\lambda^{*}, and set YY equal to the sum of these mm random variables, i.e.,

Y=∑i=1myi(2) Y = \sum_{i=1}^m y_i \;\;\;\;\;\; (2)

Then YY has a Poisson distribution with parameter lambda=mλ*m\lambda^{*} (Johnson et al., 1992, p.160). We are interested in constructing a prediction limit for the next value of YY, or else the next kk sums of mm Poisson random variables, based on the observed value of XX and assuming λ*=λ\lambda^{*} = \lambda.

For a Poisson distribution, the form of a two-sided prediction interval is:

[mx‾−K,mx‾+K]=[cX−K,cX+K](3) [m\bar{x} - K, m\bar{x} + K] = [cX - K, cX + K] \;\;\;\;\;\; (3)

where

x‾=Xn=∑i=1nxi(4) \bar{x} = \frac{X}{n} = \sum_{i=1}^n x_i \;\;\;\;\;\; (4)

c=mn(5) c = \frac{m}{n} \;\;\;\;\;\; (5)

and KK is a constant that depends on the sample size nn, the confidence level (1−α)100%(1-\alpha)100\%, the number of future sums kk, and the sample size associated with the future sums mm. Do not confuse the constant KK (uppercase KK) with the number of future sums kk (lowercase kk). The symbol KK is used here to be consistent with the notation used for prediction intervals for the normal distribution (see predIntNorm).

Similarly, the form of a one-sided lower prediction interval is:

[mx‾−K,∞]=[cX−K,∞](6) [m\bar{x} - K, \infty] = [cX - K, \infty] \;\;\;\;\;\; (6)

and the form of a one-sided upper prediction interval is:

[0,mx‾+K]=[0,cX+K](7) [0, m\bar{x} + K] = [0, cX + K] \;\;\;\;\;\; (7)

The derivation of the constant KK is explained below.

Conditional Distribution (method="conditional")
Nelson (1970) derives a prediction interval for the case k=1k=1 based on the conditional distribution of YY given X+YX+Y. He notes that the conditional distribution of YY given the quantity X+Y=wX+Y=w is binomial with parameters size=ww and prob=[mλ*/(mλ*+nλ)][m\lambda^{*} / (m\lambda^{*} + n\lambda)] (Johnson et al., 1992, p.161). When k=1k=1, the prediction limits are computed as those most extreme values of YY that still yield a non-significant test of the hypothesis H0:λ*=λH_0: \lambda^{*} = \lambda, which for the conditional distribution of YY is equivalent to the hypothesis H0H_0: prob=[m /(m + n)].

Using the relationship between the binomial and F-distribution (see the explanation of exact confidence intervals in the help file for ebinom), Nelson (1982, p. 203) states that exact two-sided (1−α)100%(1-\alpha)100\% prediction limits LPL,UPLLPL, UPL are the closest integer solutions to the following equations:

mLPL+1=nXF(2LPL+2,2X,1−α/2)(8) \frac{m}{LPL + 1} = \frac{n}{X} F(2 LPL + 2, 2X, 1 - \alpha/2) \;\;\;\;\;\; (8)

UPLn=X+1nF(2X+2,2UPL,1−α/2)(9) \frac{UPL}{n} = \frac{X+1}{n} F(2X + 2, 2 UPL, 1 - \alpha/2) \;\;\;\;\;\; (9)

where F(ν1,ν2,p)F(\nu_1, \nu_2, p) denotes the pp’th quantile of the F-distribution with ν1\nu_1 and ν2\nu_2 degrees of freedom.

If ci.type="lower", α/2\alpha/2 is replaced with α\alpha in Equation (8) above for LPLLPL, and UPLUPL is set to ∞\infty.

If ci.type="upper", α/2\alpha/2 is replaced with α\alpha in Equation (9) above for UPLUPL, and LPLLPL is set to 0.

NOTE: This method is not extended to the case k>1k > 1.

Conditional Distribution Approximation Based on Normal Distribution
(method="conditional.approx.normal")
Cox and Hinkley (1974, p.245) derive an approximate prediction interval for the case k=1k=1. Like Nelson (1970), they note that the conditional distribution of YY given the quantity X+Y=wX+Y=w is binomial with parameters size=ww and prob=[mλ*/(mλ*+nλ)][m\lambda^{*} / (m\lambda^{*} + n\lambda)], and that the hypothesis H0:λ*=λH_0: \lambda^{*} = \lambda is equivalent to the hypothesis H0H_0: prob=[m /(m + n)].

Cox and Hinkley (1974, p.245) suggest using the normal approximation to the binomial distribution (in this case, without the continuity correction; see Zar, 2010, pp.534-536 for information on the continuity correction associated with the normal approximation to the binomial distribution). Under the null hypothesis H0:λ*=λH_0: \lambda^{*} = \lambda, the quantity

z=[Y−c(X+Y)1+c]/{[c(X+Y)(1+c)2]1/2}(10) z = [Y - \frac{c(X+Y)}{1+c}] / \{ [\frac{c(X+Y)}{(1+c)^2}]^{1/2} \} \;\;\;\;\;\; (10)

is approximately distributed as a standard normal random variable.

The Case When k = 1
When k=1k = 1 and pi.type="two-sided", the prediction limits are computed by solving the equation

z2≤z1−α/22(11) z^2 \le z_{1 - \alpha/2}^2 \;\;\;\;\;\; (11)

where zpz_p denotes the pp’th quantile of the standard normal distribution. In this case, Gibbons (1987b) notes that the quantity KK in Equation (3) above is given by:

K=t2c2tc[X(1+1c)+t24]1/2(12) K = \frac{t^2c}{2} tc[X (1 + \frac{1}{c}) + \frac{t^2}{4}]^{1/2} \;\;\;\;\;\; (12)

where t=z1−α/2t = z_{1-\alpha/2}.

When pi.type="lower" or pi.type="upper", KK is computed exactly as above, except tt is set to t=z1−αt = z_{1-\alpha}.

The Case When k > 1
When k>1k > 1, Gibbons (1987b) suggests using the Bonferroni inequality. That is, the value of KK is computed exactly as for the case k=1k=1 described above, except that the Bonferroni value of tt is used in place of the usual value of tt:

When pi.type="two-side", t=z1−(α/k)/2t = z_{1 - (\alpha/k)/2}.

When pi.type="lower" or pi.type="upper", t=z1−α/kt = z_{1 - \alpha/k}.

Conditional Distribution Approximation Based on Student’s t-Distribution
(method="conditional.approx.t")
When method="conditional.approx.t", the exact same procedure is used as when
method="conditional.approx.normal", except that the quantity in Equation (10) is assumed to follow a Student’s t-distribution with n−1n-1 degrees of freedom. Thus, all occurrences of zpz_p are replaced with tn−1,pt_{n-1, p}, where tν,pt_{\nu, p} denotes the pp’th quantile of Student’s t-distribution with ν\nu degrees of freedom.

Normal Approximation (method="normal.approx")
The normal approximation for Poisson prediction limits was given by Nelson (1970; 1982, p.203) and is based on the fact that the mean and variance of a Poisson distribution are the same (Johnson et al, 1992, p.157), and for “large” values of nn and mm, both XX and YY are approximately normally distributed.

The Case When k = 1
The quantity Y−cXY - cX is approximately normally distributed with expectation and variance given by:

E(Y−cX)=E(Y)−cE(X)=mλ−cnλ=0(13) E(Y - cX) = E(Y) - cE(X) = m\lambda - cn\lambda = 0 \;\;\;\;\;\; (13)

Var(Y−cX)=Var(Y)+c2Var(X)=mλ+c2nλ=mλ(1+mn)(14) Var(Y - cX) = Var(Y) + c^2 Var(X) = m\lambda + c^2 n\lambda = m\lambda (1 + \frac{m}{n}) \;\;\;\;\;\; (14)

so the quantity

z=Y−cXmλ̂(1+mn)=Y−cXmx‾(1+mn)(15) z = \frac{Y-cX}{\sqrt{m\hat{\lambda}(1 + \frac{m}{n})}} = \frac{Y-cX}{\sqrt{m\bar{x}(1 + \frac{m}{n})}} \;\;\;\;\;\; (15)

is approximately distributed as a standard normal random variable. The function predIntPois, however, assumes this quantity is distributed as approximately a Student’s t-distribution with n−1n-1 degrees of freedom.

Thus, following the idea of prediction intervals for a normal distribution (see predIntNorm), when pi.type="two-sided", the constant KK for a (1−α)100%(1-\alpha)100\% prediction interval for the next k=1k=1 sum of mm observations is computed as:

K=tn−1,1−α/2mx‾(1+mn)(16) K = t_{n-1, 1-\alpha/2} \sqrt{m\bar{x} (1 + \frac{m}{n})} \;\;\;\;\;\; (16)

where tν,pt_{\nu, p} denotes the pp’th quantile of a Student’s t-distribution with ν\nu degrees of freedom.

Similarly, when pi.type="lower" or pi.type="upper", the constant KK is computed as:

K=tn−1,1−αmx‾(1+mn)(17) K = t_{n-1, 1-\alpha} \sqrt{m\bar{x} (1 + \frac{m}{n})} \;\;\;\;\;\; (17)

The Case When k > 1
When k>1k > 1, the value of KK is computed exactly as for the case k=1k = 1 described above, except that the Bonferroni value of tt is used in place of the usual value of tt:

When pi.type="two-sided",

K=tn−1,1−(α/k)/2mx‾(1+mn)(18) K = t_{n-1, 1-(\alpha/k)/2} \sqrt{m\bar{x} (1 + \frac{m}{n})} \;\;\;\;\;\; (18)

When pi.type="lower" or pi.type="upper",

K=tn−1,1−(α/k)mx‾(1+mn)(19) K = t_{n-1, 1-(\alpha/k)} \sqrt{m\bar{x} (1 + \frac{m}{n})} \;\;\;\;\;\; (19)

Hahn and Nelson (1973, p.182) discuss another method of computing KK when k>1k > 1, but this method is not implemented here.