lnre.details(zipfR)
lnre.details()所属R语言包:zipfR
Technical Details of LNRE Model Objects (zipfR)
技术的详情LNRE的模型对象(zipfR)
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This manpage describes technical details of LNRE models and parameter estimation. It is intended developers who want to implement new LNRE models, improve the parameter estimation algorithms, or work directly with the internals of lnre objects. All information required for standard applications of LNRE models can be found on the lnre manpage.
该联机帮助页描述的技术细节LNRE模型和参数估计。它的目的是开发谁想要实施新LNRE模式,提高了参数估计算法,或工作直接与lnre对象的内部。 lnre手册页上可以找到的LNRE模型为标准的应用程序所需的所有信息。
Details
详细信息----------Details----------
Most operations on LNRE models (in particular, computation of expected values and variances, distribution function and type distribution, random sampling, etc.) are realized as S3 methods, so they are automatically dispatched to appropriate implementations for the various types of LNRE models (e.g., EV.lnre.zm, EV.lnre.fzm and EV.lnre.gigp for the EV method). For some methods (e.g. estimated variances VV and VVm), a single generic implementation can be used for all model types, provided through the base class (VV.lnre and VVm.lnre for variances).
大多数操作在LNRE模型(特别是,计算的预期值和方差,分布函数和型分布,随机抽样,等等)来实现为S3的方法,因此它们被自动分派到适当的实现为各种类型的LNRE模型(例如,EV.lnre.zm,EV.lnre.fzm和EV.lnre.gigp的EV方法)。对于某些方法(如估计方差VV和VVm),一个通用的实现,可用于所有类型的模型,通过基类(VV.lnre和VVm.lnre差异)。
If you want to implement new LNRE models, have a look at "Implementing LNRE Models" below.
如果你要实施新LNRE模式,“实施LNRE模型”,下面一起来看看。
Important note: LNRE model parameters can be passed as named arguments to the lnre constructor function when they are not estimated automatically from an observed frequency spectrum. For this reason, parameter names must be carefully chosen so that they do not clash with other arguments of the lnre function. Note that because of R's argument matching rules, any parameter name that is a prefix of a standard argument name will lead to such a clash. In particular, single-letter parameters (such as b and c for the GIGP model) should always be written in uppercase (B and C in lnre.gigp).
重要注意事项:LNRE模型参数可以通过命名参数的lnre构造函数的时候都不会自动从所观察到的频谱估计。出于这个原因,必须精心选择的参数名称所以,他们不冲突的其他lnre功能参数。请注意,由于R的参数匹配规则,任何参数的名称,是一个标准的参数名称的前缀,会导致这样的冲突。特别是单字母参数(如为b和c的GIGP模型)应该总是被写成大写(B和C中lnre.gigp的 )。
值----------Value----------
A LNRE model with estimated (or manually specified) parameter values is represented by an object belonging to a suitable subclass of lnre. The specific class depends on the type of LNRE model, as specified in the type argument to the lnre constructor function (e.g. lnre.fzm for a fZM model selected with type="fzm").
估计(或手动指定)参数值表示的一个LNRE模型由属于lnre到一个合适的子类的对象。依赖于特定的类的类型的LNRE模型,type参数的lnre的构造函数中指定的(例如lnre.fzmFZM模型的选择type="fzm")。
All subtypes of lnre object share the same data format, viz. a list with the following components:
所有亚型lnre对象共享相同的数据格式,即。与以下组件的列表:
参数:type
a character string specifying the class of LNRE model, e.g. "fzm" for a finite Zipf-Mandelbrot model
一个字符串指定的类的LNRE模型,例如"fzm"的有限齐普夫曼德尔布罗模型
参数:name
a character string specifying a human-readable name for the LNRE model, e.g. "finite Zipf-Mandelbrot"
一个字符串指定一个人类可读的名字的LNRE模型,例如: "finite Zipf-Mandelbrot"
参数:param
list of named model parameters, e.g. (alpha=.8, B=.01) for a ZM model
命名的模型参数,例如列表(alpha=.8, B=.01)的ZM模型
参数:param2
a list of "secondary" parameters, i.e. constants that can be determined from the model parameters but are frequently used in the formulae for expected values, variances, etc.; e.g. (C=.5) for the ZM model above
的列表的“次要”的参数,即可以从模型中参数的确定,而且还常常用于在预期值,方差等的公式的常数,例如(C=.5)以上的ZM模型
参数:S
population size, i.e. number of types in the population described by the LNRE model (may be Inf, e.g. for a ZM model)
人口规模的人口所描述的LNRE模型的类型,即数字(可能是Inf,例如,对于一个ZM模型)
参数:exact
whether approximations are allowed when calculating expectations and variances (FALSE) or not (TRUE)
是否近似时,允许计算的期望和方差(FALSE)或不(TRUE)
参数:multinomial
whether to use equations for multionmial sampling (TRUE) or independent Poisson sampling (FALSE)
是否使用方程multionmial采样(TRUE)或独立的泊松抽样(FALSE)
参数:spc
an object of class spc, the observed frequency spectrum from which the model parameters have been estimated (only if the LNRE model is based on empirical data)
类的一个对象spc,从所观察到的频谱模型参数的估计(只,如果LNRE模型是基于经验数据)
参数:gof
an object of class lnre.gof with goodness-of-fit information for the estimated LNRE model (only if based on empirical data, i.e. if the spc component is also present)
类的一个对象lnre.gof善良适合的的估计LNRE模型(根据经验数据,也就是说,如果只有spc成分也存在信息)
参数:util
a set of utility functions, given as a list with the following components:
效用函数的一组,与以下组件作为一个列表给出:
update:function with signature (self, param, transformed=FALSE), which updates the parameters of the LNRE model self with the values in param, checks that their values are in the allowed range, and re-calculates "secondary" parameters and lexicon size if necessary. If transformed=TRUE, the specified parameters are translated back to normal scale before the update (see below). Of course, self should be the object from which the utility function was called. update returns a modified version of the object self.
update,与签名(self, param, transformed=FALSE),更新的功能参数的LNRE模型self值param,检查它们的值是在允许的范围内,并重新计算“次要”的参数和词汇的大小,如果必要的。如果transformed=TRUE,指定的参数被转换回正常范围更新前的(见下文)。当然,self应该被称为对象的效用函数。 update的对象self返回修改后的版本。
transform:function with signature (param, inverse=FALSE), which transform model parameters (given as a list in the argument param) to an unbounded range centered at 0, and back (with option inverse=TRUE). The transformed model parameters are used for parameter estimation, so that unconstrained minimization algorithms can be applied. The link function for the transformation depends on the LNRE model and the "distribution" of each parameter. A felicitous choice can be crucial for robust and quick parameter estimation, especially with Newton-like gradient algorithms. Note that setting all transformed parameters to 0 should provide a reasonable starting point for the parameter estimation.
transform:签名(param, inverse=FALSE),将一个无限的范围内以0为中心的模型参数(给出的列表中的参数param),和背部(选项“inverse=TRUE与功能)。用于参数估计的转化的模型参数,所以,可以应用于无约束最小化算法。链接功能的改造取决于上的LNRE的模型和“分配”的每个参数。稳健和快速的参数估计,一个恰当的选择是至关重要的,特别是与牛顿梯度算法。请注意,所有的转换参数设置为0,应该提供一个合理的出发点参数估计。
print:partial print method for this subclass of LNRE model, which displays the name of the model, its parameters, and optionally some additional information (invoked internally by print.lnre and summary.lnre)
print:偏印的方法此子类LNRE模型,该模型显示的模型,它的参数的名称,以及一些可选的附加信息(内部调用print.lnre和summary.lnre)
实施LNRE模型----------Implementing LNRE Models----------
In order to implement a new class of LNRE models, the following steps are necessary (illustrated on the example of a lognormal type density function, introducing the new LNRE class lnre.lognormal):
为了实现一个新的类的LNRE模型,下面的步骤是必要的(对数正态型密度函数的例子,说明引入新的LNRE类lnre.lognormal):
Provide a constructor function for LNRE models of this type (here, lnre.lognormal), which must accept the parameters of the LNRE model as named arguments with reasonable default values (or alternatively as a list passed in the param argument). The constructor must return a partially initialized object of an appropriate subclass of lnre (lnre.lognormal in our example), and make sure that this object also inherits from the lnre class.
这种类型的LNRE模型提供一个构造函数(在这里,lnre.lognormal),必须接受合理的默认值(或者通过一个列表,在param命名参数的LNRE模型的参数参数)。构造函数必须返回一个合适的子类的一个部分初始化的对象lnre(lnre.lognormal在我们的例子),并确保这个对象也继承自lnre类。
Provide the update, transform and print utility functions for the LNRE model, which must be returned in the util field of the LNRE model object (see "Value" above).
提供update,transform和print实用的功能为的LNRE的模式,必须返回util领域的LNRE模型对象(见上面的“价值” )。
Add the new type of LNRE model to the type argument of the generic lnre constructor, and insert the new constructor function (lnre.lognormal) in the switch call in the body of lnre.
添加新类型的LNRE模型的type参数的通用lnre构造,并插入新的构造函数(lnre.lognormal)switch呼吁在体内的lnre。
As a minimum requirement, implementations of the EV and EVm methods must be provided for the new LNRE model (in our example, they will be named EV.lnre.lognormal and EVm.lnre.lognormal).
作为最低要求,实现EV和EVm方法必须提供的的新LNRE模式(在我们的例子中,他们将被命名为EV.lnre.lognormal和EVm.lnre.lognormal)。
If possible, provide equations for the type density, probability density, type distribution, distribution function and posterior distribution of the new LNRE model, as implementations of the tdlnre, dlnre, tplnre/tqlnre, plnre/qlnre and postplnre/postqlnre methods for the new LNRE model class. If all these functions are defined, log-scaled densities and random number generation are automatically handled by generic implementations.
如果可能的话,提供的类型密度,概率密度,类型,分布,分布函数和后验分布的新LNRE模型,作为tdlnre实现,dlnre,tplnre/方程tqlnre,plnre/qlnre和postplnre/postqlnre的的新LNRE模型类的方法。如果所有这些功能的定义,log规模的密度和随机数生成通用实现自动处理。
Optionally, provide a custom function for parameter estimation of the new LNRE model, as an implementation of the estimate.model method (here, estimate.model.lnre.lognormal). Custom parameter estimation can considerably improve convergence and goodness-of-fit if it is possible to obtain direct estimates for one or more of the parameters, e.g. from the condition E[V] = V. However, the default Nelder-Mead algorithm is robust and produces satisfactory results, as long as the LNRE model defines an appropriate parameter transformation mapping. It is thus often more profitable to optimize the transform utility than to spend a lot of time implementing a complicated parameter estimation function.
(可选),提供自定义功能的参数估计的新LNRE模型,作为estimate.model方法的实现(在这里,estimate.model.lnre.lognormal“)。如果它是可以得到的参数中的一个或多个直接估计,例如,自定义参数估计可以大大提高收敛性和善良配合从的条件E[V] = V。但是,默认内尔德米德算法的鲁棒性和产生令人满意的结果,只要,作为LNRE模型定义了一个适当的参数的转换映射。因此,这是往往更有利可图的优化transform实用,而不是花大量的时间实施一个复杂的参数估计功能。
The best way to get started is to take a look at one of the existing implementations of LNRE models. The GIGP model represents a "minimum" implementation (without custom parameter estimation and distribution functions), whereas ZM and fZM provide good examples of custom parameter estimation functions.
以开始浏览网页的最佳方式是在一个现有的实现LNRE模型来看看。 GIGP模型代表“最低”的执引号况(不包括自定义的参数估计和分布函数),而ZM和FZM提供了很好的例子,自定义的参数估计功能。
参见----------See Also----------
User-level information about LNRE models and parameter estimation can be found on the lnre manpage.
用户级别信息LNRE模型和参数估计可以找到lnre联机帮助。
Descriptions of the different LNRE models implemented in zipfR and their parameters are given on separate manpages lnre.zm, lnre.fzm and lnre.gigp. These descriptions are intended for interested end users, but are not required for standard applications of the models.
在zipfR和它们的参数在不同的联机帮助页的的不同的LNRE模型的描述lnre.zm,lnre.fzm和lnre.gigp。这些描述的目的是为有兴趣的最终用户,但不要求为标准的应用程序的模型。
The estimate.model manpage explains details of the parameter estimation procedure (intended for developers).
estimate.model manpage解释详细的参数估计程序(用于开发)。
See lnre.goodness.of.fit for a description of the goodness-of-fit test performed after parameter estimation of an LNRE model. This function can also be used to evaluate the predictions of the model on a different data set.
见lnre.goodness.of.fit善良的拟合优度检验后的LNRE模型的参数估计进行的描述。上的不同的数据集,该功能也可以被用来评估的模型的预测。
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|