Implementation:Rapidsai Cuml Make Arima
| Knowledge Sources | |
|---|---|
| Domains | Machine_Learning, Time_Series |
| Last Updated | 2026-02-08 12:00 GMT |
Overview
Generates synthetic time series datasets by simulating an ARIMA (AutoRegressive Integrated Moving Average) process of a given order on the GPU.
Description
The ML::Datasets::make_arima function produces batches of synthetic time series data by simulating an ARIMA process. It accepts parameters controlling the batch size, number of observations per series, the ARIMA order (p, d, q and seasonal components), and scaling factors for starting values, residual noise, and intercept terms. A random seed parameter enables reproducible generation.
Two overloads are provided: one for single-precision (float) and one for double-precision (double) output. The function operates within the cuML handle context, ensuring proper GPU resource management and CUDA stream ordering.
The ARIMA order is specified via the ARIMAOrder struct defined in cuml/tsa/arima_common.h, which encapsulates the (p, d, q) x (P, D, Q, s) specification.
Usage
Use this function to generate synthetic ARIMA time series data for testing, benchmarking, or prototyping time series forecasting models on GPU. It is the GPU-accelerated equivalent of manually simulating ARIMA processes with libraries like statsmodels.
Code Reference
Source Location
- Repository: Rapidsai_Cuml
- File:
cpp/include/cuml/datasets/make_arima.hpp
Signature
namespace ML {
namespace Datasets {
void make_arima(const raft::handle_t& handle,
float* out,
int batch_size,
int n_obs,
ARIMAOrder order,
float scale = 1.0f,
float noise_scale = 0.2f,
float intercept_scale = 1.0f,
uint64_t seed = 0ULL);
void make_arima(const raft::handle_t& handle,
double* out,
int batch_size,
int n_obs,
ARIMAOrder order,
double scale = 1.0,
double noise_scale = 0.2,
double intercept_scale = 1.0,
uint64_t seed = 0ULL);
} // namespace Datasets
} // namespace ML
Import
#include <cuml/datasets/make_arima.hpp>
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| handle | const raft::handle_t& | Yes | cuML handle for GPU resource management |
| batch_size | int | Yes | Number of time series to generate in the batch |
| n_obs | int | Yes | Number of observations (time steps) per series |
| order | ARIMAOrder | Yes | ARIMA order specification (p, d, q, P, D, Q, s) |
| scale | float/double | No (default 1.0) | Scale used to draw the starting values |
| noise_scale | float/double | No (default 0.2) | Scale used to draw the residuals (noise) |
| intercept_scale | float/double | No (default 1.0) | Scale used to draw the intercept |
| seed | uint64_t | No (default 0) | Seed for the random number generator |
Outputs
| Name | Type | Description |
|---|---|---|
| out | float*/double* | Device pointer to the generated time series data [dim = batch_size x n_obs] |
Usage Examples
#include <cuml/datasets/make_arima.hpp>
#include <cuml/tsa/arima_common.h>
#include <raft/core/handle.hpp>
void generate_arima_data() {
raft::handle_t handle;
int batch_size = 10;
int n_obs = 100;
// Define ARIMA(1,1,1) order
ARIMAOrder order;
order.p = 1; order.d = 1; order.q = 1;
order.P = 0; order.D = 0; order.Q = 0; order.s = 0;
order.k = 0;
// Allocate device memory for output
float* out;
cudaMalloc(&out, batch_size * n_obs * sizeof(float));
// Generate synthetic ARIMA time series
ML::Datasets::make_arima(handle, out, batch_size, n_obs, order,
1.0f, // scale
0.2f, // noise_scale
1.0f, // intercept_scale
42ULL); // seed
handle.sync_stream();
// Use 'out' for downstream testing or benchmarking...
cudaFree(out);
}