##---- 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