max_prob_pred_int2: maximum probability for the prediciton interval 'small sample...

Description Usage Arguments Details Value Note Examples

View source: R/max_prob_pred_int.R

Description

Calculates the maximum probability for a prediction interval

Usage

1
2
3
4
5
6
7
8
max_prob_pred_int2(
  x,
  n = 200,
  neval = 200,
  tol = 0.001,
  method = c("tdist", "conformal"),
  m.method = c("quantile", "deviation", "jackknife")
)

Arguments

x

should be a vector

n

number of evaluations to perform in the line search of probabilities

neval

number of evaluations in the conformal algorithm (see pred_int_conformal)

tol

tolerance default is (0.001) see details

method

either 'tdist' (assumes normality) or 'conformal' (distribution-free)

m.method

method used to compute conformal prediction interval: either "quantile", "deviation" or "jackknife"

Details

Calculate maximum probability for the prediction of a small sample size using conformal prediction

The idea is to find the maximum level of probability that will produce a conformal prediction interval which matches the minimum and maximum values in the observed sample. This is approximate and it depends on the tolerance. The distance is calculated as abs(x.min - calc.lower.bound) + abs(x.max - calc.upper.bound). The deviation tolerance is calculated as a proportion of the range in the observed sample. i.e. (x.max - x.min)*tol

Value

a single value which represents a 'suggestion' for the maximum level of probability given the data

Note

At this moment, with current testing, for method "tdist" this is not reliable and "max_prob_pred_int" should be used.

Examples

1
2
3
4
5
6
## Not run: 
set.seed(12345)
mp.pdi <- max_prob_pred_int2(rnorm(10), method = "conformal") 
## For this particular sample, the 'suggested' maximum is about 82%

## End(Not run)

femiguez/predintma documentation built on July 5, 2021, 4:16 a.m.