-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: forecast::Arima() #910 #6
Comments
✔ [世博量化研究院*]
❯ source('函数/日内高频季节性自回归.R')
✔ [世博量化研究院*]
❯ if (.模型选项 == '自动化') {
半成品 <- tryCatch({
auto.arima(
季回归, d = .差分阶数, D = .季节性差分阶数, seasonal = 季节性与否,
stationary = 静态与否, trace = 记载自回归与否,
ic = 信息量准则, stepwise = 逐步精化与否, nmodels = 逐步精化量,
#approximation = 近似值与否,
method = 计策谋略, truncate = 省略, #x = y,
xreg = 趋势, test = 测试, lambda = 博克斯考克斯变换,
test.args = 测试参数, allowdrift = 允许截距与否,
seasonal.test = 季节性测试, seasonal.test.args = 季节性测试参数,
allowmean = 允许包含均值与否, biasadj = 偏差调整与否,
parallel = 多管齐下与否, num.cores = 核心量)
}, 错误信息 = function(错误信息参数) NULL)
半成品 <- 预测样本 |>
{\(.) mutate_dt(., 市场价 = 闭市价, 预测价 = coef(半成品))}() |>
{\(.) select_dt(., 年月日时分, 市场价, 预测价)}()
模型名称 <- paste0(
.模型选项, '_差分阶数_', .差分阶数, '_季节性差分阶数_', .季节性差分阶数,
'_季节性与否_', 季节性与否, '_静态与否_', 静态与否,
'_记载自回归与否_', 记载自回归与否, '_信息量准则_', 信息量准则,
'_逐步精化与否_', 逐步精化与否, '_计策谋略_', 计策谋略,
'_数据量', 数据量,
'_频率', 频率, '_预测时间单位', 预测时间单位,
'_', 预测样本$年月日时分, 'CST.rds')
}
✔ [世博量化研究院*]
❯ 信息量准则 = c('aicc', 'aic', 'bic')
✔ [世博量化研究院*]
❯ tryCatch({
Arima(
季回归, order = .时序规律, seasonal = .季节性规律参数,
xreg = 趋势, include.mean = 包含均值与否,
include.drift = 包含截距与否, #include.constant = 包含常数,
#model = 统计模型, lambda = 博克斯考克斯变换, x = y,
biasadj = 偏差调整与否, method = 计策谋略)
}, 错误信息 = function(错误信息参数) NULL)
Error in if ((order[2] + seasonal$order[2]) > 1 & include.drift) { :
参数长度为零
✖ [世博量化研究院*]
❯ 包含截距与否
[1] TRUE
✔ [世博量化研究院*]
❯ tryCatch({
Arima(
季回归, order = .时序规律, seasonal = .季节性规律参数,
xreg = 趋势, include.mean = 包含均值与否,
#include.drift = 包含截距与否, #include.constant = 包含常数,
#model = 统计模型, lambda = 博克斯考克斯变换, x = y,
biasadj = 偏差调整与否, method = 计策谋略)
}, 错误信息 = function(错误信息参数) NULL)
Error in if ((order[2] + seasonal$order[2]) > 1 & include.drift) { :
参数长度为零
✖ [世博量化研究院*]
❯ .时序规律
[data.table]:
# A tibble: 108 × 3
自回归阶数 差分阶数 滑均阶数
<int> <int> <int>
1 0 0 0
2 0 0 1
3 0 0 2
4 0 0 3
5 0 0 4
6 0 0 5
7 0 1 0
8 0 1 1
9 0 1 2
10 0 1 3
# … with 98 more rows
# ℹ Use `print(n = ...)` to see more rows
✔ [世博量化研究院*]
❯ tryCatch({
Arima(
季回归, order = unlist(.时序规律[1,]), seasonal = unlist(.季节性规律参数[1,]),
xreg = 趋势, include.mean = 包含均值与否,
include.drift = 包含截距与否, #include.constant = 包含常数,
#model = 统计模型, lambda = 博克斯考克斯变换, x = y,
biasadj = 偏差调整与否, method = 计策谋略)
}, 错误信息 = function(错误信息参数) NULL)
Error in solve.default(res$hessian * n.used, A) :
Lapack例行程序dgesv: 系统正好是奇异的: U[1,1] = 0
✖ [世博量化研究院*]
❯ tryCatch({
Arima(
季回归, order = unlist(.时序规律[1,]),
seasonal = list(order = unlist(.季节性规律参数[1,]), period = 循环周期),
xreg = 趋势, include.mean = 包含均值与否,
include.drift = 包含截距与否, #include.constant = 包含常数,
#model = 统计模型, lambda = 博克斯考克斯变换, x = y,
biasadj = 偏差调整与否, method = 计策谋略)
}, 错误信息 = function(错误信息参数) NULL)
Error in solve.default(res$hessian * n.used, A) :
Lapack例行程序dgesv: 系统正好是奇异的: U[1,1] = 0 日内高频季节性自回归 <- function(
## ======== 居住在英国布里斯托尔港口,修读气象学系的英国基督洋妞儿芈拉不可以死 ========
时间索引, 样本, .蜀道 = NULL, 文件名 = '日内高频季节性自回归', 数据量,
频率 = 1, 预测时间单位 = 1, .模型选项 = .模型选项,
.差分阶数 = .差分阶数, .季节性差分阶数 = .季节性差分阶数,
季节性与否 = 季节性与否, .时序规律 = .时序规律,
.季节性规律参数 = .季节性规律参数, 静态与否 = 静态与否,
记载自回归与否 = 记载自回归与否, 信息量准则 = c('aicc', 'aic', 'bic'),
逐步精化与否 = 逐步精化与否, 逐步精化量 = 逐步精化量,
#近似值与否 = (length(x) > 150 | frequency(x) > 12),
省略 = 省略, #x = y, method = NULL,
## 代码中xreg作为 [公式] 。xreg可以指定多组相关序列,
## 也就是说动态回归就是多元回归。
## Dynamic Harmonic Regression
## 使用FT(傅里叶)序列作为xreg。模型拟合时不指定seasonal,
## 在预测时加入周期性的xreg(势头/趋势/气势)。
## [R语言时间序列分析(预测)](https://zhuanlan.zhihu.com/p/29755934)
趋势 = 趋势, 测试 = 测试, 测试参数 = 测试参数,
季节性测试 = 季节性测试, 季节性测试参数 = 季节性测试参数,
允许截距与否 = 允许截距与否, 允许包含均值与否 = 允许包含均值与否,
博克斯考克斯变换 = 博克斯考克斯变换, 偏差调整与否 = 偏差调整与否,
多管齐下与否 = 多管齐下与否, 核心量 = 核心量, 包含均值与否 = 包含均值与否,
#趋势 = NULL, 包含常数与否,
包含截距与否 = 包含截距与否, 统计模型 = 统计模型,
#博克斯考克斯变换 = 统计模型$lambda, x = y, 偏差调整与否 = FALSE,
计策谋略 = 计策谋略, 列印 = '勾') {
...
...
...
} ✖ [世博量化研究院*]
❯ args(Arima)
function (y, order = c(0, 0, 0), seasonal = c(0, 0, 0), xreg = NULL,
include.mean = TRUE, include.drift = FALSE, include.constant,
lambda = model$lambda, biasadj = FALSE, method = c("CSS-ML",
"ML", "CSS"), model = NULL, x = y, ...)
NULL
<environment: R_GlobalEnv>
✔ [世博量化研究院*]
❯ 包含截距与否
[1] TRUE binary.com-interview-question/函数/日内高频季节性自回归.R Lines 48 to 50 in 1b9379a
735 if ((order[2] + seasonal$order[2]) > 1 & include.drift) {
736 warning("No drift term fitted as the order of difference is 2 or more.")
737 include.drift <- FALSE
738 }
|
愚忠入侵电子仪器反抗咱们全球NonMuslim中华民族、中国政府、台湾政府的所有巫裔回教徒911恐怖份子巫师巫婆太监民族和忠实狗奴才洋人回教徒Michael Cutter Christopher bin Abdullah阖家一律死刑
|
## .季节性规律参数 <- c(0, 0, 0) | |
.季节性规律参数 <- permutations(6, 3, 0:5, repeats.allowed = TRUE) %>% | |
as.data.table | |
.季节性规律参数 <- setnames(.季节性规律参数, old = c('V1', 'V2', 'V3'), | |
new = c('季节性自回归阶数', '季节性差分阶数', '季节性滑均阶数'))[季节性差分阶数 <= 2] %>% | |
mutate_dt(总和 = rowSums(.)) %>% | |
filter_dt(总和 > 0) %>% | |
select_dt(-总和) |
❯ tryCatch({
Arima(
季回归, order = unlist(.时序规律[1,]),
seasonal = list(order = unlist(.季节性规律参数[1,]), period = 循环周期),
xreg = 趋势, include.mean = 包含均值与否,
include.drift = 包含截距与否, #include.constant = 包含常数,
#model = 统计模型, lambda = 博克斯考克斯变换, x = y,
biasadj = 偏差调整与否, method = 计策谋略)
}, 错误信息 = function(错误信息参数) NULL)
Error in stats::arima(x = x, order = order, seasonal = seasonal, include.mean = include.mean, :
'seasonal$order'必需是长度为三的非负数值矢量
✖ [世博量化研究院*]
❯ tryCatch({
Arima(
季回归, order = unlist(.时序规律[1,]),
seasonal = unlist(.季节性规律参数[1,]),
xreg = 趋势, include.mean = 包含均值与否,
include.drift = FALSE, #包含截距与否, #include.constant = 包含常数,
#model = 统计模型, lambda = 博克斯考克斯变换, x = y,
biasadj = 偏差调整与否, method = 'CSS')#计策谋略)
}, 错误信息 = function(错误信息参数) NULL)
Error in solve.default(res$hessian * n.used) :
Lapack例行程序dgesv: 系统正好是奇异的: U[1,1] = 0
❯ source('函数/日内高频季节性自回归.R')
✔ [世博量化研究院*]
❯ 计策谋略
[1] "CSS-ML" "ML" "CSS"
✔ [世博量化研究院*]
❯ tryCatch({
Arima(
季回归, order = unlist(.时序规律[1,]),
seasonal = unlist(.季节性规律参数[1,]),
xreg = 趋势, include.mean = 包含均值与否,
include.drift = FALSE, #包含截距与否, #include.constant = 包含常数,
#model = 统计模型, lambda = 博克斯考克斯变换, x = y,
biasadj = 偏差调整与否, method = 'CSS')#计策谋略)
}, 错误信息 = function(错误信息参数) NULL)
Error in solve.default(res$hessian * n.used) :
Lapack例行程序dgesv: 系统正好是奇异的: U[1,1] = 0
✖ [世博量化研究院*]
❯ tryCatch({
Arima(
季回归, order = unlist(.时序规律[1,]),
seasonal = unlist(.季节性规律参数[1,]),
xreg = 趋势, include.mean = 包含均值与否,
include.drift = TRUE, #包含截距与否, #include.constant = 包含常数,
#model = 统计模型, lambda = 博克斯考克斯变换, x = y,
biasadj = 偏差调整与否, method = 'CSS')#计策谋略)
}, 错误信息 = function(错误信息参数) NULL)
Error in solve.default(res$hessian * n.used) :
Lapack例行程序dgesv: 系统正好是奇异的: U[1,1] = 0
相关资源:
✔ 2.4 GiB [世博量化研究院*]
❯ 季回归0 <- llply(.差分阶数, function(差分阶数) {
季回归1 <- llply(.季节性差分阶数, function(季节性差分阶数) {
季回归2 <- llply(季节性与否, function(季节) {
季回归3 <- llply(时间索引, function(时序) {
成效 <- 日内高频季节性自回归(
时间索引 = 时序, 样本 = 样本2018半年, .蜀道 = .蜀道,
文件名 = '日内高频季节性自回归', 数据量 = 数据量, 频率 = 频率,
预测时间单位 = 预测时间单位, .模型选项 = 模型,
.差分阶数 = 差分阶数, .季节性差分阶数 = 季节性差分阶数,
季节性与否 = 季节, 静态与否 = '叉', 记载自回归与否 = '叉',
信息量准则 = c('aicc', 'aic', 'bic'), 逐步精化与否 = '勾',
逐步精化量 = 94, #近似值与否=(length(x)>150|frequency(x)>12),
省略 = NULL, 计策谋略 = NULL, #x = y,
趋势 = NULL, 测试 = c('kpss', 'adf', 'pp'), 测试参数 = list(),
季节性测试参数 = list(), 季节性测试 = c('seas', 'ocsb', 'hegy', 'ch'),
允许截距与否 = '勾', 允许包含均值与否 = '勾',
博克斯考克斯变换 = NULL, 偏差调整与否 = '叉', 多管齐下与否 = '叉', 核心量 = 2,
包含均值与否 = '勾', 包含截距与否 = '勾')
}, .progress = 'text')
}, .progress = 'text')
}, .progress = 'text')
}, .progress = 'text')
Error in { :
task 1 failed - "task 1 failed - "task 1 failed - "task 1 failed - "季节性与否 = '勾' 或 '叉'"""" |
Citation : robjhyndman/forecast#910 (comment)
The text was updated successfully, but these errors were encountered: