Density, distribution function, quantile function, and random generation for the transition probabilities in the (shifted) Ornstein-Uhlenbeck process given by the stochastic differential equation dX = lambda*(xi-X)*dt + sigma*dB

dOU(x,x0,lambda,xi,sigma,t,log=FALSE)

pOU(x,x0,lambda,xi,sigma,t,log.p=FALSE,lower.tail=TRUE)

qOU(p,x0,lambda,xi,sigma,t,log.p=FALSE,lower.tail=TRUE)

rOU(n,x0,lambda,xi,sigma,t)

Arguments

x, q

Target state, assumed >= 0

x0

Initial state, assumed > 0

lambda

Rate parameter, assumed > 0

xi

Mean parameter, assumed > 0

sigma

Noise intensity parameters, assumed > 0

t

Terminal time, assumed > 0 #' @param log,log.p Logical, if TRUE, probabilities/densities are given as log(p). Default is FALSE

lower.tail

Logical; if TRUE (default) probabilities are P(X<=x); otherise, P(X>x).

p

Probability, assumed >= 0 and <= 1.

Value

dOU gives the transition probability density, pOU gives the distribution of the transitio probability, qOU gives the quantiles, and rOU samples a random terminal point.

The length of the result is determined by n for rOU, and is the maximum of the lengths of the numerical arguments for the other functions.

Examples

x <- sort(rOU(100,1,1,1,1,1))
par(mfrow=c(1,2))
plot(x,dOU(x,1,1,1,1,1),ylab="p.d.f.")
F <- pOU(x,1,1,1,1,1)
plot(x,F)
lines(qOU(F,1,1,1,1,1),F)