# NOT RUN {
monteCarlo(120, FUN = rbinom, n = 100, size = 5, prob=0.2)
# }
# NOT RUN {
new = sample(-7:6, replace = TRUE, size = 1000)
#MonteCarlo taking random sample from the input sequence itself
# }
# NOT RUN {
monteCarlo(local_score = 20, FUN = function(x) {return(sample(x = x,
size = length(x), replace = TRUE))}, x=new)
# }
# NOT RUN {
# Markovian example
MyTransMat <-
+ matrix(c(0.3,0.1,0.1,0.1,0.4, 0.2,0.2,0.1,0.2,0.3, 0.3,0.4,0.1,0.1,0.1, 0.3,0.3,0.1,0.0,0.3,
+ 0.1,0.1,0.2,0.3,0.3), ncol = 5, byrow=TRUE)
# }
# NOT RUN {
monteCarlo(local_score = 50,
FUN = transmatrix2sequence, matrix = MyTransMat,
length=150, score = c(-2,-1,0,2,3), plot=FALSE, numSim = 5000)
# }
Run the code above in your browser using DataCamp Workspace