Scénario de test & Cas d'usage
Analysis and forecasting of univariate time series.
Discover all actions of uniTimeSeriesCreation of an hourly time series for one month. We intentionally introduce missing values for the 'demand' variable to simulate sensor outages. The data's variance is also made to increase over time to justify a transformation.
| 1 | DATA mycas.hourly_demand; |
| 2 | FORMAT timestamp datetime20.; |
| 3 | DO i = 0 to 720; |
| 4 | timestamp = intnx('hour', '01jan2024:00:00:00'dt, i); |
| 5 | base_demand = 500 + 100 * sin(2 * 3.14159 * (hour(timestamp) / 24)); |
| 6 | demand = base_demand + (i/10) * rannor(54321); |
| 7 | IF ranuni(1) > 0.95 THEN call missing(demand); /* Introduce 5% missing values */ |
| 8 | OUTPUT; |
| 9 | END; |
| 10 | RUN; |
| 1 | PROC CAS; |
| 2 | uniTimeSeries.arima / |
| 3 | TABLE={name='hourly_demand', caslib='mycas'}, |
| 4 | timeId={name='timestamp'}, |
| 5 | interval='hour', |
| 6 | trimId='BOTH', |
| 7 | series={name='demand', model={estimate={transform='BOXCOX', p=1, diff=1, method='ML'}, forecast={lead=24}}}, |
| 8 | outFor={name='demand_forecast', caslib='mycas', replace=true}, |
| 9 | outStat={name='demand_stats', caslib='mycas', replace=true}; |
| 10 | RUN; |
| 11 | QUIT; |
The action must complete without errors, demonstrating its ability to handle embedded missing values. The 'demand_stats' output table should show the fit statistics for the model applied to the Box-Cox transformed series, and it should also report the selected lambda for the transformation. The 'demand_forecast' table will contain 24 hours of forecasted demand, correctly back-transformed to the original scale.