lnre.spc {zipfR} | R Documentation |
Compute Expected Frequency Spectrum of LNRE Model (zipfR)
Description
lnre.spc
computes the expected frequency spectrum of a LNRE
model at specified sample size N
, returning an object of class
spc
. Since almost all expected spectrum elements are non-zero,
only an incomplete spectrum can be generated.
Usage
lnre.spc(model, N=NULL, variances=FALSE, m.max=100)
Arguments
model |
an object belonging to a subclass of |
N |
a single positive integer, specifying the sample size |
variances |
if |
m.max |
number of spectrum elements listed in the frequency
spectrum. The default of 100 is chosen to avoid numerical
problems that certain LNRE models (in particular, GIGP) have for
higher |
Details
~~ TODO, if any ~~
Value
An object of class spc
, representing the incomplete expected
frequency spectrum of the LNRE model lnre
at sample size
N
. If variances=TRUE
, the spectrum also includes
variance data.
See Also
spc
for more information about frequency spectra and
links to relevant functions; lnre
for more information
about LNRE models and how to initialize them
Examples
## load Dickens dataset and compute lnre models
data(Dickens.spc)
zm <- lnre("zm",Dickens.spc)
fzm <- lnre("fzm",Dickens.spc, exact=FALSE)
gigp <- lnre("gigp",Dickens.spc)
## calculate the corresponding expected
## frequency spectra at the Dickens size
zm.spc <- lnre.spc(zm,N(Dickens.spc))
fzm.spc <- lnre.spc(fzm,N(Dickens.spc))
gigp.spc <- lnre.spc(gigp,N(Dickens.spc))
## comparative plot
plot(Dickens.spc,zm.spc,fzm.spc,gigp.spc,m.max=10)
## expected spectra at N=100e+8
## and comparative plot
zm.spc <- lnre.spc(zm,1e+8)
fzm.spc <- lnre.spc(fzm,1e+8)
gigp.spc <- lnre.spc(gigp,1e+8)
plot(zm.spc,fzm.spc,gigp.spc,m.max=10)
## with variances
zm.spc <- lnre.spc(zm,1e+8,variances=TRUE)
head(zm.spc)
## asking for more than 50 spectrum elements
## (increasing m.max will eventually lead
## to error, at different threshold for
## the different models)
zm.spc <- lnre.spc(zm,1e+8,m.max=1000)
fzm.spc <- lnre.spc(fzm,1e+8,m.max=1000)
gigp.spc <- lnre.spc(gigp,1e+8,m.max=100) ## gigp breaks first!