aphylo_mle {aphylo} | R Documentation |
Model estimation using Maximum Likelihood Estimation
Description
The function is a wrapper of stats::optim()
.
Usage
aphylo_mle(
model,
params,
method = "L-BFGS-B",
priors = function(p) 1,
control = list(),
lower = 1e-05,
upper = 1 - 1e-05,
check_informative = getOption("aphylo_informative", FALSE),
reduced_pseq = getOption("aphylo_reduce_pseq", TRUE)
)
Arguments
model |
A model as specified in aphylo-model. |
params |
A vector of length 7 with initial parameters. In particular
|
method , control , lower , upper |
Arguments passed to |
priors |
A function to be used as prior for the model (see bprior). |
check_informative |
Logical scalar. When |
reduced_pseq |
Logical. When |
Details
The default starting parameters are described in APHYLO_PARAM_DEFAULT.
Value
An object of class aphylo_estimates.
See Also
Other parameter estimation:
APHYLO_DEFAULT_MCMC_CONTROL
Examples
# Using simulated data ------------------------------------------------------
set.seed(19)
dat <- raphylo(100)
dat <- rdrop_annotations(dat, .4)
# Computing Estimating the parameters
ans <- aphylo_mle(dat ~ psi + mu_d + eta + Pi)
ans
# Plotting the path
plot(ans)
# Computing Estimating the parameters Using Priors for all the parameters
mypriors <- function(params) {
dbeta(params, c(2, 2, 2, 2, 1, 10, 2), rep(10, 7))
}
ans_dbeta <- aphylo_mle(dat ~ psi + mu_d + eta + Pi, priors = mypriors)
ans_dbeta
[Package aphylo version 0.3-3 Index]