# predI: Prediction interval for future observations In PredictionR: Prediction for Future Data from any Continuous Distribution

## Description

Construct a prediction interval (PCI) for future observations from any continuous distribution. Generic method is `print`.

## Usage

 ```1 2 3 4``` ```predI(data, dist, s, n, order=NULL, start=NULL, conf=0.95) ## S3 method for class 'predI' print(x, ...) ```

## Arguments

 `data` A numeric vector `dist` A character string `"name"` naming a distribution for which the corresponding density function `dname`, the corresponding distribution function `pname` and the corresponding quantile function `qname` must be defined. `s` A numeric vector for the order of the next observation. The length of this vector must be equal to 1. `n` A numeric vector for the size of all data. `order` A numeric vector for the moment order(s). The length of this vector must be equal to the number of parameters to estimate. This argument may be omitted(default) for some distributions for which reasonable order are computed. `start` A named list giving the initial values of parameters of the named distribution. This argument may be omitted(default) for some distributions for which reasonable starting values are computed. `conf` Confidence level for the test. `x` An object of class `"predI"`. `...` Further argument to be passed to generic function

## Details

The dist argument is assumed to specify the distribution by the probability density function, the commulative distribution function and the quantile function (d, p, q). By default, best fitting of the data based on maximum likelihood (mle) and moment matching (mme) methods is performed. once the parameter(s) is(are) estimated, predI computes the prediction interval (PCI) for the future observation. This function will be called directly in `predP`.

## Value

`predI` returns an object of class `"predI"`, a list with the following components:

 ` interval ` the prediction interval. ` lower ` the lower bound of the interval. ` upper ` the upper bound of the interval. ` distname ` the name of the distribution. ` r ` the length of the data. ` s ` the order of the next observation. ` n ` the length of all the data. ` parameters ` the parameter estimate.

Generic function:

`print`

The print of a `"predI"` object shows few traces about the parameters and the prediction interval.

## Author(s)

H. M. Barakat, O. M. Khaled and Hadeer A. Ghonem.

## References

Delignette-Muller ML and Dutang C (2015), fitdistrplus: An R Package for Fitting Distributions. Journal of Statistical Software, 64(4), 1-34.

H. M. Barakat, Magdy E. El-Adll, Amany E. Aly (2014), Prediction intervals of future observations for a sample random size from any continuous distribution. Mathematics and Computers in Simulation, volume 97, 1-13.

`bestfit`, `predP`.
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13``` ```# (1) prediction interval for the next observations based on normal distribution # set.seed(123) x1 <- rnorm(15, 2, 4) predI(x1, "norm", 16, 25) # (2) prediction interval for the next observations based on weibull distribution # library(actuar) set.seed(123) x2 <- rweibull(16 , 2 , 3) predI(x2, "weibull", 20, 20 ) ```