MLE: MLE using R.

Description Usage Arguments Value Examples

View source: R/MLE.R

Description

MLE is a fundamental estimation method of parameter, the function is working in condition that sample is independent identical distribution (iid)

Usage

1
MLE(n, data, stheta, llm, is.log = TRUE)

Arguments

n

the numbers of data

data

which dim is n*p, p is the length of one sample

stheta

the vector with length p, the initial value of optimization function

llm

the function of likelihood of one sample and the parameter, input should be (parameter,sample)

is.log

logical; if TRUE, the return values of llm are given as log

Value

the MLE estimation of parameter

Examples

1
2
3
4
5
6
7
## Not run: 
llm1<- function(data,theta) return(dnorm(data,theta[1],theta[2]))
llm2<- function(data,theta) return(dnorm(data,theta[1],theta[2],log=TRUE))
MLE(10,X[1:10],c(-1,2),llm1,FALSE)
MLE(100,X,c(2,0.5),llm2,TRUE)

## End(Not run)

Hope0/StatComp18033 documentation built on May 5, 2019, 11:06 p.m.