找回密码
 注册
查看: 1220|回复: 0

R语言 zipfR包 spc()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-2 07:50:16 | 显示全部楼层 |阅读模式
spc(zipfR)
spc()所属R语言包:zipfR

                                        Frequency Spectra (zipfR)
                                         频谱(zipfR)

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

In the zipfR library, spc objects are used to represent a word frequency spectrum (either an observed spectrum or the expected spectrum of a LNRE model at a given sample size).
在zipfR图书馆,spc对象被用来表示一个字的频谱(无论是一个观察到的频谱或预期频谱一个LNRE模型在给定采样大小)。

With the spc constructor function, an object can be initialized directly from the specified data vectors.  It is more common to read an observed spectrum from a disk file with read.spc or compute an expected spectrum with lnre.spc, though.
spc构造函数,可以直接初始化一个对象从指定的数据向量。这是比较常见的观测谱从磁盘文件读read.spc或计算的预期光谱lnre.spc,虽然。

spc objects should always be treated as read-only.
spc对象应始终被视为只读。


用法----------Usage----------



  spc(Vm, m=1:length(Vm), VVm=NULL, N=NA, V=NA, VV=NA,
      m.max=0, expected=!missing(VVm))




参数----------Arguments----------

参数:m
integer vector of frequency classes m (if omitted, Vm is assumed to list the first k frequency classes V_1, …, V_k)
整数向量的频度等级m(如果省略,Vm假设列出的第一个k的频度等级V_1, …, V_k)


参数:Vm
vector of corresponding class sizes V_m (may be fractional for expected frequency spectrum E[V_m])
向量的相应的班级规模V_m(可能是小数预期频谱E[V_m])


参数:VVm
optional vector of estimated variances Var[V_m] (for expected frequency spectrum only)
可选的向量的估计方差Var[V_m](预期频谱)


参数:N, V
total sample size N and vocabulary size V of frequency spectrum.  While these values are usually determined automatically from m and Vm, they are required for an incomplete frequency spectrum that does not list all non-empty frequency classes.
总样本量N和词汇量的大小V频谱。虽然这些值通常是自动确定m和Vm,他们都需要一个不完整的频谱,并没有列出所有非空频度等级。


参数:VV
variance Var[V] of expected vocabulary size.  If VVm is specified, VV should also be given.
方差Var[V]预期的词汇量的大小。如果VVm指定,VV应该也可以。


参数:m.max
highest frequency class m listed in incomplete spectrum.  If m.max is set, N and V also have to be specified, and all non-zero frequency classes up to m.max have to be included in the input vectors.  Frequency classes above m.max in the input will automatically be deleted.
频率最高的类m中列出不完整的光谱。 m.max如果设置,N和V也有规定,所有非零频度等级高达m.max必须被包含在输入向量。上述的m.max的频率类的输入将被自动删除。


参数:expected
set to TRUE if the frequency spectrum represents expected values E[V_m] of the class sizes according to some LNRE model (this is automatically triggered when the VVm argument is specified).
设置为TRUE的频谱的代表预期值E[V_m]之类的尺寸根据一些LNRE模型(这是自动触发时,VVm指定参数)。


Details

详细信息----------Details----------

A spc object is a data frame with the following variables:
Aspc对象是一个数据框以下因素:




m frequency class m, an integer vector
m频率类m,一个整数向量




Vm class size, i.e. number V_m of types in frequency class m (either observed class size from a sample
Vm每班学生人数,即V_m类型的频度等级m(无论是观察到的班级规模从样本




VVm optional: estimated variance V[V_m] of expected class size (only meaningful for expected spectrum derived
VVm可选:估计方差V[V_m]预期的班级规模(唯一有意义的预期光谱而得

The following attributes are used to store additional information about the frequency spectrum:
以下属性的频谱,用于存储其他信息:




m.max if non-zero, the frequency spectrum is
m.max如果不为零,频谱




N, V sample size N and vocabulary size V of the frequency spectrum.  For a complete frequency spectrum, these values could easily be determined from m and
N, V样本大小N和词汇量的大小V频谱。对于一个完整的频谱,这些值可以很容易地确定m和




VV variance of expected vocabulary size; only present if hasVariances is TRUE.  Note that VV may
VV方差的预期词汇量的大小; hasVariances如果TRUE。需要注意的是VV可能




expected if TRUE, frequency spectrum lists expected class sizes E[V_m] (rather than observed sizes V_m).  Note that the VVm variable is only
expected如果TRUE,频谱列出预期的班级规模E[V_m](而不是观察到的尺寸V_m)。需要注意的是VVm变量是唯一的




hasVariances indicates whether or not the VVm
hasVariances表示是否VVm


值----------Value----------

An object of class spc representing the specified frequency spectrum.  This object should be treated as read-only (although such behaviour cannot be enforced in R).
对象的类spc指定的频谱。这个对象应该被视为只读(虽然这种行为不能被强制执行,在R)。


参见----------See Also----------

read.spc, write.spc, spc.vector, sample.spc, spc2tfl, tfl2spc, lnre.spc, plot.spc
read.spc,write.spc,spc.vector,sample.spc,spc2tfl,tfl2spc,lnre.spc,plot.spc

Generic methods supported by spc objects are print, summary, N, V, Vm, VV, and VVm.
支持的spc对象的通用方法是print,summary,N,V,Vm,VV和VVm。

Implementation details and non-standard arguments for these methods can be found on the manpages print.spc, summary.spc, N.spc, V.spc, etc.
这些方法的执行细节及非标参数上可以找到的手册页print.spc,summary.spc,N.spc,V.spc,等


实例----------Examples----------



## load Brown imaginative prose spectrum and inspect it[#加载布朗的想象力的散文谱和检查]
data(BrownImag.spc)

summary(BrownImag.spc)
print(BrownImag.spc)

plot(BrownImag.spc)

N(BrownImag.spc)
V(BrownImag.spc)
Vm(BrownImag.spc,1)
Vm(BrownImag.spc,1:5)

## compute ZM model, and generate PARTIAL expected spectrum[#计算ZM模型,并产生部分频谱]
## with variances for a sample of 10 million tokens[#10万元标记的样本方差]
zm <- lnre("zm",BrownImag.spc)
zm.spc <- lnre.spc(zm,1e+7,variances=TRUE)

## inspect extrapolated spectrum[#检查推断谱]
summary(zm.spc)
print(zm.spc)

plot(zm.spc,log="x")

N(zm.spc)
V(zm.spc)
VV(zm.spc)
Vm(zm.spc,1)
VVm(zm.spc,1)

## generate an artificial Zipfian-looking spectrum[#产生一个人工Zipfian好看的频谱]
## and take a look at it[#看看它]
zipf.spc <- spc(round(1000/(1:1000)^2))

summary(zipf.spc)
plot(zipf.spc)

## see manpages of lnre, and the various *.spc mapages[#请参阅联机帮助页lnre,各种*。SPC mapages]
## for more examples of spc usage[#更多的例子使用的SPC]


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-24 00:20 , Processed in 0.020467 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表