Compute Expected Frequency Spectrum of LNRE Model (zipfR)
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.
lnre.spc(model, N=NULL, variances=FALSE, m.max=100)
model |
an object belonging to a subclass of |
N |
a single positive integer, specifying the sample size N for which the expected frequency spectrum is calculated (defaults to same sample size as used for estimating the model) |
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 m. If variance data is included, the default value is automatically reduced to 50. |
~~ TODO, if any ~~
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.
## 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!
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.