Description Usage Arguments Details Value Examples
View source: R/max_prob_pred_int.R
Finds the maximum probability for a prediction interval using optimization
1 2 3 4 5 6 7 8 |
x |
should be a vector |
method |
either 'tdist' (assumes normality), 'conformal' (distribution-free), or non-parametric ('npar') |
m.method |
method used to compute conformal prediction interval: either "quantile", "deviation" or "jackknife" |
interval |
maximum and minimum values for the optimization search |
alpha.penalty |
whether to include a penalty for alpha |
scale |
whether to scale the input vector |
Optimize the maximum probability for the prediction of a small sample size using either the t-distribution or conformal methods
The idea is to find the maximum level of probability that will produce a prediction interval which matches the minimum and maximum values in the observed sample. The distance is calculated as abs(x.min - calc.lower.bound) + abs(x.max - calc.upper.bound).
a single value which represents a 'suggestion' for the maximum level of probability given the data
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
set.seed(12345)
x <- rnorm(10)
mp.pdi <- max_prob_pred_int(x)
## For this particular sample, the maximum is about 76%
data(soyrs)
soyrs.s <- aggregate(lrr ~ Trial_ID, data = soyrs, FUN = mean)
mp.pdi.soy.tdist <- max_prob_pred_int(soyrs.s$lrr)
mp.pdi.soy.conf <- max_prob_pred_int(soyrs.s$lrr, method = "conformal")
print(round(c(mp.pdi.soy.tdist, mp.pdi.soy.conf1),2))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.