Created
August 8, 2019 02:04
-
-
Save slwu89/04c8daf200cbd51191369a7b496af999 to your computer and use it in GitHub Desktop.
Melancholia I has a matrix on the wall. This finds its stationary distribution. (https://en.wikipedia.org/wiki/Melencolia_I)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xx <- matrix(c(16,3,2,13,5,10,11,8,9,6,7,12,4,15,14,1),nrow = 4,ncol = 4,byrow = T) | |
xxx <- xx/rowSums(xx) | |
xeig <- eigen(xxx) | |
xvecs <- xeig$vectors | |
lvecs <- MASS::ginv(xvecs) | |
pi_eq <- lvecs[1,]/sum(lvecs[1,]) | |
pi_eq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment