The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

QWDAP

Quantum Walk-based Data Analysis and Prediction —— 基于连续时间量子游走 (Continuous-Time Quantum Walk, CTQW)的图关联时间序列(Graph-Associated Time Series, GATS) 建模与预测 R 包。

主要功能

函数 说明
qwdap.qwalk() 连续时间量子游走模拟,由邻接矩阵生成模态(CTQW 对象)
qwdap.sws() 基于逐步回归的模态选择(forward / backward / bidirection)
qwdap.rrelieff() 基于 RReliefF 的模态选择(包内实现,近邻数 k 可调)
qwdap.swr() 逐步回归建模
qwdap.pcr() 主成分回归建模
qwdap.plsr() 偏最小二乘回归建模
qwdap.ppr() 投影寻踪回归建模
qwdap.var() 向量自回归建模
qwdap.predict() 基于 QWMODEL 对象进行预测
qwdap.eval() 计算决定系数(R²)、均方根误差(RMSE)与平均绝对误差(MAE)

分析流程:qwdap.qwalk() →(模态选择)qwdap.sws() / qwdap.rrelieff() → (建模)qwdap.swr() / qwdap.pcr() / qwdap.plsr() / qwdap.ppr() / qwdap.var() → qwdap.predict() → qwdap.eval()。

安装

依赖:R(>= 4.0.0),pls、Rcpp、methods,编译期需要 RcppEigen。 模态选择所用的 RReliefF 已在包内实现,不再依赖 CORElearn。

# 从 Gitee 安装
remotes::install_git("https://gitee.com/bright1up/qwdap.git")

# 或使用本地源码包
# R CMD INSTALL QWDAP_1.1.22.tar.gz

快速开始

library(QWDAP)

## 1. 连续时间量子游走:由邻接矩阵生成模态
edges <- matrix(c(0,1,0,0,0,0,0,
                  1,0,1,0,0,0,0,
                  0,1,0,1,0,0,0,
                  0,0,1,0,1,0,0,
                  0,0,0,1,0,1,0,
                  0,0,0,0,1,0,1,
                  0,0,0,0,0,1,0), nrow = 7)
qw <- qwdap.qwalk(edges, startindex = 1, lens = 100,
                  scals = seq(from = 0.01, by = 0.01, length.out = 100))

## 2. 模态选择
data("trafficflow")
data("traffic.qw")
ms <- qwdap.sws(trafficflow, traffic.qw, index = 1, select_method = "bidirection")

## 3. 建模
mod <- qwdap.swr(ms, data_range = c(1, 500))

## 4. 预测与评价
pred <- qwdap.predict(mod, data_range = c(501, 720))
qwdap.eval(trafficflow[501:720, 1], pred)

也可以直接使用包内自带的示例对象:

data("traffic.n1")        # QWMS 对象:N1 站点的观测序列与已选模态
data("traffic.model.n1")  # QWMODEL 对象:已建立的模型
mod <- qwdap.swr(traffic.n1, c(1, 500))
pred <- qwdap.predict(traffic.model.n1, c(501, 720))

数据集

数据集 说明
trafficflow 7 个观测站点共 720 条高速公路交通流量记录
traffic.qw 由 qwdap.qwalk() 生成的模态(CTQW 对象,100 个尺度因子,7 个首尾相连的顶点)
traffic.n1 N1 站点的观测序列与量子游走模态(QWMS 对象)
traffic.model.n1 N1 站点的已建立模型(QWMODEL 对象)

文档与论文

各函数的说明见 ?qwdap.qwalk、?qwdap.sws 等;包内附带的参考论文位于 inst/extra/qwdap_paper.pdf。

版本变更

许可证

GPL-2

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.