# predict-est.Diffusion-method: Prediction for a diffusion process In SimoneHermann/BaPreStoPro: Bayesian Prediction of Stochastic Processes

## Description

Bayesian prediction of a stochastic process dY_t = b(φ,t,Y_t)dt + γ \widetilde{s}(t,Y_t)dW_t.

## Usage

 ```1 2 3 4 5 6 7 8``` ```## S4 method for signature 'est.Diffusion' predict(object, t, Euler.interval = FALSE, level = 0.05, burnIn, thinning, b.fun.mat, which.series = c("new", "current"), y.start, M2pred = 10, cand.length = 1000, pred.alg = c("Distribution", "Trajectory", "simpleTrajectory", "simpleBayesTrajectory"), method = c("vector", "free"), sampling.alg = c("InvMethod", "RejSamp"), sample.length, grid, plot.prediction = TRUE) ```

## Arguments

 `object` class object of MCMC samples: "est.Diffusion", created with method `estimate,Diffusion-method` `t` vector of time points to make predictions for `Euler.interval` if TRUE: simple prediction intervals with Euler are made (in one step each) `level` level of the prediction intervals `burnIn` burn-in period `thinning` thinning rate `b.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") `y.start` optional, if missing, first (which.series = "new") or last observation variable ("current") is taken `M2pred` optional, if current series to be predicted and t missing, `M2pred` variables will be predicted with the observation time distances `cand.length` length of candidate samples (if method = "vector") `pred.alg` prediction algorithm, "Distribution", "Trajectory", "simpleTrajectory" or "simpleBayesTrajectory" `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

## References

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.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18``` ```model <- set.to.class("Diffusion", parameter = list(phi = 0.5, gamma2 = 0.01)) t <- seq(0, 1, by = 0.01) data <- simulate(model, t = t, y0 = 0.5) est_diff <- estimate(model, t, data, 1000) # better: 10000 plot(est_diff) ## Not run: pred_diff <- predict(est_diff, t = seq(0, 1, by = 0.1)) pred_diff <- predict(est_diff, b.fun.mat = function(phi, t, y) phi[,1]) # much faster pred_diff2 <- predict(est_diff, which.series = "current", b.fun.mat = function(phi, t, y) phi[,1]) pred_diff3 <- predict(est_diff, which.series = "current", y.start = data[51], t = t[seq(51, 100, by = 5)], b.fun.mat = function(phi, t, y) phi[,1]) ## End(Not run) pred_diff <- predict(est_diff, Euler.interval = TRUE, b.fun.mat = function(phi, t, y) phi[,1]) # one step Euler approximation pred_diff <- predict(est_diff, pred.alg = "simpleTrajectory", sample.length = 100) for(i in 1:100) lines(t[-1], pred_diff[i,], col = "grey") pred_diff <- predict(est_diff, pred.alg = "simpleBayesTrajectory") ```

SimoneHermann/BaPreStoPro documentation built on May 10, 2017, 1:42 p.m.