Learn R Programming

zipfR (version 0.6-70)

LNRE_posterior: Posterior Distribution of LNRE Model (zipfR)

Description

Posterior distribution over the type probability space of a LNRE model, given the observed frequency \(m\) in a sample. Posterior density (postdlnre) and log-transformed density (postldlnre) can be computed for all LNRE models. The distribution function (postplnre) and quantiles (postqlnre) are only available for selected types of models.

Usage

postdlnre(model, x, m, N, …)
postldlnre(model, x, m, N, base=10, log.x=FALSE, …)
postplnre(model, q, m, N, lower.tail=FALSE, …)
postqlnre(model, p, m, N, lower.tail=FALSE, …)

Arguments

model

an object belonging to a subclass of lnre, representing an LNRE model

m

frequency \(m\) of a type in the observed sample

N

sample size \(N\)

x

vector of type probabilities \(pi\) for which the posterior density function is evaluated

q

vector of type probability quantiles, i.e. threshold values \(\rho\) on the type probability axis

p

vector of tail probabilities

base

positive number, the base \(a\) with respect to which the log-transformation is peformed (see "Details" below)

log.x

if TRUE, the values passed in the argument x are assumed to be logarithmic, i.e. \(\log_a \pi\)

lower.tail

if TRUE, lower tail probabilities or type counts are returned / expected in the p argument. Note that the defaults differ for distribution function and type distribution, and see "Details" below.

further arguments are passed through to the method implementations (currently unused)

Value

A vector of non-negative numbers of the same length as the second argument (x, p or q).

postdlnre returns the posterior type density \(P(\pi | f = m)\) for the values of \(\pi\) specified in the vector x. postplnre computes the posterior type distribution function \(P(\pi \geq \rho | f = m)\) (default) or its complement \(P(\pi \leq \rho | f = m)\) (if lower.tail=TRUE). These correspond to \(E[V_{m, >\rho}]\) and \(E[V_{m, \rho}]\), respectively (Evert 2004, p. 123). postqlnre returns quantiles, i.e. the inverse of the posterior type distribution function.

postldlnre computes a logarithmically transformed version of the posterior type density, taking logarithms with respect to the base \(a\) specified in the base argument (default: \(a=10\)). Such log-transformed densities are useful for visualizing distributions, see ldlnre for more information.

See Also

lnre for more information about LNRE models and how to initialize them, LNRE for type density and distribution functions (which represent the prior distribution).

Examples

Run this code
# NOT RUN {
## TODO
  
# }

Run the code above in your browser using DataLab