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

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

[复制链接]
发表于 2012-9-30 13:06:31 | 显示全部楼层 |阅读模式
simulateMesaData(SpatioTemporal)
simulateMesaData()所属R语言包:SpatioTemporal

                                         Simulate Data from the Spatio-Temporal Model
                                         从时空模型模拟数据

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

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

Simulates data from the spatio-temporal model.
模拟从时空模型的数据。


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


simulateMesaData(x, mesa.data.model, mesa.data = NA, rep = 1,
                 combine.data = FALSE)



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

参数:x
Parameters for which to simulate data. If only log-covariance parameters are given then the regression parameters are inferred by calling <br> cond.expectation(x, mesa.data.model, only.pars=TRUE).  
参数的模拟数据。如果只log - 协方差参数回归参数推断通过调用<BR>cond.expectation(x, mesa.data.model, only.pars=TRUE)。


参数:mesa.data.model
Data structure holding observations, and information regarding where to simulate observations. See mesa.data.model.  
数据结构控股的观察,来模拟观察的信息。见mesa.data.model。


参数:mesa.data
Data structure holding observations, observation locations, smooth temporal trends, geographic covariates and spatio-temporal covariates. This can be used to obtain simulated values at different times and or locations than specified by mesa.data.model. See mesa.data.   
数据结构观测,观测地点,平滑的变化趋势,GEO协变量和时空的协变量。这可以被用来获取模拟值在不同的时间或地点比指定的mesa.data.model的。见mesa.data。


参数:rep
Number of field replicates to simulate.  
号码的字段复制到模拟。


参数:combine.data
If TRUE will combine locations and covariates from mesa.data.model and mesa.data, but will use temporal trends from mesa.data.model.  
如果TRUE将结合mesa.data.model和mesa.data,地点和协变量,从mesa.data.model但是会使用的时间趋势。


Details

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

Data is simulated for the space-time locations in mesa.data.model and/or mesa.data, given the parameters in x. If only log-covariance parameters are given then the regression parameters are inferred using generalised least squares (GLS), as <br> cond.expectation(x, mesa.data.model, only.pars=TRUE, type="p").
数据是模拟的空间 - 时间位置mesa.data.model和/或mesa.data在x,给定的参数。如果只log - 协方差参数回归参数推断使用广义最小二乘法(GLS),<BR> cond.expectation(x, mesa.data.model, only.pars=TRUE, type="p")。

The space-time locations at which to simulate data are specified through mesa.data.model and/or mesa.data. If mesa.data=NA data will be simulated at all space-time locations given in mesa.data.model. If mesa.data!=NA two options exist:
在模拟数据的空间 - 时间位置中指定通过mesa.data.model和/或mesa.data。如果mesa.data=NA数据将模拟在mesa.data.model在所有的时空位置。如果mesa.data!=NA有两个选项:

If combine.data=FALSE data will be simulated at only the space-time locations in <br> mesa.data. If mesa.data does not have a smooth temporal trend, the trend in <br> mesa.data.model will be used (with a warning).
如果combine.data=FALSE数据将只在空间 - 时间的位置模拟<br>文章mesa.data。如果mesa.data不有一个平稳的时间趋势,这种趋势在参考mesa.data.model将被用于(警告)。

If combine.data=TRUE locations and covariates from both mesa.data.model and mesa.data are combined using combineMesaData. The smooth temporal trends are taken from mesa.data.model with trends in mesa.data being ignored. I.e. data is simulated at the combined set of locations in mesa.data.model and mesa.data; at only the times specified in mesa.data.model$trend.
如果combine.data=TRUE位置和协变量的两个mesa.data.model和mesa.data相结合使用combineMesaData。平滑的变化趋势是从mesa.data.model与趋势mesa.data被忽略。即数据,模拟结合的位置mesa.data.model和mesa.data;只有在指定的时间在mesa.data.model$trend。

If the additional object mesa.data is given, mesa.data.model is used to specify the model (through the fields LUR.list and ST.Ind).
如果额外的对象mesa.data,mesa.data.model被用于指定模型(通过字段LUR.list和ST.Ind)。


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

Returns a list containing:
返回一个列表,其中包含:


参数:param
Parameters used to simulate the data.
这些参数用于模拟的数据。


参数:B
The simulated beta fields in a (number of locations) - by - (number of temporal trends) - by - (number of replicates) array.  
模拟测试领域(的位置) - 由 - (时间趋势) - 由 - (重复次数)阵列。


参数:X
The simulated spatio-temporal fields in a (number of timepoints) - by - (number of locations) - by - (number of replicates) array. Row and column names indicate the time and locations for each observation.  
模拟的时空领域在(数时间点) - 由 - (位置) - 由 - (重复次数)阵列。行和列的名称表示为每个观测的时间和地点。


参数:obs
A list with one element per replicate, containing the simulated observations extracted at space-time locations matching those in mesa.data.model$obs (or a sorted version of mesa.data.model$obs). Each element of the list is a  data.frame with obs, date, idx, and ID fields. To replace the observations with the i:th simulated values do:<br> mesa.data.model$obs <- obs[[i]].  
列表复制的每一个元素,包含提取模拟的意见,在空间位置匹配那些在mesa.data.model$obs(或mesa.data.model$obs排序的版本)。列表中的每一个元素是一个数据框obs,date,idx和ID领域。要更换与我的意见:次模拟值如下:<br> mesa.data.model$obs <- obs[[i]]。


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



Johan Lindstr枚m




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

For estimation functions see fit.mesa.model, run.MCMC,  and estimateCV.
估计功能fit.mesa.model,run.MCMC和estimateCV。

For prediction see cond.expectation and predictCV
预测cond.expectation和predictCV


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


##load the data[#加载的数据。]
data(mesa.data)
data(mesa.data.model)
data(mesa.data.res)

##Get estimated parameters[#估计参数]
x <- mesa.data.res$par.est$res.best$par.all

##Simulate 5 replicates from these parameters[模拟5个重复这些参数]
sim.data <- simulateMesaData(x, mesa.data.model, rep = 5)

##plot the simulated observations as a function of time[#绘制作为时间的函数的模拟观测]
par(mfrow=c(2,2),mar=c(4,4,.5,.5))
plot(sim.data$obs[[1]]$date, sim.data$obs[[1]]$obs,
     type="n", ylab="obs", xlab="Date")
for(i in 1:5)
  points(sim.data$obs[[i]]$date, sim.data$obs[[i]]$obs, col=i)

##and the latent beta-fields[#和潜β-字段]
for(i in 1:3){
  plot(sim.data$B[,i,1], ylim=range(sim.data$B[,i,]), type="n",
       xlab="loc", ylab=paste("beta",colnames(sim.data$B)[i]))
  for(j in 1:5)
    points(sim.data$B[,i,j], col=j)
}

###########################################[##########################################]
## A case with some unobserved locations ##[一些不可观测的位置###A]
###########################################[##########################################]
##keep only observations from the AQS sites[#只保留意见的AQS网站]
ID.AQS <- mesa.data$location$ID[mesa.data$location$type=="AQS"]
mesa.data$obs <- mesa.data$obs[mesa.data$obs$ID %in% ID.AQS,]

##create a model object, dropping unobserved locations.[#创建一个模型对象,删除未观察到的位置。]
mesa.data.model <- create.data.model(mesa.data,
    LUR = mesa.data.model$LUR.list, ST.Ind = mesa.data.model$ST.Ind)

##simulate some replicates for this object[#模拟一些重复这个对象]
sim.data.obs <- simulateMesaData(x, mesa.data.model)
sim.data.all <- simulateMesaData(x, mesa.data.model,
    mesa.data=mesa.data)
sim.data.comb <- simulateMesaData(x, mesa.data.model,
    mesa.data=mesa.data, combine.data = TRUE)

##The first simulated object now only contains the AQS sites[#第一个模拟对象只包含AQS网站]
mesa.data.model$location$ID
colnames(sim.data.obs$X)

##while the other two contain all locations[#而其他两个包含的所有位置]
colnames(sim.data.all$X)
colnames(sim.data.comb$X)


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-11 09:43 , Processed in 0.023799 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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