# \donttest{
monteCarlo(120, FUN = rbinom, n = 100, size = 5, prob=0.2)
# }
# \donttest{
mySeq <- sample(-7:3, replace = TRUE, size = 1000)
monteCarlo(local_score = 18, FUN = function(x) {return(sample(x = x,
size = length(x), replace = TRUE))}, x = mySeq)
# }
# \donttest{
#Examples of non integer score function
mySeq2 <- sample(-7:6 - 0.5, replace = TRUE, size = 1000)
monteCarlo(local_score = 50.5, FUN = function(x) {return(sample(x = x,
size = length(x), replace = TRUE))}, x = mySeq2)
# }
# \donttest{
#Examinating simulated local scores
mySeq2 <- sample(-7:6, replace = TRUE, size = 1000)
simu <- monteCarlo(local_score = 50.5, FUN = function(x) {return(sample(x = x,
size = length(x), replace = TRUE))}, x = mySeq2, keepSimu = TRUE)
hist(simu$localScores)
# }
# \donttest{
# 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)
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 DataLab