Learn R Programming

GaDiFPT (version 1.0)

vectorsetup: Setup of the mean and covariance vectors for the Gaussian Diffusion process

Description

vectorsetup evaluates the vectors mp (mean of the process) and the two covariance factors up and vp (i.e. covariance of the process is given by up*vp) in the interval [t0, Tfin] with timestep deltat

Usage

vectorsetup(obj)

Arguments

obj
An “inputlist” class object yielding all the input parameters

Value

Values are returned as a matrix (mp,up,vp)

Examples

Run this code
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## Continuing the Wiener() example:


####       INITIALIZATION OF VECTORS

tempi <- numeric(N+1)
mp <- numeric(N+1)
up <- numeric(N+1)
vp <- numeric(N+1)

# dummy vector
app <- numeric(N)

####    EVALUATION OF MEAN AND COVARIANCE OF THE PROCESS

tempi <- seq(t0, by=deltat, length=N+1)

dum <- vectorsetup(param)
mp <- dum[,1]
up <- dum[,2]
vp <- dum[,3]

## plot of S and m

splot <- S(tempi)
mp1 <- mp - sqrt(2*sigma2)
mp2 <- mp + sqrt(2*sigma2)
matplot(tempi, cbind(mp,mp1,mp2,splot),type="l",lty=c(1,2,2,1),lwd=1,
        main="mean of the process vs. threshold",xlab="time(ms)",ylab="")
legend("bottomright",c("mean","threshold"),
       lty=c(1,1),col=c("black","blue"))

Run the code above in your browser using DataLab