Last active
October 23, 2018 22:57
-
-
Save WalkerHarrison/1b913bfa8e3b3dee744afd035e81ba99 to your computer and use it in GitHub Desktop.
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
library(expm) | |
p <- 4 | |
mt <- rep(1, p) | |
G <- diag(p); G[1:(p-1), 2:p] <- G[1:(p-1), 2:p] + diag(p-1); | |
F <- c(1, rep(0, p-1)) | |
print(G); print(mt); print(F) | |
k <- 5 | |
G %^% k | |
F * ((G %^% k) %*% mt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment