# \donttest{
mySeq <- sample(-7:6, replace = TRUE, size = 100000)
#MonteCarlo taking random sample from the input sequence itself
karlinMonteCarlo(local_score = 160, sequence_length = 100000,
simulated_sequence_length = 1000,
FUN = function(x, sim_length) {
return(sample(x = x,
size = sim_length,
replace = TRUE))
},
x = mySeq,
sim_length = 1000,
numSim = 1000)
# }
# \donttest{
#Markovian example (longer computation)
MyTransMat_reels <- 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.2, 0.1,
0.2, 0.1, 0.2, 0.4, 0.1),
ncol = 5, byrow=TRUE)
karlinMonteCarlo(local_score = 18.5, sequence_length = 200000,
simulated_sequence_length = 1500,
FUN = transmatrix2sequence,
matrix = MyTransMat_reels,
score =c(-1.5,-0.5,0,0.5,1), length = 1500,
plot=TRUE, numSim = 1500)
# }
Run the code above in your browser using DataLab