R/BBridge.R

Defines functions BBridge

BBridge <- function(x=0, y=0, t0=0, T=1, N=100){
  if(T<= t0) stop("wrong times")
  dt <- (T-t0)/N
  t <- seq(t0, T, length=N+1)
  X <- c(0,cumsum(stats::rnorm(N)*sqrt(dt)))
  BB <- x + X - (t-t0)/(T-t0)*(X[N+1]-y+x)
  X <- stats::ts(BB, start=t0,deltat=dt)
  return(invisible(X))
}

Try the fdasrvf package in your browser

Any scripts or data that you put into this service are public.

fdasrvf documentation built on Oct. 5, 2024, 1:08 a.m.