Guest User

Untitled

a guest
Nov 13th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. for (i in 1:length(tran.mat)){
  2. p.state <- p.state %*% tran.mat[[i]]
  3. }
  4.  
  5. p.state <- c(1,0,0)
  6. tran.mat<-lapply(1:10,function(y){apply(matrix(runif(9),3,3),1,function(x){x/sum(x)})})
  7.  
  8. for (i in 1:length(tran.mat)){
  9. p.state <- p.state %*% tran.mat[[i]]
  10. }
  11.  
  12. print(p.state)
Add Comment
Please, Sign In to add comment