knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
ml
is an R package to fit R expression based Maximum Likelihood models.
It is designed to be simple but flexible.
library(ml) library(tibble) # the R expression is currently passed as unparsed text # it should evaluate to the log likelihood expr <- "sum(dnorm(len, mu, b[1,1] + b[1,2], log = TRUE))" # the list of starting can include arrays and matrices # the values are the initial values (NAs are fixed at 0) start <- list(mu = 20, b = matrix(c(8, NA), ncol = 2)) # data can be a data.frame or list of numeric atomic objects data <- datasets::ToothGrowth # perform the analysis analysis <- ml_fit(expr, start = start, data = data) # glance at the analysis glance(analysis) # the coefficient table includes svalues (in place of pvalues) tidy(analysis)
install.packages("ml")
To install the developmental version from GitHub
# install.packages("remotes") remotes::install_github("poissonconsulting/ml")
To install the latest developmental release from the Poisson drat repository
# install.packages("drat") drat::addRepo("poissonconsulting") install.packages("ml")
Please report any issues.
Pull requests are always welcome.
Please note that the ml project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.