███ █████ ████
░░░ ░░███ ░░███
█████ ████ ░███████ █████ ████ ░███
███░░ ░░███ ░███░░███░░███ ░███ ░███
░░█████ ░███ ░███ ░███ ░███ ░███ ░███
░░░░███ ░███ ░███ ░███ ░███ ░███ ░███
██████ █████ ████████ ░░███████ █████ meow!
░░░░░░ ░░░░░ ░░░░░░░░ ░░░░░███ ░░░░░ ╱|、
███ ░███ (˚ˎ 。7
░░██████ |、˜〵
░░░░░░ じしˍ,)ノ
Tell us what the future holds, so we may know that you are gods.
Sibyl is designed first for interactive statistical exploration. Import one module, fit a model, predict a horizon, and inspect the result:
import Sibyl
model = fit defaultNaiveSettings sampleTimeSeries
forecast = predict 12 modelThe notebook facade deliberately reads like R or Python while the underlying direct modules retain checked Either results for applications. Sibyl is narrower than a general statistics toolkit: the goal is a coherent R-forecast-style workflow that starts and ends with Haskell DataFrames.
The current 0.0.0.1 surface is a stabilized foundation, not the full vision. Naive forecasting is the only release-ready model family today. ARIMA, Holt-Winters, decomposition, plotting, and dataframe-native grouped workflows remain under development and are not exposed as working features.
- Opaque
TimeSeries index valuevalues with checked construction (non-empty, equal-length vectors and a strictly increasing index). - Safe slicing, lag/lead, ordinary and seasonal differencing, and rolling aggregations.
- Rolling mean, variance, standard deviation, sum, minimum, maximum, median, and Pearson correlation.
- Simple moving average and manually or automatically tuned single exponential smoothing.
- Last-value, mean, drift, and seasonal naive forecasts with prediction intervals.
- Fitted values, residuals, model summaries, and MAE/RMSE/MAPE/MASE.
- Basic conversion of one index column and one numeric value column to/from
DataFrame. - Generic notebook operations like
fit,predict,predictWith,summarize,fitted, andresiduals
import Sibyl is the primary exploration interface.
import qualified Data.Vector.Unboxed as U
import Sibyl
sales = mkTimeSeries
(U.fromList [1..8 :: Int])
(U.fromList [10, 20, 30, 40, 12, 22, 32, 42 :: Double])
settings = defaultNaiveSettings
{ naiveMethod = Seasonal
, period = Just 4
, naiveCiLevel = 0.95
}
model = fit settings sales
forecast = predict 6 model
forecastValues = observations (predPoint forecast)
lowerBounds = observations (predLower forecast)
upperBounds = observations (predUpper forecast)
-- In IO / an IHaskell cell:
-- summarize modelThe central vocabulary is model-independent:
fit settings series
predict horizon model
predictWith horizon futureData model
summarize model
fitted model
residuals modelfit infers the model family from the settings value. predict is for models that need no future inputs. predictWith supports future regressors or other model-specific future data without complicating the common case.
Model-specific helpers such as fitNaive and forecastNaive remain as optional conveniences, if you prefer them.
Import direct modules when you need explicit error handling. They expose the same implementation through Either:
import Sibyl.Model (Prediction(..))
import Sibyl.Models.Naive (fitNaive, predictNaive)
import Sibyl.TimeSeries (index, observations, sampleTimeSeries)
main :: IO ()
main = case fitNaive sampleTimeSeries >>= predictNaive 3 of
Left err -> print err
Right prediction -> do
print (index (predPoint prediction))
print (observations (predPoint prediction))Basic interop exists today:
fromDataFrame :: Text -> Text -> DataFrame -> Either ConversionError (TimeSeries index Double)
toDataFrame :: TimeSeries index value -> DataFramebut this is first priority for the future.
Sibylis the primary notebook/REPL facade with genericfitandpredictoperations.Sibyl.TimeSerieshas checked series construction and transformations.Sibyl.Smoothingis moving-average and single-exponential smoothing.Sibyl.Accuracyhas forecasting accuracy measures.Sibyl.Modelcontains the common fitted-model, prediction, summary, and error types.Sibyl.Models.Naivehas the "safe" naive model fitting and prediction.
- DataFrame 1.1 migration and first-class single/grouped frame workflows.
- Forecast frequency/calendar policies that replace implicit
Enumindex extension. - ACF/PACF, Ljung-Box, and reference-value diagnostic tests.
- Optimized Holt/Holt-Winters with intervals.
- ARIMA/SARIMA/SARIMAX and deterministic automatic order selection.
- Rolling-origin cross-validation and accuracy by horizon.
Sibyl supports GHC 9.6.7 and 9.10.3.
cabal build all --enable-tests
cabal test allBSD-3-Clause. See LICENSE.