Description Usage Arguments References Examples
Bayesian prediction of regression model y_i = f(φ, t_i) + ε_i, ε_i\sim N(0,γ^2\widetilde{s}(t_i)).
1 2 3 4 5 6 | ## S4 method for signature 'est.Regression'
predict(object, t, only.interval = TRUE,
level = 0.05, burnIn, thinning, fun.mat, which.series = c("new",
"current"), M2pred = 10, cand.length = 1000, method = c("vector",
"free"), sampling.alg = c("InvMethod", "RejSamp"), sample.length, grid,
plot.prediction = TRUE)
|
object |
class object of MCMC samples: "est.Regression", created with method |
t |
vector of time points to make predictions for |
only.interval |
if TRUE: only calculation of prediction intervals |
level |
level of the prediction intervals |
burnIn |
burn-in period |
thinning |
thinning rate |
fun.mat |
matrix-wise definition of drift function (makes it faster) |
which.series |
which series to be predicted, new one ("new") or further development of current one ("current") |
M2pred |
optional, if current series to be predicted and t missing, |
cand.length |
length of candidate samples (if method = "vector") |
method |
vectorial ("vector") or not ("free") |
sampling.alg |
sampling algorithm, inversion method ("InvMethod") or rejection sampling ("RejSamp") |
sample.length |
number of samples to be drawn, default is the number of posterior samples |
grid |
fineness degree of sampling approximation |
plot.prediction |
if TRUE, prediction intervals are plotted |
Hermann, S. (2016a). BaPreStoPro: an R Package for Bayesian Prediction of Stochastic Processes. SFB 823 discussion paper 28/16.
Hermann, S. (2016b). Bayesian Prediction for Stochastic Processes based on the Euler Approximation Scheme. SFB 823 discussion paper 27/16.
1 2 3 4 5 6 7 8 9 10 11 12 | t <- seq(0,1, by = 0.01)
cl <- set.to.class("Regression", fun = function(phi, t) phi[1]*t + phi[2],
parameter = list(phi = c(1,2), gamma2 = 0.1))
data <- simulate(cl, t = t)
est <- estimate(cl, t, data, 1000)
plot(est)
pred <- predict(est, fun.mat = function(phi, t) phi[,1]*t + phi[,2])
## Not run:
pred2 <- predict(est, fun.mat = function(phi, t) phi[,1]*t + phi[,2], only.interval = FALSE)
plot(density(pred2[,10]))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.