lnre.goodness.of.fit {UCS}R Documentation

Perform Goodness-of-Fit Evaluation of LNRE Model

Description

Uses the external lnreChi2 program from the lexstats package to evaluate the goodness-of-fit of a LNRE model with a multivariate chi-squared test (Baayen, 2001, Sec. 3.3).

Usage

lnre.goodness.of.fit(model, m.max=Inf, debug=FALSE)

Arguments

model an object representing a LNRE model whose parameters have been estimated from observed word frequency data. The model must provide the write.lexstats method, which creates the necessary data files. Currently, the Zipf-Mandelbrot (ZM, class "zm") and the finite Zipf-Mandelbrot (fZM, class "fzm") model are supported.
m.max highest frequency rank to be included in the evaluation (limited by the number of ranks that the write.lexstats method saves to disk, currently 15)
debug if TRUE, displays output of the lnreChi2 program and does not delete temporary data files

Details

This function relies on the availability of the external lnreChi2 program from the lexstats package, which must be in the user's search path. It uses the write.lexstats function to create the necessary data files in a temporary directory, invokes the lnreChi2 tool, and parses its report file.

All LNRE models that implement a compatible write.lexstats method are supported. Currently, these are objects of class "zm" or "fzm". The object must include observed word frequency data (in components N, V, and spc), which is usually achieved by estimating the model parameters from the observed frequency spectrum.

Value

A data frame with one row and three columns:

X2 the value of the multi-variate chi^2 test statistic
df the degrees of freedom of the approximate chi^2 distribution of the test statistic under the null hypothesis
p the p-value for the test

References

Baayen, R. Harald (2001). Word Frequency Distributions. Kluwer, Dordrecht.

See Also

zm, fzm, write.lexstats


[Package Contents]