## Estimate the exponential distribution parameter
t <- rexp(100, 2)
loglik <- function(theta, index) sum(log(theta) - theta*t[index])
## Estimate with numeric gradient and numeric Hessian
a <- maxSGA(loglik, start=1,
control=list(storeValues=TRUE, storeParameters=TRUE, iterlim=10),
nObs=100)
storedValues(a)
storedParameters(a)
Run the code above in your browser using DataLab