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

R语言forecast包ARIMA建模报错:Lapack routine dgesv奇异系统问题

Analysis of Your ARIMA Model Error

The error you're seeing (Lapack routine dgesv: system is exactly singular: U[1,1] = 0) occurs because the model estimation process can't compute valid parameter estimates—this almost always stems from an incorrect model specification syntax, which is exactly what's happening here.

Key Issues in Your Code

  1. Incorrect seasonal parameter for base R's arima()
    The base R stats::arima() function requires the seasonal argument to be a list with named components order (a triple (P,D,Q) for seasonal AR, differencing, MA terms) and period (the seasonal frequency). You passed a raw vector c(0,1,0), which the function can't interpret correctly, leading to a mis-specified model that causes the singular Hessian.

  2. Confusion between stats::arima() and forecast::Arima()
    Since you loaded the forecast library, you might have intended to use forecast::Arima()—this function simplifies the syntax by allowing seasonal to be a direct vector (P,D,Q) (it uses the time series' frequency attribute for the seasonal period automatically). Using the wrong function with incompatible syntax is the root cause of your error.

Corrected Code Options

Option 1: Use forecast::Arima() (recommended, since you loaded the library)

This matches your intended model specification and uses the simplified syntax from the forecast package:

library(forecast)
listr <- c(278.0, 284.0, 277.0, 317.0, 313.0, 318.0, 374.0, 413.0, 405.0, 355.0, 306.0, 271.0, 306.0, 315.0, 301.0, 356.0, 348.0, 355.0, 422.0, 465.0, 467.0, 404.0, 347.0, 305.0, 336.0, 340.0, 318.0, 362.0, 348.0, 363.0, 435.0, 491.0, 505.0)
tseriesr <- ts(listr, start=1, frequency=12)
fitModelr <- Arima(tseriesr, order = c(1, 0, 0), seasonal = c(0, 1, 0), method="ML")

Option 2: Use base R's arima() with correct list syntax

If you prefer to stick with base R, adjust the seasonal argument to be a properly structured list:

listr <- c(278.0, 284.0, 277.0, 317.0, 313.0, 318.0, 374.0, 413.0, 405.0, 355.0, 306.0, 271.0, 306.0, 315.0, 301.0, 356.0, 348.0, 355.0, 422.0, 465.0, 467.0, 404.0, 347.0, 305.0, 336.0, 340.0, 318.0, 362.0, 348.0, 363.0, 435.0, 491.0, 505.0)
tseriesr <- ts(listr, start=1, frequency=12)
fitModelr <- arima(tseriesr, order = c(1, 0, 0), seasonal = list(order = c(0, 1, 0), period = 12), method="ML")

Both corrected versions will fit your intended ARIMA(1,0,0)(0,1,0)[12] model without the singular Hessian error.


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.28 09:35:20