R语言forecast包ARIMA建模报错:Lapack routine dgesv奇异系统问题
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
Incorrect
seasonalparameter for base R'sarima()
The base Rstats::arima()function requires theseasonalargument to be a list with named componentsorder(a triple(P,D,Q)for seasonal AR, differencing, MA terms) andperiod(the seasonal frequency). You passed a raw vectorc(0,1,0), which the function can't interpret correctly, leading to a mis-specified model that causes the singular Hessian.Confusion between
stats::arima()andforecast::Arima()
Since you loaded theforecastlibrary, you might have intended to useforecast::Arima()—this function simplifies the syntax by allowingseasonalto be a direct vector(P,D,Q)(it uses the time series'frequencyattribute 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

