Nothing
# program spuRs/resources/scripts/MCEstimation.R
# loadable spuRs function
# This function estimates the transition matrix for a discrete MC
# with known state space {0,1,..,n}
# based on observations of the chain stored in statehist.
MCEstimation <- function(statehist, n) {
ntrans <- length(statehist) - 1
TC <- matrix(0, nrow = n+1, ncol = n+1)
for (trans in 2:ntrans) {
TC[statehist[trans - 1] + 1, statehist[trans] + 1] <-
TC[statehist[trans - 1] + 1, statehist[trans] + 1] + 1
}
return(TC/rowSums(TC))
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.