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

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

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

                                         Naive Temporal Predictions
                                         天真时间预测

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

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

Computes naive predictions that are based on a few sites. These predictions can then be used, e.g. in summaryStatsCV, to evaluate how much better the spatial-temporal model performs compared to simple (temporal) predictions.
计算天真的预测是基于几个网站。然后,可以使用这些预测,例如在summaryStatsCV,以评估如何更好的时空简单的(时间)预测模型进行比较。


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


predictNaive(mesa.data.model, location = NULL, type = NULL)



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

参数:mesa.data.model

参数:location
List of locations on which to base the naive predictions.  
列表的位置,在此基础天真的预言。


参数:type
The type of sites to  base the predictions on, uses the (optional) field <br> mesa.data.model$location$type.  
网站的类型,预测的基础上,使用(可选)的领域<BR> mesa.data.model$location$type。


Details

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

The function requires one of location and type to be specified, if both are given location will be used over type. If only type is given then all locations such that <br> as.character(mesa.data.model$location$type) %in% type <br> will be used.
该函数需要一个location和type被指定,如果两者都给出location将使用在type。如果只type然后,参考as.character(mesa.data.model$location$type) %in% type:<BR>将使用的所有位置。

Given a set of locations the function computes 4 sets of naive prediction for all observations in mesa.data.model$obs$obs. The compute predictions are:
由于位置的一组函数计算中的所有观测mesa.data.model$obs$obs4套天真的预测。计算的预测是:

The smooth trend in mesa.data.model$trend is fit to all observations at the sites in location using a standard linear regression, lm. The fitted smooth function is then used as a naive prediction for all locations. The resulting predictions are smooth in time and constant in space.
平稳态势mesa.data.model$trend适合所有观测location使用一个标准的线性回归分析,lm中的网站。拟合的光滑函数,然后作为一个天真的预测的所有位置。得到的预测是光滑的时间和空间不变的。

The temporal average over sites in location is computed and used as a naive prediction. This gives predictions that vary in time but are constant in space.
location网站的时间平均超过计算,并作为一个天真的预测。这给出了随时间变化的预测,但在空间中是恒定的。

This fits the smooth trend in mesa.data.model$trend to each site in location and then uses the smooth fit at the closest fixed site as a naive prediction at all other sites. The resulting predictions are smooth in time and vary in space.
这符合mesa.data.model$trend平稳态势在location到每个站点,然后使用平滑适合在最近的一个天真的预测在所有其他网站的固定站点。将得到的预测在时间上是光滑的,在空间中变化。

This uses the observations at the closest site in location to predict observations at all other sites. This gives predictions that vary both in time and space.      
它使用的观察,在最近的站点在location所有其他观测点的预测意见。这给出了不同的预测,在时间和空间。


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


参数:locations
A character vector with the locations used for the naive predictions.  
一个字符的位置矢量与用于天真的预言。


参数:pred
A (number of observations) - by - (4) matrix containing the four naive predictions described under details above.  
(数目的观察) - 按 - (4)基质中含有四个天真预测描述下details上述。


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



Johan Lindstr枚m




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

See createCV and estimateCV for cross-validation set-up and estimation.
createCV和estimateCV交叉验证设置和估计。

For computing CV statistics, see also compute.ltaCV,  and for further illustration see plotCV,  CVresiduals.qqnorm, and summaryStatsCV.
对于计算CV统计,也compute.ltaCV,并为进一步的说明,请参阅plotCV,CVresiduals.qqnorm和summaryStatsCV。


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


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

##naive predictions based on either AQS[#天真预测的基础上无论是AQS]
pred.aqs <- predictNaive(mesa.data.model, type="AQS")
##or FIXED sites[#或固定点]
pred.fixed <- predictNaive(mesa.data.model, type="FIXED")

##plot the predictions - The two cases that are constant in space[#图的预测 - 这两种情况是不变的空间]
par(mfcol=c(3,1), mar=c(4.5,4.5,1,.5))
##observations as a function of date[#观测作为日期的函数]
plot(mesa.data.model$obs$date, mesa.data.model$obs$obs,
     col=mesa.data.model$obs$idx, pch=19, cex=.25,
     xlab="Date", ylab="observations")
##Add the predictions based on the smooth fitted to all sites[#将预测的基础上顺利安装的所有站点]
lines(mesa.data.model$obs$date,
      pred.aqs$pred[,"smooth.fixed"], col=1)
lines(mesa.data.model$obs$date,
      pred.fixed$pred[,"smooth.fixed"], col=2)

plot(mesa.data.model$obs$date, mesa.data.model$obs$obs,
     col=mesa.data.model$obs$idx, pch=19, cex=.25,
     xlab="Date", ylab="observations")
##Add predictions based on the temporal average[#添加预测的基础上的时间平均]
lines(mesa.data.model$obs$date,
      pred.aqs$pred[,"avg.fixed"], col=1)
lines(mesa.data.model$obs$date,
      pred.fixed$pred[,"avg.fixed"], col=2)

##plot the predictions - One of the cases that vary in space[#图的预测 - 在空间变化的情况下,]
##first extract a data matrix[#第一次提取数据矩阵]
D <- create.data.matrix(date=mesa.data.model$obs$date,
    obs=pred.aqs$pred[,"smooth.closest.fixed"],
    ID=mesa.data.model$obs$ID)

##observations as a function of date[#观测作为日期的函数]
##(only five sites for clarity)[#(为清楚起见,只有5个站点)]
IND <- (mesa.data.model$obs$idx %in% c(1:5))
plot(mesa.data.model$obs$date[IND], mesa.data.model$obs$obs[IND],
     col=mesa.data.model$obs$idx[IND], pch=19, cex=.25,
     xlab="Date", ylab="observations")
##Add the predictions based on the smooth[#将预测的基础上顺利]
##fitted to the closest site[#安装到最近的站点]
for(i in 1:5)
  lines(as.Date(rownames(D)), D[,mesa.data.model$location$ID[i]],
        col=i)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-11 06:07 , Processed in 0.026425 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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