MLEfunc: MLE

Description Usage Arguments Value Examples

View source: R/JiangZhihangToolsquiz-MLEfunc.R

Description

Computes the liklihood of a given distribution for data x

Usage

1
MLEfunc(x, f, interval)

Arguments

x

vector

interval

vector, i.e., interval for optimize function

func

function, e.g., 'function(theta, x) dgamma(x, shape = theta, log = TRUE)'

Value

scalar

Examples

1
2
3
4
x1=rgamma(100,3)
f = function(theta, x) dgamma(x, shape = theta, log = TRUE)
result_gamma <- MLEfunc(x1,f,c(0,3))
result_gamma

ZJ107/JiangZhihangTools documentation built on May 25, 2019, 2:23 p.m.