You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用fable包对数转换指数平滑预测出现异常结果求助

指数平滑模型预测异常问题排查求助

我用指数平滑法构建了针对短时间序列的预测模型,为了将预测结果限制在0到1之间,采用了fable包中的scaled logit变换。该模型在1000余组数据集上表现优异,但其中一组数据的预测结果出现异常(详见下方代码及图表)。只需细微调整参数或数据即可修正结果:例如将upper设为1.1,或降低x的最后一个值,模型就能输出合理预测。由于对相关方法理解不足,恳请协助排查问题。

library(dplyr)
library(tsibble)
library(fable)

scaled_logit <- function(x, lower = 0, upper = 1) {
  log((x - lower) / (upper - x))
}
inv_scaled_logit <- function(x, lower = 0, upper = 1) {
  (upper - lower) * exp(x) / (1 + exp(x)) + lower
}
my_scaled_logit <- new_transformation(
  scaled_logit, inv_scaled_logit)

x = c(0.5156105, 0.5137760, 0.5275933, 0.5561075, 0.5722731, 0.6237780, 0.6243926, 0.6256203, 0.8582260)

tibble(time = seq(2004, 2020, by = 2), x = x) %>%
  as_tsibble(index = time) %>%
  model(fit = ETS(my_scaled_logit(x, lower = 0, upper = 1) ~ trend("Ad") + season("N"))) %>%
  forecast(h = 15) %>% autoplot()

异常预测结果图

内容的提问来源于stack exchange,提问作者rohan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.14 20:41:07