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

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

[复制链接]
发表于 2012-9-29 21:04:16 | 显示全部楼层 |阅读模式
Analyze(RxCEcolInf)
Analyze()所属R语言包:RxCEcolInf

                                        Workhorse Function for Ecological Inference for Sets of R x C Contingency Tables
                                         主力生态推理功能集的R X C列联表

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

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

This function (using the tuned parameters from Tune) fits a hierarchical model to ecological data in which the underlying contigency tables can have any number of rows or columns.  The user supplies the data and may specify hyperprior values.  Samples from the posterior distribution are returned as an mcmc object, which can be analyzed with functions in the coda package.
这的功能(使用调谐参数,从Tune)适合的层次结构模型的生态数据,其中的基础contigency表可以有任意数量的行或列。用户提供的数据和可以指定hyperprior值。从后验分布的样品作为mcmc对象coda包中的功能,它可以分析返回。


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


Analyze(fstring, rho.vec, data = NULL, num.iters = 1e+06,
        save.every =1000, burnin = 10000,
        mu.vec.0 = rep(log((0.45/(mu.dim - 1))/0.55), mu.dim),
        kappa = 10, nu = (mu.dim + 6), psi = mu.dim,  
        mu.vec.cu = runif(mu.dim, -3, 0), NNs.start = NULL,
        THETAS.start = NULL, prob.re = 0.15, sr.probs = NULL,
        sr.reps = NULL, keep.restart.info = FALSE,
        keepNNinternals = 0, keepTHETAS = 0, nolocalmode = 50,
        numscans = 1, Diri = 100, dof = 4, print.every = 10000,
        debug = 1)



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

参数:fstring
String: model formula of contingency tables' column totals versus row totals. Must be in specified format (an R character string and NOT a true R formula). See Details and Examples.
字符串:模型公式的列联表的列的数量与行总计。必须在指定的格式(R字符的字符串,而不是一个真正的R公式)。查看详细信息和例子。


参数:rho.vec
Vector of dimension I = number of contigency tables = number of rows in data: multipliers (usually in (0,1)) to the covariance matrix of the proposal distribution for the draws of the intermediate level parameters. Typically set to the vector output from Tune.
向量的维I数= contigency表的行数data:的乘数(通常是在(0,1))的建议分布的协方差矩阵的绘制的中间级别的参数。通常情况下设置为Tune的矢量输出。


参数:data
Data frame.
数据框。


参数:num.iters
Positive integer: The number of MCMC iterations for the sampler.
正整数:MCMC采样迭代的数量。


参数:save.every
Positive integer: The interval at which the draws will be saved. num.iters must be divisible by this value. Akin to thin in some packages. For example, num.iters     = 1000 and save.every = 10 outputs every 10th draw for a total of 100 outputed draws.
正整数的绘制将被保存的时间间隔。 num.iters必须整除这个值。类似于thin在一些包的。例如,num.iters     = 1000和save.every = 10输出每10个抽奖共100 outputed画。


参数:burnin
Positive integer: The number of burn-in iterations for the sampler.
正整数:燃烧的采样迭代的数量。


参数:mu.vec.0
Vector:  mean of the (normal) hyperprior distribution for the mu parameter.
向量:指(正常)hyperprior的分布mu参数。


参数:kappa
Scalar:  The diagonal of the covariance matrix for the (normal) hyperprior distribution for the mu parameter.
标量:(正常)hyperpriormu参数分布的协方差矩阵的对角线。


参数:nu
Scalar:  The degrees of freedom for the (Inverse-Wishart) hyperprior distriution for the SIGMA parameter.
标量的自由度为SIGMA参数的的(反威沙特)hyperprior distriution的。


参数:psi
Scalar:  The diagnoal of the matrix parameter of the (Inverse-Wishart) hyperprior distribution for the SIGMA parameter.
标量:diagnoal(反威沙特的)hyperprior分布的SIGMA参数的矩阵参数。


参数:mu.vec.cu
Vector of dimension R*(C-1), where R(C) is the number of rows(columns) in each contigency table:  Optional starting values for mu parameter.
向量的维R*(C-1),其中R(C)的行数(列)在每个contigency表:可选mu参数的初始值。


参数:NNs.start
Matrix of dimension I x (R*C), where I is the number of contingency tables = number of rows in data:  Optional starting values for the internal cell counts, which must total to the continency table row and column totals contained in data.  Use of the default (randomly generated internally) recommended.
矩阵的维IX(R*C),其中I是数列联表中的行数data:可选内部的单元计数的初始值,这必须总要continency表格的行和列中包含的data总额。使用默认的(内部随机产生的)建议。


参数:THETAS.start
Matrix of dimension I x (R*C), where I is the number of contingency tables = number of rows in data:  Optional starting values for the contingency table row probability vectors.  The elements in each row of THETAS.start must meet R sum-to-one constraints.  Use of the default (randomly generated internally) recommended.
矩阵的维IX(R*C),其中I是数列联表中的行数data:可选的初始值的列联表行的概率向量。的元素在每一行THETAS.start必须满足R总和到一约束。使用默认的(内部随机产生的)建议。


参数:prob.re
A positive fraction:  Probability of random exchange in a parallel tempering fitting algorithm.  Not yet implemented.
一个积极的部分:概率在一个平行的回火拟合算法的随机交换。尚未实施。


参数:sr.probs
Matrix of dimension I x R:  Each value represents the probability of selecting a particular contingency table's row as the row to be calculated deterministically in (product multinomial) proposals for Metropolis draws of the internal cell counts.  For example, if R = 3 and row 2 of position sr.probs = c(.1, .5, .4), then in the third contingency table (correspoding to the third row of data), the proposal algorithm for the interior cell counts will calculate the third contingency table's first row deterministically with probability .1, the second row with probability .5, and the third row with probability .4.  Use of default (generated internally) recommended.
维矩阵IXR:每个值代表的概率,选择一个特定的应变表的行,作为行计算确定性在(产品多项式)都市建议利用内部单元计数。例如,如果R = 3和第2行的位置sr.probs= C(0.1,0.5,0.4),然后在第三列联表(correspodingdata)到第三行,用于室内的单元计数,将计算出的第三应变表的第一行的建议算法确定性的概率为0.1的概率为0.5,,第二行和第三行的概率是0.4。建议使用默认值(内部产生)。


参数:sr.reps
Matrix of dimension I x R:  Each value represents the number of times the (product multinomial proposal) Metropolis algorithm will be attempted when, in drawing the internal cell counts, the proposal for the corresponding contingency table row is to be calculated deterministically.  sr.reps has the same structure as sr.probs, i.e., position [3,1] of sr.reps corresponds to the third contingency table's first row.  Use of default (generated internally) recommended.
矩阵的维IXR:每个值表示的次数(产品多项建议)Metropolis算法将尝试时,在制定内部的单元计数,相应的应急表行的建议是确定性计算。 sr.reps具有相同的结构,[3,1] sr.reps作为sr.probs,即,位置对应于第三列联表的第一行。建议使用默认值(内部产生)。


参数:keep.restart.info
Logical:  Whether last state of the chain should be saved to allow restart in the same state.  Restart function not currently implemented.
逻辑链的最后一个状态是否应该被保存在同一个国家允许重新启动。重新启动功能目前尚未实现。


参数:keepNNinternals
Positive integer:  The number of draws of the internal cell counts in the contingency tables to be outputted. Must be divisible into num.iters.  Use with caution:  results in large RAM use even in modest-sized datasets.
正整数的数目绘制的内部单元计数输出的列联表。可分为num.iters。请谨慎使用:在大容量的RAM使用,即使在中等规模的数据集。


参数:keepTHETAS
Positive integer:  The number of draws of the contingency table row probability vectors in the contingency tables to be outputted. Must be divisible into num.iters.   Use with caution:  results in large RAM use even in modest-sized datasets.
正整数的数目绘制的概率向量输出的列联表列联表行。可分为num.iters。请谨慎使用:在大容量的RAM使用,即使在中等规模的数据集。


参数:nolocalmode
Positive integer:  How often an alternative drawing method for the contigency table internal cell counts will be used. Use of default value recommended.
正整数:多久为contigency表内部的单元计数的另一种绘图方法将被使用。使用默认值建议。


参数:numscans
Positive integer:  How often the algorithm to draw the contingency table internal cell counts will be implemented before new values of the other parameters are drawn.  Use of default value recommended.
正整数多久实施前的其他参数的新值的算法绘制列联表的内部单元计数绘制。使用默认值建议。


参数:Diri
Positive integer:  How often a product Dirichlet proposal distribution will be used to draw the contingency table row probability vectors (the THETAS).
正整数:往往是一个产品狄利克雷分配提案将被用于绘制列联表行的概率向量(THETAS)。


参数:dof
Positive integer:  The degrees of freedom of the multivariate t proposal distribution used in drawing the contingency table row probability vectors (the THETAS).
正整数:度自由的多元t的分配提案用于绘制列联表行的概率向量(THETAS)的。


参数:print.every
Positive integer:  If debug == 1, the number of every print.everyth iteration will be written to the screen.  Must be divisible into num.iters.
正整数:如果debug == 1“的数量每print.every”th迭代将被写入到屏幕上。可分为num.iters。


参数:debug
Integer:  Akin to verbose in some packages.  If set to 1, certain status information (including rough notification regarding the number of iterations completed) will be written to the screen.
整数:类似于verbose的一些包。如果一定的状态信息(包括粗糙的通知,关于完成的反复数)设置为1,将被写入到屏幕上。


Details

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

Analyze is the workhorse function in fitting the R x C ecological inference model described in Greiner & Quinn (2009).
Analyze是主力函数拟合的R X C生态描述的在格雷纳与奎因(2009)的推理模型。

Ecological data consist of sets of contingency tables in which the row and column totals, but none of the internal cell counts, are observed.  For example, in the context of voting rights litigation, there is often one contigency table for each voting precinct; the row totals are voting-age population figures, with each row representing a race/ethnicity; all but the last (right-most) column representing votes cast for particular candidates; and the last (right-most) column representing persons not voting.
生态数据包括套的应急表的行和列的总数,而没有内部的单元计数,都观察到。例如,在投票权诉讼的背景下,每个选区往往是contigency表的行总计是投票年龄的人口数字,每一行代表一个种族/族裔;所有,但最后(最右边)列代表选票投给特定候选人的最后一个(最右边)的列代表未参加表决。

The model described in Greiner & Quinn (2009) conditions on the row totals throughout. In each contigency table, the rows are assumed to follow mutually independent multinomials, conditional on separate probability vectors which are denoted θ_r for r = 1 to R (R being the number of rows in each contigency table). Each θ_r then undergoes a multidimensional logistic transformation, using the last (right-most) column as the reference category. This results in R transformed  vectors of dimension (C-1); these transformed vectors, denoted omega_r's, are stacked to form a single omega vector corresponding to that contingency table. The omega vectors are assumed to follow (i.i.d.)  a multivariate normal distribution. A standard N(mu, kappa * I) and Inv-Wish(nu, psi * I) (I is the identity matrix) prior is placed on the normal. The user may set mu, kappa, nu, amd psi.
格雷纳与奎因(2009)描述的模型条件的行总数各地。在每个contigency表,该行被假定为遵循相互独立的的多项式,有条件在不同的概率向量表示θ_rr = 1R(R是一些行在每个contigency表)。每一个θ_r,然后经历了一个多层面的MF改造,使用的最后一个(最右边)的列作为参考类别。这结果在R转化维向量(C-1);这些转化的向量,表示omega_r's,堆叠,以形成一个单一的omega矢量对应于该列联表。欧米茄向量假定服从多元正态分布(IID)。一个标准的N(mu,kappa* I)和INV的愿望(nu,psi* I)(我是单位矩阵)之前被放置在正常的。用户可以设置mu,kappa,:nuAMDpsi。

fstring must be in a specific format.  It must be a string, and it must consist of (i) the names of vectors of contingency table column totals separated by commas, (ii) then a tilde, (iii) then the names of vectors of contingency table row totals separated by commas. The order in which the contigency table column totals are listed is important because the final column with become the reference category in the multidimensional logistic transformation described above.  See Examples.
fstring必须是在一个特定的格式。它必须是一个字符串,它必须包括(一)应急表的列向量的名字总额由逗号分隔,(ii)然后一个波浪线,(三)总额由逗号分隔的名字列联表行向量。列出的顺序contigency表列总计成为最后一列是很重要的,因为在上述的多维MF转型的参考类别。请参阅示例。

Fitting the model is accomplished via a Gibbs sampler in which the internal cell counts (for each contingency table), then the thetas, and then the mu and Sigma parameters are drawn in turn.  This method automatically produces draws of the internal cell counts, functions of which are often the true targets of inference.
拟合模型经由Gibbs采样完成,其中内部的单元计数(每一意外事件表),然后thetas,然后mu和反过来Sigma参数绘制。这种方法自动生成绘制的内部单元的数量,这往往是真正的目标推理的功能。

The function returns an object of class mcmc suitable for use in functions from the coda package, including combination (with other outputs from Analyze) into an object of class mcmc.list. The return object includes draws from the posterior distribution of the following items:  each element of the mu; the standard deviations in Sigma (meaning the square root of the diagonal elements); the correlations in Sigma; the sums across all contigency tables of the counts in each of the R * C internal cell positions; and a series of functions of these sums that are often of interest in voting applications (these may obviously be ignored if interest lies elsewhere).  Except for the correlations from Sigma, the labeling follows a self-evident pattern, with the names taking from fstring.  The correlations are labeled by a combination of two numbers, representing their position in the Sigma matrix.
该函数返回一个类的MCMC适合使用功能的尾波包,其中包括一个类mcmc.list对象的组合(与其他产出分析),到对象的。返回的对象包括吸引了来自下列项目的后验分布:每个元素的mu; Sigma(即对角线元素的平方根);的相关性标准偏差<X >的款项,在所有的contigency表中的计数R * C内部的单元位置等一系列的功能,这些款项往往在投票应用程序的兴趣(这可以显着不容忽视的兴趣在于其他地方) 。除为Sigma的相关性,标签如下一个不言自明的模式,的名字Sigma。标记的两个数字的组合,代表他们的位置在fstring矩阵的相关性。

The series of functions of the internal cell counts calculated automatically fall into four categories: LAMBDA, TURNOUT, GAMMA, and Beta. To explain these terms, consider an example in which the contigency tables have three rows ("bla", "whi", and "his") and three columns ("Dem", "Rep", "Abs"), corresponding to black, white, Hispanic, Democratic, Republican, and Abstain (from voting). Thus, in position 1,1 of each contigency table is the (unobserved) number of blacks voting Democrat, position 2,1 holds the (unobserved) number of whites voting Democrat, etc. In each position (1,1 = black Democrat votes; 2,1 = white Democrat votes), sum across all I contingency tables to produce a single R x C table consisting of summed counts (these sums are, incidentally, the NN values the software reports). LAMBDA, TURNOUT, GAMMA, and Beta are functions of these summed counts, as explained in the paragraph below. Note that the paragraph below refers to the counts in the single table produced by this summing process. Notation: NN_rc is the sum (over all contingency tables) of the counts in cell r,c. So NN_bD is the total number of blacks voting Democract, NN_wD is the total number of whites voting Democrat, etc.
该系列自动计算功能的内部单元计数下降分为四类:LAMBDA,TURNOUT,GAMMA和Beta。为了解释这些条款,考虑了一个例子,contigency表有三行(“喇嘛”,“滔”,“他”)和三列(“DEM”,“精华”,“ABS” ;),以黑,白,西班牙裔美国人,民主党,共和党,投弃权票(投票)。因此,在位置1,1的每个contigency表(不可观察的)黑人投票的民主党人,位置2,1持有的白人投票的民主党人,在每个位置(不可观察的)(1,1 =黑色民主党票2,1 =白色民主党票),在所有I列联表的总和产生一个单一的R X C表总结计数(顺便说一下,这些钱是NN重视软件报告)。 LAMBDA,TURNOUT,GAMMA和Beta是总结计数的这些功能,作为在下面的段落解释。请注意,以下的该段是指在单个表,通过这个加法处理产生的计数。符号:NN_rc的总和(所有列联表),单元R,C中的计数。所以NN_bD是总数的黑人投票的民主政治,NN_wD是投票总数的白人民主党等

LAMBDA: For example, LAMBDA_bD = NN_bD/(NN_b - NN_bA).  Similarly, LAMBDA_hR =  NN_hR/(NN_h - NN_hA). In voting parlance, this the fraction of each race's voters supporting a particular candidate. There are R * (C-1) LAMBDAs, C-1 of them for each row.
LAMBDA:例如,LAMBDA_bD=NN_bD/(NN_b - NN_bA)。同样,LAMBDA_hR=NN_hR/(NN_h - NN_hA)。在投票的说法,这部分的每场比赛的选民支持某候选人。有R * (C-1)lambda表达式,C-1他们的每一行。

TURNOUT: For example, Turnout_w = (NN_w - NN_wA)/NN_w. In voting  parlance, this is the fraction of each race that showed up to vote. There are R TURNOUTs, one for each row.
TURNOUT:例如,Turnout_w = (NN_w - NN_wA)/NN_w的。在投票的说法,这是每场比赛的分数了投票。有R道岔,每行一个。

GAMMA: For example, GAMMA_h = (NN_hD + NN_hR)/(NN_bD + NN_bR + NN_wD + NN_wR + NN_hD +   NN_hR). In voting parlance, this is the fraction that each race contributes to the voting electorate.
GAMMA:例如,GAMMA_h=(NN_hD + NN_hR)/(NN_bD + NN_bR + NN_wD + NN_wR + NN_hD +   NN_hR)。在投票的说法,这是每场比赛的投票选民的比例。

BETA: For example, BETA_wR = (NN_wR)/(NN_wD + NN_wR + NN_wA) =   (NN_wR)/(NN_w). This is the fraction of each race's potential (as opposed to actual) voters supporting a particular candidate. Although there are theoretically R * C BETA values that could be calculated, in fact the BETA values for the last (reference) category are ignored, so only R * (C-1) are calculated.
BETA:例如,BETA_wR=(NN_wR)/(NN_wD + NN_wR + NN_wA) =   (NN_wR)/(NN_w)。这是每个种族的电位(而不是实际的)选民支持某候选人的馏分。虽然有理论上R * CBETA值,可以计算出,事实上,BETA在过去的类别(参考)值将被忽略,因此,只有R * (C-1)计算。

If keepNNinternals is non-zero, the specified number of draws of the internal cell counts for each contingency table will be save. These may be retreived via attr (see Examples, below).  The result is a matrix of dimension keepNNinternals x R * C * I, where I is the number of contigency tables.  Each row consists of an iteration's draws.  The first column contains the draws of the counts in position 1,1 in the first contigency table, the second colum contains the draws of position 1,2 in the first contigency table, etc.  In other words, the columns in the output represent the first contigency table vectorized row major, then the second contingency table vectorized row major, etc. The same applies to keepTHETAS, except that the THETAs
如果keepNNinternals是非零值,指定数量的绘制每一意外事件表的内部的单元计数,将被保存。这些可能是retreived通过attr(见例,下同)。结果是一个矩阵的维度keepNNinternalsx R * C * I,其中I是contigency表数。每行由一个迭代的绘制。第一列包含利用1,1在第一contigency表位置的计数,所述第二柱包含在第一contigency表,等绘制的位置1,2换句话说,在输出中的列代表第一contigency表行的主要量化的,那么第二个量化的应急表行的主要,等同样适用于keepTHETAS,除了THETA的


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

An object of class mcmc suitable for use in functions in the coda package.  Additional items, listed below, may be retrieved from this object, as detailed in the examples section.
类的一个对象mcmc适合在尾波包中的功能中使用。下面列出的其他项目,则可以从这个对象,在示例一节。


参数:dim
Vector (integers) of length 2: number of saved simulations and number of automatically outputted parameters.
长度为2的向量(整数):保存的模拟和数字自动输出参数的数量。


参数:dimnames
List: the first element NULL (currently not used), and the second element is a vector of the names of the automatically outputted parameters.
原价:第一元件NULL(目前没有使用),和所述第二元件是一个向量,自动输出的参数的名称。


参数:acc.t
Vector of length I = number of contigency tables:  The fraction of multivariate t proposals accepted in the Metropolis algorithm used to draw the THETAs (meaning the intermediate parameters in the hierarchy).
向量的长度I数= contigency表:分数多元t建议Metropolis算法用于绘制THETA(即在层次结构中的中间参数)在接受。


参数:acc.Diri
Vector of length I = number of contigency tables:  The fraction of Dirichlet-based proposals accepted in the Metropolis algorithm used to draw the THETAs (meaning the intermediate parameters in the hierarchy).
向量的长度I= contigency表:狄利克雷为基础的建议,接受Metropolis算法用于绘制THETA(即在层次结构中的中间参数)的小数部分。


参数:vld.multinom
Matrix:  To draw from the conditional posterior of the internal cell counts of a contigency table, the Analyze function draws R-1 vectors of lenth C from multinomial distributions.  In then calculates the counts in the additional row (denote this row as r') deterministically.  This procedure can result in negative values in row r', in which case the overall proposal for the interior cell counts is outside the parameter space (and thus invalid). vld.multinom keeps track of the percentage of proposals drawn in this manner that are valid (i.e., not invalid).  Each row of vld.multinom corresponds to a contingency table.  Each column in vld.multinom corresponds to a row in the a contingency table.  Each entry specifies the percentage of multinomial proposals that are valid when the specified contingency table row serves as the r' row.  For instance, in position 5,2 of vld.multinom is the fraction of valid proposals for the 5th contingency table when the second contigency table row is the r'th row.  A value of &ldquo;NaN&rdquo; means that Analyze chose to use a different (slower) method of drawing the internal cell counts because it suspected that the multinomial method would behave badly.
矩阵:要绘制的条件后,内部单元计数的contigency表,Analyze函数绘制R-1向量;长度&#231;多项式分布。在计算额外的行计数(R)表示该行确定的。此过程可以导致在行r,在这种情况下的整体方案的内部单元计数以外的参数空间(并因此是无效的)的负值。 vld.multinom跟踪以这种方式得出的提案,是有效的(即,不是无效的)的百分比。每一行的vld.multinom对应的列联表。 vld.multinom中的每一列联表中的行。每个条目指定的百分比是有效的多项建议,在指定的列联表行作为R行。例如,在位置5,2 vld.multinom是当所述第二contigency表行是rth行第五列联表的有效的建议的馏分。 “南”的值意味着Analyze选择使用一个不同的(更慢)制定的内部单元计数的方法,因为它怀疑,多项式法的行为严重。


参数:acc.multinom
Matrix:  Same as vld.multinom, except the entries represent the fraction of proposals accepted (instead of the fraction that are in the permissible parameter space).
矩阵:vld.multinom相同,除外的条目表示接受的提案(而不是,在允许的参数空间的馏分)的馏分。


参数:numrows.pt
Integer:  Number of rows in each contingency table.
整数:在每一个列联表的行数。


参数:numcols.pt
Integer:  Number of columns in each contingency table.
整数:在每一个列联表的列数。


参数:THETA
mcmc:  Draws of the THETAs.  See Details and Examples.
MCMC:绘制的THETA的。查看详细信息和例子。


参数:NN.internals
mcmc:  Draws of the internal cell counts.  See Details and Examples.
MCMC:绘制的内部单元计数的。查看详细信息和例子。


警告----------Warnings----------

<STRONG>Computer time:</STRONG> At present, using this function (and the others in this package) requires substantial computer time.  The lack of information in ecological data results in slow mixing chains, and the number of parameters that must be drawn in each Gibbs sampler iteration is large.  Chain length should be adjusted to achieve adequate convergence.  In general, the more segregated the housing patterns in the jurisdiction (meaning the greater the percentage of contingency tables in which one row's counts make up a large portion of that table's total), the smaller the number of iterations needed.  We are exploring more efficient sampling algorithms that we anticipate will result in better mixing and faster drawing.  At present, however, users should anticipate that analysis of a dataset will take several hours.
<STRONG>电脑时间:</ STRONG>目前,使用此功能(和其他人在此程序包),需要大量的计算机时间。必须绘制在每个Gibbs采样迭代缺乏信息的的生态数据结果在缓慢的搅拌链,参数的数量是很大的。链长应进行调整,以达到适当的收敛。在一般情况下,多个独立的住房模式,这意味着更大的列联表中,一排数的比例占了很大一部分,该表的总的管辖范围,所需的迭代次数较小的。我们正在探索更有效的采样算法,我们预期将导致更好的混合和更快的绘图。然而,目前,用户应预期,分析数据集将需要几个小时。

<STRONG>Large datasets:</STRONG> At present, use of this fuction (and thus this package) is not recommended for large (i.e., more than 1000 contingency tables) datasets. See immediately above.
<STRONG>大型数据集:</ STRONG>目前,本机能的使用(因此这个包),不建议大(即超过1000列联表)的数据集。正上方。

<STRONG>RAM requirements:</STRONG> Do not select large values of keepNNinternals or keepTHETAS without adequate RAM.
<STRONG> RAM的要求:</ STRONG>不要选择大的值keepNNinternals或keepTHETAS没有足够的RAM。

<STRONG>Gelman-Rubin diagnostic in the CODA package:</STRONG> Using the Gelman-Rubin convergence diagnostic as presently implemented in the CODA package (called by gelman.diag()) on multiple chains produced by Analyze will cause an error. The reason is that some of the NN.internals and functions of them (&Lambda;'s, TURNOUTs, &Gamma;'s, and &beta;'s) are linearly dependant, and the current coda implmentation of gelman.diag()
<STRONG>格尔曼·鲁宾诊断在CODA包:</ STRONG>使用格尔曼鲁宾收敛诊断,目前实施中的的CODA包(称为gelman.diag())通过分析多个连锁将导致一个错误。的原因是,一些他们的NN.internals和功能(&Lambda;'s,TURNOUTs,&Gamma;'s,和&beta;'s)是线性相关的,并且当前的次谓语安装启用业务的gelman.diag()


(作者)----------Author(s)----------


D. James Greiner, Paul D. Baines, \&amp; Kevin M. Quinn



参考文献----------References----------

Inference:  Bounds, Correlations, Flexibility, and Transparency of Assumptions.&rdquo; J.R. Statist. Soc. A 172:67-81.
Output Analysis and Diagnostics for MCMC (CODA). http://www-fis.iarc.fr/coda/

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


## Not run: [#不运行:]
library(RxCEcolInf)
data(stlouis)
Tune.stlouis <- Tune("Bosley, Roberts, Ribaudo, Villa, NoVote ~ bvap, ovap",
                     data = stlouis,
                     num.iters = 10000,
                     num.runs = 15)
Chain1.stlouis <- Analyze("Bosley, Roberts, Ribaudo, Villa,
                           NoVote ~ bvap, ovap",
                          rho.vec = Tune.stlouis$rhos,
                          data = stlouis,
                          num.iters = 1500000,
                          burnin = 150000,
                          save.every = 1500,
                          print_every = 15000,
                          debug = 1,
                          keepNNinternals = 100,
                          keepTHETAS = 100)
Chain2.stlouis <- Analyze("Bosley, Roberts , Ribaudo, Villa,
                           NoVote ~ bvap, ovap",
                          rho.vec = Tune.stlouis$rhos,
                          data = stlouis,
                          num.iters = 1500000,
                          burnin = 150000,
                          save.every = 1500,
                          print_every = 15000,
                          debug = 1,
                          keepNNinternals = 100,
                          keepTHETAS = 100)
Chain3.stlouis <- Analyze("Bosley, Roberts , Ribaudo, Villa,
                          NoVote ~ bvap, ovap",
                          rho.vec = Tune.stlouis$rhos,
                          data = stlouis,
                          num.iters = 1500000,
                          burnin = 150000,
                          save.every = 1500,
                          print_every = 15000,
                          debug = 1,
                          keepNNinternals = 100,
                          keepTHETAS = 100)
stlouis.MCMClist <- mcmc.list(Chain1.stlouis, Chain2.stlouis,
Chain3.stlouis)
names(attributes(stlouis.MCMClist))
summary(stlouis.MCMClist, quantiles = c(.025, .05, .5, .95, .975))
plot(stlouis.MCMClist)
geweke.diag(stlouis.MCMClist)
heidel.diag(stlouis.MCMClist)
#  Do not run gelman.diag; see warnings[不要运行gelman.diag看到警告]
NNs <- attr(stlouis.MCMClist, "NN.internals")
THETAS <- attr(stlouis.MCMClist, "THETA")

## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-28 22:35 , Processed in 0.029322 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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