Hi there, I'm wonder if in R there is a way to simulate a discrete Markov chains with a specific number of occurence of state knowing the transition matrixway.
For example, how to simualte a markov chain of length n with p occurences (p<n) of the sate '0' for a transition matrix defined by: TransitionMatrix<- matrix(c(0.7, 0.3, 0.4, 0.6),byrow=TRUE, nrow=2) colnames(TransitionMatrix) <- c('0','1') row.names(TransitionMatrix) <- c('0','1') Thanks, -- Armel [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.