simulate.ah4(surveillance)
simulate.ah4()所属R语言包:surveillance
Simulates data based on the model proposed by Paul and Held (2011)
模拟数据的基础上提出的模型的保罗和(2011)
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Simulates a multivariate time series of counts based on the Poisson/Negative Binomial model as described in Paul and Held (2011).
计数的泊松/负二项式模型所描述的保罗和(2011)的的基础上模拟了一个多变量的时间序列。
用法----------Usage----------
## S3 method for class 'ah4'
simulate(object, nsim = 1, seed = NULL, y.start = NULL, coefs = NULL, ...)
参数----------Arguments----------
参数:object
an object of class "ah4".
对象类"ah4"。
参数:nsim
number of time series to simulate. Defaults to 1.
的时间序列数来模拟。默认为1的。
参数:seed
an integer that will be used in the call to set.seed before simulating the time series.
在模拟的时间序列之前,将用于在调用set.seed的整数。
参数:y.start
vector with starting counts for the epidemic components. If NULL, the observed means in the respective units of the data in object are used.
矢量疫情组件开始计数。如果NULL,所观察到的装置中的各个单元中的数据object被使用。
参数:coefs
if not NULL, these values (in the same order as coef(object)) are used to simulate from the model specified in object.
如果不是NULL,这些值(coef(object))是用来模拟从在object指定的模型以相同的顺序。
参数:...
unused (argument of the generic).
未使用的通用(参数)。
Details
详细信息----------Details----------
Simulates data from a Poisson or a Negative Binomial model with mean
模拟数据的泊松或负二项式模型,平均
where λ_{it}>0, φ_{it}>0, and ν_{it}>0 are parameters which are modelled parametrically. The function uses the model and parameter estimates of the fitted object to simulate the time series.
λ_{it}>0,φ_{it}>0和ν_{it}>0是参数化建模的参数。该函数使用的模型和参数估计的拟合object来模拟的时间序列。
With the argument coefs it is possible to simulate from the model as specified in object, but with different parameter values.
用参数coefs是可以模拟从模型中指定object,但具有不同的参数值。
值----------Value----------
An object of class "sts" in the case of nsim = 1, and a list of "sts" objects otherwise.
类的一个对象"sts"中情况下nsim = 1和"sts"对象,否则的列表。
(作者)----------Author(s)----------
M. Paul
参考文献----------References----------
random effects model for multivariate time series of infectious disease counts. Statistics in Medicine, 30, 1118–1136
参见----------See Also----------
hhh4, simHHH
hhh4,simHHH
实例----------Examples----------
data(influMen)
# convert to sts class and extract meningococcal disease time series[转换为STS类,并提取脑膜炎球菌病的时间序列]
meningo <- disProg2sts(influMen)[,2]
# fit model[拟合模型]
fit <- hhh4(meningo, control = list(ar = list(f = ~ 1),
end = list(f = addSeason2formula(S = 1, period = 52)),
family = "NegBin1"))
plot(fit)
# simulate from model[模拟从模型]
set.seed(1234)
simData <- simulate(fit)
# plot simulated data[绘制模拟数据]
plot(simData, main = "simulated data", legend.opts = NULL, xaxis.years = FALSE)
# consider a Poisson instead of a NegBin model[考虑泊松,而不是的NegBin模型]
coefs <- coef(fit)
coefs["1/overdisp"] <- 0
simData2 <- simulate(fit, coefs = coefs)
plot(simData2, main = "simulated data: Poisson model",
legend.opts = NULL, xaxis.years = FALSE)
# consider a model with higher autoregressive parameter[考虑模型具有较高的自回归参数]
coefs <- coef(fit)
coefs[1] <- log(0.5)
simData3 <- simulate(fit, coefs = coefs)
plot(simData3, main = "simulated data: lambda = 0.5",
legend.opts = NULL, xaxis.years = FALSE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|