R验证包

发布于 2024-10-18 03:11:03 字数 458 浏览 3 评论 0原文

我解决了读取数据的问题,并从 R 的验证包中得到了一些图。现在我想知道如何在 R 中排列数据,即我排列观察数据,如 (120, 396),其中 120 是前置时间,396是总的初始时间。预测数据有一个额外的集合成员维度,如 (120, 396,10)。在将这些数据集放入验证包的验证功能之前,我确实喜欢这样,

obs=round(runif(100))
forecast=runif(100)

我不知道为什么这个过程是必要的以及它的作用,但在放入验证功能之前这是必要的。然后使用我使用的验证函数,

verify(obs,forecast,obs.type="binary",frcst.type="prob")

然后一切正常,我可以将验证函数的结果用于其他事情。但我不知道验证包是如何工作的以及我的数据排列是否正确?上述数据集120、396中取哪个维度作为样本维度?

I solved the problem of reading the data and got some plots from verification package of R. Now i want to know that how to arrange data in R i.e. i arranged the observation data like (120, 396) where 120 is the lead time and 396 is the total initial time. The forecast data has one extra dimension of ensemble member like (120, 396,10). Before putting these data sets into verify function of verification package, i do like this

obs=round(runif(100))
forecast=runif(100)

I do not know why this process is necessary and what it does but it is necessary before putting into verify function. Then to use verify function i use,

verify(obs,forecast,obs.type="binary",frcst.type="prob")

Then everything is OK and i can use the result of verify function to other things. But i do not know how verification package works and my data arrangement is correct? Which dimension is taken as sample dimension in above data set 120, 396?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

想你的星星会说话 2024-10-25 03:11:03

您必须告诉 verify 您希望它查看哪些数据以及数据的类型。因此,您显示的示例行有两个向量,其中 obs 为 0 或 1,是一个二进制变量,而 forecast 在 0 和 1 之间连续,是一个概率。

您的数据看起来在观察和预测中都可能是连续的,您可能希望将 verify 应用于每对或三元组的第二个元素。如果是这样,查看此示例可能会帮助您了解 verify 在这种情况下如何工作。

x <- 120:130
ob <- data.frame(cbind(x, y=3 * x + 40 * rnorm(11) ) )
ob
fc <- data.frame(cbind(x, y=3 * x + 10 * rnorm(11), z = rep(10,11) ) )
fc
V  <- verify(ob$y, fc$y, obs.type = "cont", frcst.type = "cont" )
summary(V)

显然,当您验证自己的观察和预测时,您将需要使用自己的变量名称。

You have to tell verify which data you want it to look at and what type of data it is. So the example lines you show have two vectors, where obs is 0 or 1 and is a binary variable, while forecast is continuous between 0 and 1 and is a probability.

Your data looks as if it may be continuous both in the observation and the forecast and you may want to apply verify to the second element of each pair or triple. If so, looking at this example may help you understand how verify can work in such cases.

x <- 120:130
ob <- data.frame(cbind(x, y=3 * x + 40 * rnorm(11) ) )
ob
fc <- data.frame(cbind(x, y=3 * x + 10 * rnorm(11), z = rep(10,11) ) )
fc
V  <- verify(ob$y, fc$y, obs.type = "cont", frcst.type = "cont" )
summary(V)

Clearly you will need to use your own variable names when you come to verify your own observations and forecasts.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文