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

R语言 SpatioTemporal包 mesa.data.res()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 13:05:24 | 显示全部楼层 |阅读模式
mesa.data.res(SpatioTemporal)
mesa.data.res()所属R语言包:SpatioTemporal

                                         Results of some time consuming code.
                                         一些耗时的代码的结果。

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

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

Data structure holding results of some time consuming code. These precomputed results is used in internal examples and in the package-vignette (Bergen and Lindstr枚m, 2011).
数据结构保持一段时间的使用代码的结果。使用这些预先计算的结果是在内部例子和包小插曲(Bergen和林斯特龙,2011)。


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


data(mesa.data)



格式----------Format----------

A list with elements. The code for recomputing each element is given under source below.
列表的元素。在源代码下面的代码重新计算每个元素都有。

The list contains
该列表包含




par.est The result of fitting the model to mesa.data.model using fit.mesa.model.
par.est的拟合模型mesa.data.model使用fit.mesa.model的结果。




EX Predictions at all locations computed using cond.expectation; this includes the latent beta-fields.
EX预测计算在所有地方使用cond.expectation,这包括潜在的β-字段。




EX.obs Predictions at only observations locations computed using cond.expectation.
只观测地点的EX.obs预测计算cond.expectation。




Ind.cv Grouping for the 10-fold cross-validation
Ind.cv分组的10倍交叉验证




par.est.cv The result of a 10-fold cross-validated
par.est.cv 10倍交叉验证的结果




pred.cv The cross-validation predictions, obtainable through predictCV.
pred.cv交叉验证的预测,获得通过predictCV。




par.est.ST The result of fitting a model with a spatio-temporal covariate using <br> fit.mesa.model.
par.est.ST的时空协变量使用<br>物理化学学报fit.mesa.model拟合模型的结果。




par.est.ST.mean0 The result of fitting a model with a mean sperated spatio-temporal covariate using fit.mesa.model.
par.est.ST.mean0拟合模型,平均sperated时空协fit.mesa.model的结果。




MCMC.res The output from a parameter estimation using a Metropolis-Hastings algorithm <br> (implemented in run.MCMC) on the data in mesa.data.model.
MCMC.res使用都会Hastings算法参考(实施run.MCMC)中的数据mesa.data.model的输出参数估计。


源----------Source----------

Contains model fitting results for the data in mesa.data.raw. This uses monitoring data from the <STRONG>MESA Air</STRONG> project, see Cohen et.al. (2009) and mesa.data.raw for details. The elements have been produced as
包含模型的拟合结果中的数据mesa.data.raw。使用监控的数据从<STRONG>梅萨航空</ STRONG>项目,参见Cohen等人(2009)和mesa.data.raw的详细信息。的元素都被产生为

Estimated parameters, obtained as:<br> data(mesa.data.model)<br> ##initial values<br> dim <- loglike.dim(mesa.data.model)<br> x.init<-cbind(rep(2,dim$nparam.cov),c(rep(c(1,-3),dim$m+1),-3))<br> par.est <- fit.mesa.model(x.init, mesa.data.model,<br> hessian.all=TRUE,control=list(trace=3,maxit=1000))
估计参数,得到:参考data(mesa.data.model)参考##initial values参考dim <- loglike.dim(mesa.data.model)参考x.init<-cbind(rep(2,dim$nparam.cov),c(rep(c(1,-3),dim$m+1),-3))参考par.est <- fit.mesa.model(x.init, mesa.data.model,参考 hessian.all=TRUE,control=list(trace=3,maxit=1000))

EX <- cond.expectation(par.est$res.best$par,<br> mesa.data.model, compute.beta=TRUE)
EX <- cond.expectation(par.est$res.best$par,参考mesa.data.model, compute.beta=TRUE)

EX.obs <- cond.expectation(par.est$res.best$par,<br> mesa.data.model, mesa.data=mesa.data,<br> only.obs=TRUE, compute.beta=FALSE)
EX.obs <- cond.expectation(par.est$res.best$par,参考mesa.data.model, mesa.data=mesa.data,参考only.obs=TRUE, compute.beta=FALSE)

Grouping for the 10-fold cross-validation, obtained as:<br> data(mesa.data.model)<br> ##create the CV structure defining 10 different CV-groups<br> Ind.cv <- createCV(mesa.data.model, groups=10, min.dist=.1)
的10倍交叉验证,获得分组:参考data(mesa.data.model)参考##create the CV structure defining 10 different CV-groups参考Ind.cv <- createCV(mesa.data.model, groups=10, min.dist=.1)

Estimated parameters from 10-fold cross-validation, obtained as:<br> data(mesa.data.model)<br> ##create the CV structure defining 10 different CV-groups<br> Ind.cv <- createCV(mesa.data.model, groups=10, min.dist=.1)<br> ##initial values<br> dim <- loglike.dim(mesa.data.model)<br> x.init<-cbind(rep(2,dim$nparam.cov),c(rep(c(1,-3),dim$m+1),-3))<br> ##estimate different parameters for each CV-group<br> par.est.cv <- estimateCV(x.init, mesa.data.model, Ind.cv)
10倍交叉验证,得到的参数估计:参考data(mesa.data.model)参考##create the CV structure defining 10 different CV-groups参考Ind.cv <- createCV(mesa.data.model, groups=10, min.dist=.1)参考##initial values参考X>参考dim <- loglike.dim(mesa.data.model)参考x.init<-cbind(rep(2,dim$nparam.cov),c(rep(c(1,-3),dim$m+1),-3))参考##estimate different parameters for each CV-group

The cross-validation predictions, obtainable through:<br> pred.cv <- predictCV(par.est.cv$par, mesa.data.model, Ind.cv)
交叉验证的预测,获得通过:<BR>的pred.cv <- predictCV(par.est.cv$par, mesa.data.model, Ind.cv)

Estimated parameters with a spatio-temporal covariate, obtained as:<br> data(mesa.data.model)<br> ##model structure with ST-covariate<br> mesa.data.model.ST <- create.data.model(mesa.data,<br> LUR = list(c("log10.m.to.a1", "s2000.pop.div.10000",<br> "km.to.coast"), "km.to.coast", "km.to.coast"),<br> ST.Ind="lax.conc.1500") <br> ##initial values<br> dim <- loglike.dim(mesa.data.model.ST)<br> x.init <- c(rep(c(1,-3),dim$m+1),-3)<br> ##estimate parameters<br> par.est.ST <- fit.mesa.model(x.init, mesa.data.model.ST,<br> hessian.all=TRUE, control=list(trace=3,maxit=1000))
估计参数的时空协,得到:参考data(mesa.data.model)参考##model structure with ST-covariate参考mesa.data.model.ST <- create.data.model(mesa.data,参考LUR = list(c("log10.m.to.a1", "s2000.pop.div.10000",参考<X >参考"km.to.coast"), "km.to.coast", "km.to.coast"),参考ST.Ind="lax.conc.1500") 参考##initial values参考dim <- loglike.dim(mesa.data.model.ST)参考x.init <- c(rep(c(1,-3),dim$m+1),-3)参考##estimate parameters参考par.est.ST <- fit.mesa.model(x.init, mesa.data.model.ST,

Estimated parameters with a mean sperated spatio-temporal covariate, obtained as:<br>  data(mesa.data.model)<br> ##model structure with ST-covariate<br> mesa.data.mean0 <- remove.ST.mean(mesa.data) <br> mesa.data.model.ST.mean0 <- create.data.model(mesa.data.mean0, <br> LUR = list(c("log10.m.to.a1", "s2000.pop.div.10000", <br> "km.to.coast", "mean.lax.conc.1500"),  "km.to.coast",<br> "km.to.coast"), ST.Ind="lax.conc.1500")<br> ##initial values<br> dim <- loglike.dim(mesa.data.model.ST.mean0)<br> x.init <- c(rep(c(1,-3),dim$m+1),-3)<br> par.est.ST.mean0 <- fit.mesa.model(x.init,<br> mesa.data.model.ST.mean0, hessian.all=TRUE,<br> control=list(trace=3,maxit=1000))
估计参数,平均sperated时空的协变量,得到:参考data(mesa.data.model)参考##model structure with ST-covariate参考mesa.data.mean0 <- remove.ST.mean(mesa.data) 参考mesa.data.model.ST.mean0 <- create.data.model(mesa.data.mean0, 参考 LUR = list(c("log10.m.to.a1", "s2000.pop.div.10000", 参考"km.to.coast", "mean.lax.conc.1500"),  "km.to.coast",参考"km.to.coast"), ST.Ind="lax.conc.1500")参考##initial values参考dim <- loglike.dim(mesa.data.model.ST.mean0)参考x.init <- c(rep(c(1,-3),dim$m+1),-3)参考<X是><BR>par.est.ST.mean0 <- fit.mesa.model(x.init,参考mesa.data.model.ST.mean0, hessian.all=TRUE,

Output from a MCMC algorithm started at the estimate in <br> mesa.data.res$par.est. The MCMC results were obtained as:<br> data(mesa.data.model)<br> data(mesa.data.res)<br> ##initial parameters and Hessian<br> x <- mesa.data.res$par.est$res.best$par.all<br> H <- mesa.data.res$par.est$res.best$hessian.all<br> ##run MCMC<br> MCMC.res <- run.MCMC(x, mesa.data.model, N = 5000,<br> Hessian.prop = H)
从MCMC算法的输出开始,估计在<BR>mesa.data.res$par.est。 MCMC结果为:参考data(mesa.data.model)参考data(mesa.data.res)参考##initial parameters and Hessian参考x <- mesa.data.res$par.est$res.best$par.all参考H <- mesa.data.res$par.est$res.best$hessian.all<BR> ##run MCMC参考MCMC.res <- run.MCMC(x, mesa.data.model, N = 5000,参考Hessian.prop = H)


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

D. Hardie, A. Ho, P. Kinney, T. V. Larson, P. D. Sampson, L. Sheppard, K. D. Stukovsky, S. S. Swan, L. S. Liu, J. D. Kaufman. (2009) Approach to Estimating Participant Pollutant Exposures in the Multi-Ethnic Study of Atherosclerosis and Air Pollution (MESA Air). Environmental Science &amp; Technology: 43(13), 4687-4693.
Tutorial for Spatio-Temporal R Package

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

Results from the estimation functions fit.mesa.model, createCV, estimateCV, predictCV, and run.MCMC using data in mesa.data.raw.
从估算的结果fit.mesa.model,createCV,estimateCV,predictCV和run.MCMCmesa.data.raw在使用数据。


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


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

##examining which components we have[#检查的组件,我们有]
names(mesa.data.res)

##examining the results for the different components[#检查结果的不同组成部分]

#################[################]
## For par.est ##[#对于par.est的##]
#################[################]
names(mesa.data.res$par.est)

##Optimisation status message[#优化状态消息]
mesa.data.res$par.est$message

##extract the estimated parameters[#提取参数的估计。]
x <- mesa.data.res$par.est$res.best$par.all
##and approximate uncertainties from the hessian[#和近似的不确定性,从麻]
x.sd <- sqrt(diag(-solve(mesa.data.res$par.est$res.best$hessian.all)))

##plot the estimated parameters[#图的估计参数]
par(mfrow=c(1,1),mar=c(13.5,2.5,.5,.5))
plot(x,ylab="",xlab="",xaxt="n")
abline(h=0, col="grey")
axis(1,1:length(x),names(x),las=2)

########################[#######################]
## For EX and EX.obs  ##[的EX和EX.obs的###]
########################[#######################]
names(mesa.data.res$EX)
names(mesa.data.res$EX.obs)


####################[###################]
## For par.est.cv ##[对于par.est.cv###]
####################[###################]
names(mesa.data.res$par.est.cv)

##boxplot of the different estimates from the CV[#箱线图的不同估计,从CV]
par(mfrow=c(1,1), mar=c(7,2.5,2,.5), las=2)
boxplot(t(mesa.data.res$par.est.cv$par))
points(mesa.data.res$par.est$res.best$par, pch=4, col=2)

##################[#################]
## For pred.cv  ##[对于pred.cv###]
##################[#################]
names(mesa.data.res$pred.cv)

##Plot observations with CV-predictions and prediction intervals[号地观测CV预测和预测区间]
par(mfcol=c(4,1),mar=c(2.5,2.5,2,.5))
plotCV(mesa.data.res$pred.cv,  1, mesa.data.model)
plotCV(mesa.data.res$pred.cv, 10, mesa.data.model)
plotCV(mesa.data.res$pred.cv, 17, mesa.data.model)
plotCV(mesa.data.res$pred.cv, 22, mesa.data.model)

#########################################[########################################]
## For par.est.ST and par.est.ST.mean0 ##[对于par.est.ST和par.est.ST.mean0###]
#########################################[########################################]
names(mesa.data.res$par.est.ST)
names(mesa.data.res$par.est.ST.mean0)

##Optimisation status message[#优化状态消息]
mesa.data.res$par.est.ST$message
mesa.data.res$par.est.ST.mean0$message

##extract the estimated parameters[#提取参数的估计。]
x.ST <- mesa.data.res$par.est.ST$res.best$par.all
x.ST0 <- mesa.data.res$par.est.ST.mean0$res.best$par.all

##plot the estimated parameters[#图的估计参数]
par(mfrow=c(1,1),mar=c(13.5,2.5,.5,.5))
plot(c(1:5,7:19), x.ST, ylab="",xlab="",xaxt="n")
points(1:19, x.ST0, pch=3, col=2)
points(c(2:5,7:19), x, pch=4, col=3)
abline(h=0, col="grey")
axis(1,1:length(x.ST0),names(x.ST0),las=2)
legend("bottomleft", col = c(1,2,3), pch = 1:3,
       legend=c("par.est.ST","par.est.ST.mean0","par.est.ST"))

##################[#################]
## For MCMC.res ##[对于MCMC.res###]
##################[#################]
names(mesa.data.res$MCMC.res)

##The MCMC-estimated parameters[#MCMC估计的参数]
summary(mesa.data.res$MCMC.res$par)

##MCMC tracks for four of the parameters[#MCMC四个轨道的参数]
par(mfrow=c(4,1),mar=c(2,2,2.5,.5))
for(i in c(4,9,13,15)){
  plot(mesa.data.res$MCMC.res$par[,i], ylab="", xlab="", type="l",
       main=colnames(mesa.data.res$MCMC.res$par)[i])
}

##And estimated densities for the log-covariance parameters.[#和密度的log - 协方差参数估计。]
##The red line is the approximate normal distribution given by[#红色的线是近似的正态分布]
##the maximum-likelihood estimates, e.g. ML-estimate and standard [#最大似然估计,如ML-估计和标准]
##deviation from the observed information matrix.[#从观测到的信息矩阵的偏差。]
par(mfrow=c(3,3),mar=c(4,4,2.5,.5))
for(i in 9:17){
  xd <- sort(unique(mesa.data.res$MCMC.res$par[,i]))
  yd <- dnorm(xd, mean=x[i],sd=x.sd[i])
  dens <- density(mesa.data.res$MCMC.res$par[,i])
  plot(dens, ylim=c(0,max(c(dens$y,yd))), main =
       colnames(mesa.data.res$MCMC.res$par)[i])
  lines(xd,yd,col=2)
}

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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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