Uses the parametric bootstrap to estimate the bias and confidence interval of the MLE of the Negative Binomial Distribution.
bsnb(x, cutoff=1, m=200, np=2, alpha=0.95, hellinger=FALSE)
bootstrapnb(x,cutoff=1,cutabove=1000,
m=200,alpha=0.95,guess=c(5, 0.2),
file="none")
matrix of sample CDFs, one per row.
The Negative Binomial MLE of the PDF exponent.
Vector of bootstrap MLE.
Quantiles of the bootstrap MLEs.
p-value of the Anderson-Darling statistics relative to the bootstrap MLEs.
Observed Anderson-Darling Statistic.
Mean of the bootstrap MLEs.
Initial estimate at the MLE.
Method to use to compute the MLE.
A vector of counts (one per observation).
Calculate estimates conditional on exceeding this value.
Number of bootstrap samples to draw.
Number of parameters in the model (1 by default).
Type I error for the confidence interval.
Minimize Hellinger distance of the parametric model from the data instead of maximizing the likelihood.
Calculate estimates conditional on not exceeding this value.
Guess at the parameter value.
Name of the file to store the results. By default do not save the results.
Jones, J. H. and Handcock, M. S. "An assessment of preferential attachment as a mechanism for human sexual network formation," Proceedings of the Royal Society, B, 2003, 270, 1123-1128.
anbmle, simnb, llnb
# Now, simulate a Negative Binomial distribution over 100
# observations with expected count 1 and probability of another
# of 0.2
set.seed(1)
s4 <- simnb(n=100, v=c(5,0.2))
table(s4)
#
# Calculate the MLE and an asymptotic confidence
# interval for the parameter.
#
s4est <- anbmle(s4)
s4est
#
# Use the bootstrap to compute a confidence interval rather than using the
# asymptotic confidence interval for the parameter.
#
bsnb(s4, m=20)
Run the code above in your browser using DataLab