gyulemle: Models for Count Distributions

View source: R/groupedmodels.R

gyulemleR Documentation

Models for Count Distributions

Description

Functions to Estimate Parametric Discrete Probability Distributions via maximum likelihood Based on categorical response

Usage

gyulemle(x, cutoff = 1, cutabove = 1000, guess = 3.5, conc = FALSE, 
    method = "BFGS", hellinger = FALSE, hessian=TRUE)

Arguments

x

A vector of categories for counts (one per observation). The values of x and the categories are: 0=0, 1=1, 2=2, 3=3, 4=4, 5=5-10, 6=11-20, 7=21-100, 8=>100

cutoff

Calculate estimates conditional on exceeding this value.

cutabove

Calculate estimates conditional on not exceeding this value.

guess

Initial estimate at the MLE.

conc

Calculate the concentration index of the distribution?

method

Method of optimization. See "optim" for details.

hellinger

Minimize Hellinger distance of the parametric model from the data instead of maximizing the likelihood.

hessian

Calculate the hessian of the information matrix (for use with calculating the standard errors.

Value

result

vector of parameter estimates - lower 95% confidence value, upper 95% confidence value, the PDF MLE, the asymptotic standard error, and the number of data values >=cutoff and <=cutabove.

theta

The Yule MLE of the PDF exponent.

value

The maximized value of the function.

conc

The value of the concentration index (if calculated).

Note

See the papers on https://handcock.github.io/?q=Holland for details

References

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.

Examples

#
# Simulate a Yule distribution over 100
# observations with rho=4.0
#

set.seed(1)
s4 <- simyule(n=100, rho=4)
table(s4)

#
# Recode it as categorical
#

s4[s4 >  4 & s4 < 11] <- 5
s4[s4 > 100] <- 8
s4[s4 >  20] <- 7
s4[s4 >  10] <- 6

#
# Calculate the MLE and an asymptotic confidence
# interval for rho
#

s4est <- gyulemle(s4)
s4est

#
# Calculate the MLE and an asymptotic confidence
# interval for rho under the Waring model (i.e., rho=4, p=2/3)
#

s4warest <- gwarmle(s4)
s4warest

#
# Compare the AICC and BIC for the two models
#

llgyuleall(v=s4est$theta,x=s4)
llgwarall(v=s4warest$theta,x=s4)


degreenet documentation built on Sept. 26, 2024, 1:08 a.m.