mle_format {likelihoodTools}R Documentation

Extract and format results from Simulated Annealing (Maximum Likelihood Estimation)

Description

Extract and format results from Simulated Annealing (Maximum Likelihood Estimation)

Usage

mle_format(x, yvar)

Arguments

x

List with the results of the simulated annealing algorithm for Maximum Likelihood Estimation. See likelihood::anneal()

yvar

The name of the column that contains the dependent variable (the “observed” value). This column must be present in the source_data of the x (results) list

Value

A dataframe with outputs from the results of the simulated annealing maximum parameter estimation. This dataframe contains the following columns (see help in likelihood::anneal()):

RMSE=\sqrt{ \frac{\sum_{i=1}^{N}(obs_i - exp_i)^2}{n -1}}

Examples


# Get the results of the maximum likelihood estimation from the example in
# the anneal function of the likelihood pkg.

library(likelihood)
data(crown_rad)
dataset <- crown_rad

# Create our model function
modelfun <- function (a, b, DBH) {a + b * DBH}

# Compute the MLE of the parameters
results <- anneal(model = modelfun,
  par = list(a = 0, b = 0),
  var = list(DBH = "DBH", x = "Radius", mean = "predicted",
             sd = 0.815585, log = TRUE),
  source_data = dataset,
  par_lo = list(a = 0, b = 0),
  par_hi = list(a = 50, b = 50),
  pdf = dnorm,
  dep_var = "Radius",
  max_iter = 20000,
  show_display = FALSE)

# Format the results
mle_format(results, yvar = "DBH")


[Package likelihoodTools version 1.0.0 Index]