moezipfFit {zipfextR}R Documentation

MOEZipf parameters estimation.

Description

For a given sample of strictly positive integer numbers, usually of the type of ranking data or frequencies of frequencies data, estimates the parameters of the MOEZipf distribution by means of the maximum likelihood method. The input data should be provided as a frequency matrix.

Usage

moezipfFit(data, init_alpha = NULL, init_beta = NULL, level = 0.95,
  ...)

## S3 method for class 'moezipfR'
residuals(object, ...)

## S3 method for class 'moezipfR'
fitted(object, ...)

## S3 method for class 'moezipfR'
coef(object, ...)

## S3 method for class 'moezipfR'
plot(x, ...)

## S3 method for class 'moezipfR'
print(x, ...)

## S3 method for class 'moezipfR'
summary(object, ...)

## S3 method for class 'moezipfR'
logLik(object, ...)

## S3 method for class 'moezipfR'
AIC(object, ...)

## S3 method for class 'moezipfR'
BIC(object, ...)

Arguments

data

Matrix of count data in form of a table of frequencies.

init_alpha

Initial value of \alpha parameter (\alpha > 1).

init_beta

Initial value of \beta parameter (\beta > 0).

level

Confidence level used to calculate the confidence intervals (default 0.95).

...

Further arguments to the generic functions. The extra arguments are passing to the optim function.

object

An object from class "moezipfR" (output of moezipfFit function).

x

An object from class "moezipfR" (output of moezipfFit function).

Details

The argument data is a two column matrix with the first column containing the observations and the second column containing their frequencies.

The log-likelihood function is equal to:

l(\alpha, \beta; x) = -\alpha \sum_{i = 1} ^m f_{a}(x_{i}) log(x_{i}) + N (log(\beta) + \log(\zeta(\alpha)))

- \sum_{i = 1} ^m f_a(x_i) log[(\zeta(\alpha) - \bar{\beta}\zeta(\alpha, x_i)(\zeta(\alpha) - \bar{\beta}\zeta(\alpha, x_i + 1)))],

where f_{a}(x_i) is the absolute frequency of x_i, m is the number of different values in the sample and N is the sample size, i.e. N = \sum_{i = 1} ^m x_i f_a(x_i).

By default the initial values of the parameters are computed using the function getInitialValues.

The function optim is used to estimate the parameters.

Value

Returns a moezipfR object composed by the maximum likelihood parameter estimations jointly with their standard deviation and confidence intervals. It also contains the value of the log-likelihood at the maximum likelihood estimator.

See Also

getInitialValues.

Examples

data <- rmoezipf(100, 2.5, 1.3)
data <- as.data.frame(table(data))
data[,1] <- as.numeric(as.character(data[,1]))
data[,2] <- as.numeric(as.character(data[,2]))
initValues <- getInitialValues(data, model='moezipf')
obj <- moezipfFit(data, init_alpha = initValues$init_alpha, init_beta = initValues$init_beta)

[Package zipfextR version 1.0.2 Index]