mymaxlik: My Maximum Likelihood Function

View source: R/mymaxlik.R

mymaxlikR Documentation

My Maximum Likelihood Function

Description

Uses the method of maximum likelihood to estimate the max likelihood of a distribution, given some prior outcomes and a function that returns the log likelihood given a parameter.

Usage

mymaxlik(lfun, x, param, ...)

Arguments

lfun

- a function that will find the log likelihood given a value-parameter pair

x

- a vector of prior outcomes

param

- the parameter to be passed to the distribution (for instance, p in a binomial or lambda in a Poisson)

...

- other parameters that will be passed to 'plot()'

Value

maxima and also a neat graph

Examples

## Not run: 
mymaxlik(function (x, param) log(dbinom(x, prob=param, size=20)), c(1,2,3,4), seq(0,1,length=1000))

## End(Not run)

sam-irl/MATH4753bird0023 documentation built on May 3, 2022, 6:29 p.m.