predict.GPDP_MCMC: Predicts GPDPQuantReg

Description Usage Arguments Value Author(s) Examples

View source: R/prediction.R

Description

Predicts after fitting a GPDPQuantReg

Usage

1
2
## S3 method for class 'GPDP_MCMC'
predict(GPDP_MCMC, predictive_data, credibility = 0.95)

Arguments

GPDP_MCMC

A GPDP_MCMC object

predictive_data

data frame with the new X values, for prediction

credibility

real between (0,1), size of the prediction's credible interval

Value

prediction data frame with the mean, median, lower and upper values for each x

Author(s)

Omar Pardo (omarpardog@gmail.com)

Examples

1
2
3
4
5
6
7
8
m <- 35
x <- sort(sample(seq(-15, 15, 0.005), m))
f_x <- function(x) return((1/40) * x^2 - (1/20) * x - 2)
data <- data.frame(x = x, y = f_x(x) + rnorm(m, 0, 1))
GPDP_MCMC <- fit_GPDPQuantReg(y ~ x, data, p = 0.250)
predictive_data <- data_frame(x = seq(-15, 15, 0.1))
credibility <- 0.90
predict(GPDP_MCMC, predictive_data, credibility)

opardo/GPDPQuantReg documentation built on Nov. 24, 2019, 3:28 a.m.