预测准确性:没有以两个向量为参数的MASE [英] Forecast accuracy: no MASE with two vectors as arguments

查看:248
本文介绍了预测准确性:没有以两个向量为参数的MASE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用forecast包中的accuracy函数来计算精度度量.我正在使用它来计算拟合的时间序列模型的度量,例如ARIMA或指数平滑. 当我在不同维度和聚合级别上测试不同的模型类型时,我使用的是Hyndman等人(2006年,另一种关注预测准确性的方法")引入的MASE(平均绝对比例误差)在不同的水平上.

I'm using the accuracy function from the forecast package, to calculate accuracy measures. I'm using it to calculate measures for fitted time series models, such as ARIMA or exponential smoothing. As I'm testing different model types on different dimensions and aggregation levels, I'm using the MASE, mean absolute scaled error, introduced by Hyndman et al (2006, "Another look at measures of forecast accuracy"), to compare different models on different levels.

现在,我还将比较具有预测历史记录的模型.由于我只有预测值而没有模型,因此我尝试使用accuracy函数.在功能说明中提到,还可以提供两个向量参数(一个带有预测值,一个带有实际值)来计算度量(而不是拟合模型):

Now I'm also comparing models with forecast history. As I only have the forecast values and not the models, I tried to use the accuracy function. In the function description is mentioned that it is also allowed provide two vector arguments, one with forecast values and one with actuals, to calculate the measures (instead of a fitted model):

f:预测"类的对象,或包含预测的数值向量.它 如果省略x,也将与Arima,ets和lm对象一起使用-在这种情况下 返回样本内准确性度量.

f: An object of class "forecast", or a numerical vector containing forecasts. It will also work with Arima, ets and lm objects if x is omitted – in which case in-sample accuracy measures are returned.

x:可选数字向量,包含与长度相同的实际值 对象.

x: An optional numerical vector containing actual values of the same length as object.

但是令我感到惊讶的是,所有措施均已归还,请期待MASE.所以我想知道是否有人知道原因是什么?在accuracy函数中使用两个向量作为参数时,为什么不返回MASE?

But I was suprised by the fact that all measures are returned, expect the MASE. So I was wondering if somebody knows what the reason is for that? Why is the MASE not returned, while using two vectors as arguments in the accuracy function?

推荐答案

MASE需要历史数据来计算比例因子.它不是根据@FBE的答案从将来的数据中计算出来的.因此,如果您不将历史数据传递给accuracy(),则无法计算MASE.例如,

The MASE requires the historical data to compute the scaling factor. It is not computed from the future data as in the answer by @FBE. So if you don't pass the historical data to accuracy(), the MASE cannot be computed. For example,

> library(forecast)
> fcast <- snaive(window(USAccDeaths,end=1977.99))
> accuracy(fcast$mean,USAccDeaths)
         ME        RMSE         MAE         MPE        MAPE        ACF1 
225.1666667 341.1639391 259.5000000   2.4692164   2.8505546   0.3086626 
  Theil's U 
  0.4474491 

但是,如果您传递整个fcast对象(包括历史数据),则会得到

But if you pass the whole fcast object (which includes the historical data), you get

> accuracy(fcast,USAccDeaths)
         ME        RMSE         MAE         MPE        MAPE        MASE 
225.1666667 341.1639391 259.5000000   2.4692164   2.8505546   0.5387310 
       ACF1   Theil's U 
  0.3086626   0.4474491 

这篇关于预测准确性:没有以两个向量为参数的MASE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆