ml_fit: Fit an R Expression based Maximum Likelihood Model to Data

Description Usage Arguments Value Examples

View source: R/fit.R

Description

Fit an R Expression based Maximum Likelihood Model to Data

Usage

1
ml_fit(expr, start, data)

Arguments

expr

A string of R code that evaluates to the log-likelihood.

start

An named list of the starting values for the parameter terms (coerced to an nlist object). Missing values are fixed at 0.

data

An named list or data frame of the data (coerced to an nlist object).

Value

A fitted ml_analysis object.

Examples

1
2
3
4
5
expr <- "sum(dnorm(len, mu, sigma, log = TRUE))"
start <- list(mu = 20, sigma = 8)
data <- datasets::ToothGrowth
analysis <- ml_fit(expr, start = start, data = data)
analysis

poissonconsulting/ml documentation built on Feb. 13, 2021, 5:18 p.m.