# NOT RUN {
#Defining parallel_opt parallel settings.
#parallel_opt can also be left empty to be defined automatically by the function.
require(parallel)
num_workers <- min(c(detectCores(),2))
#Exponential shift - default cost functions.
stat_exp <- Markovstat(shiftfun="exp", h=1, k=1, sigma=1, s=0.2, delta=2,
RanRep=TRUE, alpha=1, beta=3, Vd=30, V=18)
parall <- list(cl=makeCluster(num_workers), forward=FALSE, loginfo=TRUE)
Gmtx <- Markovchart(statdist=stat_exp, h=seq(1,10,by=(10-1)/5),
k=seq(0.1,5,by=(5-0.1)/5), p=0.9, cs=1,
coparams=c(10,3), crparams=c(1,2),
vcoparams=c(8,1.5), vcrparams=c(5,2),
V=18, parallel_opt=parall)
plot(Gmtx)
# }
Run the code above in your browser using DataLab