getMAP | R Documentation |
Calculates the Maximum a Posteriori estimate for the trace of a quantitative variable
getMAP(var)
var |
(numeric vector; no default) Vector of the samples from the trace of a quantitative variable |
Uses the SANN method of the optim() function to approximate the MAP estimate
the MAP estimate
optim
# download the example dataset to working directory
url <-
"https://revbayes.github.io/tutorials/intro/data/primates_cytb_GTR.log"
dest_path <- "primates_cytb_GTR.log"
download.file(url, dest_path)
# to run on your own data, change this to the path to your data file
file <- dest_path
trace <- readTrace(paths = file)
MAP <- getMAP(trace[[1]]$"pi[1]")
# remove file
# WARNING: only run for example dataset!
# otherwise you might delete your data!
file.remove(dest_path)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.