Hi, see inline
________________________________________
Feladó: [email protected] [[email protected]] ; 
meghatalmazó: Armel KAPTUE [[email protected]]
Küldve: 2014. január 28. 8:16
To: [email protected]
Tárgy: [R] Markov chain simulation

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.

Indeed there are many ways to do that in R!

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:

I am not sure what you mean here?! If you give the length of the chain, 
depending on the transition matrix you are going to get some occurences of 
state '0', I do not think you can specify n, p and the transition matrix all at 
once!

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')

Please try googling first, there are a lot of good examples on your problem, 
among the first ones:

http://stackoverflow.com/questions/2754469/r-library-for-discrete-markov-chain-simulation

Best
daniel

Thanks,
--
Armel

        [[alternative HTML version deleted]]

______________________________________________
[email protected] 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.

______________________________________________
[email protected] 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.

Reply via email to