create_mle_fn: Create a MLE function

Description Usage Arguments Value Examples

Description

Given a simple log-likelhood function, produces a new function that can be passed into the MLE function.

Usage

1

Arguments

f

a function of the form f(dat,prm), where dat is the data to be fitted and prm is a vector of parameters.

Value

A new function that takes 4 variables:

dat

The data to be fitted

prm

A vector of parameters

sum

A logical value for summing the log-likeihoods

priors

A nuisance variable included for compatibility

Examples

1
2
3
f = function(dat,prm) dnorm( dat, prm[1], exp( prm[2] ), log = T )
mle_fn = create_mle_fn(f)
MLE( rnorm( 100 ), mle_fn, c(0,1) )

rettopnivek/mle documentation built on May 5, 2019, 5:54 p.m.