Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/predIntLnormAltTestPower.R

Compute the probability that at least one out of *k* future observations
(or geometric means) falls outside a prediction interval for *k* future
observations (or geometric means) for a normal distribution.

1 2 | ```
predIntLnormAltTestPower(n, df = n - 1, n.geomean = 1, k = 1,
ratio.of.means = 1, cv = 1, pi.type = "upper", conf.level = 0.95)
``` |

`n` |
vector of positive integers greater than 2 indicating the sample size upon which the prediction interval is based. |

`df` |
vector of positive integers indicating the degrees of freedom associated with
the sample size. The default value is |

`n.geomean` |
positive integer specifying the sample size associated with the future
geometric means. The default value is |

`k` |
vector of positive integers specifying the number of future observations that the
prediction interval should contain with confidence level |

`ratio.of.means` |
numeric vector specifying the ratio of the mean of the population that will be
sampled to produce the future observations vs. the mean of the population that
was sampled to construct the prediction interval. See the DETAILS section below
for more information. The default value is |

`cv` |
numeric vector of positive values specifying the coefficient of variation for
both the population that was sampled to construct the prediction interval |

`pi.type` |
character string indicating what kind of prediction interval to compute.
The possible values are |

`conf.level` |
numeric vector of values between 0 and 1 indicating the confidence level of the
prediction interval. The default value is |

A prediction interval for some population is an interval on the real line
constructed so that it will contain *k* future observations or averages
from that population with some specified probability *(1-α)100\%*,
where *0 < α < 1* and *k* is some pre-specified positive integer.
The quantity *(1-α)100\%* is call 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 `predIntNormTestPower`

computes the probability that at
least one out of *k* future observations or averages will **not** be contained in
a prediction interval based on the assumption of normally distributed observations,
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 function `predIntLnormAltTestPower`

assumes all observations are
from a lognormal distribution. The observations used to
construct the prediction interval are assumed to come from a lognormal distribution
with mean *θ_2* and coefficient of variation *τ*. The future
observations are assumed to come from a lognormal distribution with mean
*θ_1* and coefficient of variation *τ*; that is, the means are
allowed to differ between the two populations, but not the coefficient of variation.

The function `predIntLnormAltTestPower`

calls the function
`predIntNormTestPower`

, with the argument `delta.over.sigma`

given by:

*\frac{δ}{σ} = \frac{log(R)}{√{log(τ^2 + 1)}} \;\;\;\;\;\; (1)*

where *R* is given by:

*R = \frac{θ_1}{θ_2} \;\;\;\;\;\; (2)*

and corresponds to the argument `ratio.of.means`

for the function
`predIntLnormAltTestPower`

, and *τ* corresponds to the argument
`cv`

.

vector of numbers between 0 and 1 equal to the probability that at least one of
*k* future observations or geometric means will fall outside the prediction
interval.

See the help files for `predIntNormTestPower`

.

Steven P. Millard (EnvStats@ProbStatInfo.com)

See the help files for `predIntNormTestPower`

and
`tTestLnormAltPower`

.

`plotPredIntLnormAltTestPowerCurve`

,
`predIntLnormAlt`

,
`predIntNorm`

, `predIntNormK`

,

`plotPredIntNormTestPowerCurve`

,
`predIntLnormAltSimultaneous`

,

`predIntLnormAltSimultaneousTestPower`

, Prediction Intervals,
LognormalAlt.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
# Show how the power increases as ratio.of.means increases. Assume a
# 95% upper prediction interval.
predIntLnormAltTestPower(n = 4, ratio.of.means = 1:3)
#[1] 0.0500000 0.1459516 0.2367793
#----------
# Look at how the power increases with sample size for an upper one-sided
# prediction interval with k=3, ratio.of.means=4, and a confidence level of 95%.
predIntLnormAltTestPower(n = c(4, 8), k = 3, ratio.of.means = 4)
#[1] 0.2860952 0.4533567
#----------
# Show how the power for an upper 95% prediction limit increases as the
# number of future observations k increases. Here, we'll use n=20 and
# ratio.of.means=2.
predIntLnormAltTestPower(n = 20, k = 1:3, ratio.of.means = 2)
#[1] 0.1945886 0.2189538 0.2321562
``` |

EnvStats documentation built on May 30, 2017, 2:24 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.