est.sc(spatcounts)
est.sc()所属R语言包:spatcounts
Fitting spatial count regression models
装修空间数回归模型
译者:生物统计家园网 机器人LoveR
描述----------Description----------
MCMC algorithm for the Poisson, the GP, the NB, the ZIP and the ZIGP regression models with spatial random effects.
MCMC算法的泊松分布,GP,NB,空间随机效应ZIP和ZIGP的回归模型。
用法----------Usage----------
est.sc(Yin, fm.X, region, model = "Poi", gmat, nmat, totalit,
fm.ga = TRUE, t.i = NULL, phi0 = 1, omega0 = 0, r0 = 1,
beta0 = NULL, gamma0 = NULL, sigma0 = 1, psi0 = 1, Tau = 10,
alpha = 2)
参数----------Arguments----------
参数:Yin
response vector of length n.
长度为n的响应矢量。
参数:fm.X
formula for mean design.
平均设计公式。
参数:region
region of each observation as vector of length n.
作为矢量长度为n的每个观测区域。
参数:model
the regression model. Currently, the regression models "Poi", "NB", "GP", "ZIP" and "ZIGP" are supported. Defaults to 'Poi'.
回归模型。目前,回归模型“POI”,“NB”,“GP”,“ZIP”和“ZIGP”的支持。默认为“POI”。
参数:gmat
spatial adjacency matrix, where entry (i,j) is 1 if region i is a neighbor of region j and 0 else. See data(sim.gmat) for an example.
空间邻接矩阵,其中条目(I,J)是1,如果区域i的区域j和0,否则是邻居。一个例子见数据(sim.gmat)。
参数:nmat
matrix containing the number of neighbors of each region (last column) and the neighbors of each region (first (maximual number of neighbours) columns), filled up by zeros. See data(sim.nmat) for an example.
矩阵(最后一列)的每个区域的邻居,邻居们在每个区域的(第一(邻居)maximual数列),填补了零。一个例子见数据(sim.nmat)。
参数:totalit
number of MCMC iterations, i.e. length of the Markov chain.
数的MCMC迭代次数,即马尔可夫链的长度。
参数:fm.ga
should the spatial random effects be included (defaults to TRUE)?
的空间随机效应(默认为true)?
参数:t.i
exposure vector.
曝光向量。
参数:phi0
starting value for the over-dispersion parameter for GP and ZIGP model.
过度分散为GP和ZIGP的模型参数的初始值。
参数:omega0
starting value for the extra proportion for ZIP and ZIGP model.
开始值的额外比例ZIP和ZIGP的模型。
参数:r0
starting value for the scale paramter for NB model.
NB模型的规模放慢参数的初始值。
参数:beta0
starting values for the regression parameters.
回归参数的初始值。
参数:gamma0
starting values for the spatial paramters.
初始值的空间参数研究。
参数:sigma0
starting value for the spatial hyperparamter of CAR prior.
初始值的的空间hyperparamter的车前。
参数:psi0
starting value for the spatial hyperparamter of CAR prior.
初始值的的空间hyperparamter的车前。
参数:Tau
modifiable normal prior for the regression parameters with variance Tau$^2$.
修改前正常的回归参数方差头$ ^ 2 $。
参数:alpha
modifiable prior distribution of hyperparamter psi (suggested values: 2, 1.5, 1, 0.5, 0).
修改的先验分布hyperparamter磅(建议值:2,1.5,1 0.5,0)。
值----------Value----------
<table summary="R valueblock"> <tr valign="top"><td>acceptb </td> <td> acceptance rate for the regression parameters beta.</td></tr> <tr valign="top"><td>acceptga </td> <td> range of the acceptance rate for the spatial parameters gamma.</td></tr> <tr valign="top"><td>acceptphi </td> <td> acceptance rate for the GP and ZIGP model specific dispersion parameter phi.</td></tr> <tr valign="top"><td>acceptomega </td> <td> acceptance rate for the ZIP and ZIGP model specific extra proportion omega.</td></tr> <tr valign="top"><td>acceptr </td> <td> acceptance rate for the NB model specific scale parameter r.</td></tr> <tr valign="top"><td>acceptpsi </td> <td> acceptance rate for the spatial hyperparameter psi.</td></tr> <tr valign="top"><td>beta </td> <td> are the parameter estimates for the regression parameters beta.</td></tr> <tr valign="top"><td>gamma </td> <td> are the parameter estimates for the spatial parameters gamma.</td></tr> <tr valign="top"><td>invsigsq </td> <td> are the parameter estimates for the inverse spatial hyperparameter sigma$^2$.</td></tr> <tr valign="top"><td>psi </td> <td> are the parameter estimates for the spatial hyperparameter psi.</td></tr> <tr valign="top"><td>phi </td> <td> are the parameter estimates for the GP and ZIGP model specific dispersion parameter phi.</td></tr> <tr valign="top"><td>omega </td> <td> are the parameter estimates for the ZIP and ZIGP model specific extra proportion omega.</td></tr> <tr valign="top"><td>r </td> <td> are the parameter estimates for the NB model specific scale parameter r.</td></tr> <tr valign="top"><td>Coefficients </td> <td> are the number of parameter estimates.</td></tr> <tr valign="top"><td>t.i </td> <td> exposure vector.</td></tr> </table>
<table summary="R valueblock"> <tr valign="top"> <TD>acceptb </ TD> <TD>录取率的回归参数测试。</ TD> </ TR> <TR VALIGN =“”> <TD>acceptga </ TD> <TD>范围内的空间参数的伽玛的录取率。</ TD> </ TR> <tr valign="top"> <TD >acceptphi </ TD> <TD>录取率的的GP和ZIGP模型的特定分散PHI参数。</ TD> </ TR> <tr valign="top"> <TD>acceptomega </ TD> <TD>录取率的ZIP和ZIGP的模型具体的额外比例的omega。</ TD> </ TR> <tr valign="top"> <TD>acceptr </ TD> <TD > NB模型的具体尺度参数的录取率R。</ TD> </ TR> <tr valign="top"> <TD> acceptpsi </ TD> <TD>录取率的空间超参数PSI </ TD> </ TR> <tr valign="top"> <TD>beta </ TD> <TD>参数估计的回归参数测试。</ TD> </ TR> <tr valign="top"> <TD>gamma </ TD> <TD>参数估计的空间参数的伽玛。</ TD> </ TR> <tr valign="top"> < TD> invsigsq </ TD> <TD>参数估计的逆空间超参数西格玛$ ^ 2美元。</ TD> </ TR> <tr valign="top"> <TD> X> </ TD> <TD>参数估计的空间超参数PSI </ TD> </ TR> <tr valign="top"> <TD>psi </ TD> <TD。 >参数估计的的GP和ZIGP模型的特定分散PHI参数。</ TD> </ TR> <tr valign="top"> <TD> phi </ TD> <TD>参数估计为的ZIP和ZIGP模型,具体的额外比例的omega。</ TD> </ TR> <tr valign="top"> <TD>omega </ TD> <TD>参数估计的NB模型的具体尺度参数河</ TD> </ TR> <tr valign="top"> <TD> r </ TD> <TD>的参数估计值。</ TD> </ TR> <tr valign="top"> <TD>Coefficients </ TD> <TD>曝光向量。</ TD> </ TR> </ TABLE>
参考文献----------References----------
Boltzmannstr. 3, D-85748 Garching near Munich.
Masterthesis: Schabenberger, Holger (2009). Spatial count regression models with applications to health insurance data. ("http://www-m4.ma.tum.de/Diplarb/").
Czado, C., Erhardt, V., Min, A., Wagner, S. (2007). Zero-inflated generalized Poisson models with regression effects on the mean, dispersion and zero-inflation level applied to patent outsourcing rates. Statistical Modelling 7 (2), 125-153.
参见----------See Also----------
R-package ZIGP for fitting GP, ZIP, ZIGP regression models using MLE.
R-的包ZIGP为配件GP,ZIP,ZIGP回归模型使用MLE。
实例----------Examples----------
data(sim.Yin)
data(sim.fm.X)
data(sim.region)
data(sim.gmat)
data(sim.nmat)
# true parameters for generating this data:[产生这个数据的真实参数:]
# beta.true = c(-1, 0.4, 1.5)[beta.true = C(-1,0.4,1.5)]
# gamma.true = vector of spatial effects according to the CAR model with mean 0, psi = 3 and sigma = 1[gamma.true =矢量的空间效果根据均值为0,psi的= 3和sigma = 1的CAR模型]
# range of gamma.true = c(-0.851, 0.8405)[范围gamma.true = C(-0.851,0.8405)]
# run all examples with higher number of iterations if you want to approximate the true parameters[运行所有的例子,如果你想真正的参数具有较高的迭代次数]
# properly[正确的]
poi <- est.sc(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region,
model="Poi", sim.gmat, sim.nmat, totalit=10)
# posterior means not considering a burn-in or thinning of iterations[后指不考虑烧伤或变薄,迭代]
apply(poi$beta,1,mean)
apply(poi$gamma,1,mean)
# Compare Poisson to different model classes[比较泊松不同的模型类]
nb <- est.sc(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, model="NB", sim.gmat, sim.nmat, totalit=10)
gp <- est.sc(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, model="GP", sim.gmat, sim.nmat, totalit=10)
zip <- est.sc(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, model="ZIP", sim.gmat, sim.nmat, totalit=10)
zigp <- est.sc(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, model="ZIGP", sim.gmat, sim.nmat, totalit=10)
DIC.poi <- DIC(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, poi)
DIC.nb <- DIC(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, nb)
DIC.gp <- DIC(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, gp)
DIC.zip <- DIC(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, zip)
DIC.zigp <- DIC(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, zigp)
ll.poi <- LogLike(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, poi)
ll.nb <- LogLike(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, nb)
ll.gp <- LogLike(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, gp)
ll.zip <- LogLike(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, zip)
ll.zigp <- LogLike(sim.Yin, ~1+sim.fm.X[,1]+sim.fm.X[,2], sim.region, zigp)
Vuong.poi.nb <- Vuongtest(ll.poi, ll.nb, alpha = 0.05, p = DIC.poi$p.D, q = DIC.nb$p.D, correction = TRUE)
Vuong.poi.gp <- Vuongtest(ll.poi, ll.gp, alpha = 0.05, p = DIC.poi$p.D, q = DIC.gp$p.D, correction = TRUE)
Vuong.poi.zip <- Vuongtest(ll.poi, ll.zip, alpha = 0.05, p = DIC.poi$p.D, q = DIC.zip$p.D, correction = TRUE)
Vuong.poi.zigp <- Vuongtest(ll.poi, ll.zigp, alpha = 0.05, p = DIC.poi$p.D, q = DIC.zigp$p.D, correction = TRUE)
Clarke.poi.nb <- Clarketest(ll.poi, ll.nb, alpha = 0.05, p = DIC.poi$p.D, q = DIC.nb$p.D, correction = TRUE)
Clarke.poi.gp <- Clarketest(ll.poi, ll.gp, alpha = 0.05, p = DIC.poi$p.D, q = DIC.gp$p.D, correction = TRUE)
Clarke.poi.zip <- Clarketest(ll.poi, ll.zip, alpha = 0.05, p = DIC.poi$p.D, q = DIC.zip$p.D, correction = TRUE)
Clarke.poi.zigp <- Clarketest(ll.poi, ll.zigp, alpha = 0.05, p = DIC.poi$p.D, q = DIC.zigp$p.D, correction = TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|