# Parameter estimation for a distribution with known shape parameters
X <- rUniform(n=500, a=0, b=1)
est.par <- eUniform(X, method="analytic.MLE"); est.par
plot(est.par)
# Histogram and fitted density
den.x <- seq(min(X),max(X),length=100)
den.y <- dUniform(den.x,a=est.par$a,b=est.par$b)
hist(X, breaks=10, probability=TRUE, ylim = c(0,1.2*max(den.y)))
lines(den.x, den.y, col="blue") # Original data
lines(density(X), lty=2) # Fitted curve
# Extracting boundary parameters
est.par[attributes(est.par)$par.type=="boundary"]
# log-likelihood
lUniform(X,param = est.par)
# Example of parameter estimation for a distribution with
# unknown parameters currently been sought after.
Run the code above in your browser using DataLab