mylogl: Log Likelihood Estimator

Description Usage Arguments Details Value Examples

Description

Using a data vector and its approximate distribution, find the maximum log-likelihood estimator for a given interval.

Usage

1
mylogl(x, func, interval)

Arguments

x

data vector

func

function with arguments theta (the parameter) and x (the data vector)

interval

search range(numerical vector of length 2)

Details

Example functions for argument "fun": function(theta,x) dgamma(x, shape = theta, log = TRUE)

function(theta,x) dcauchy(x, location = theta, log = TRUE)

function(theta,x) dbinom(x, 20, prob = 1 / (1 + exp(- theta)), log = TRUE)

Value

The maximum likelihood estimator for the function: one numeric value

Examples

1
2
fgam <- function(theta,x) dgamma(x, shape = theta, log = TRUE)
mylogl(x = data2, func = fgam, interval = c(0,100))

merc534/STAT3701-HW3 documentation built on May 25, 2019, 10:30 p.m.