Install & Compatibility
Where this runs
tested against v0.1.1.13 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.282s · 178.2MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 7.6s · import 0.284s · 171MB
181MB installed
● package 181MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
dlm
✓ from pydlm import dlm
✗ import pydlm
Common mistake: `import pydlm` does not expose the DLM class; you must import `dlm` explicitly.
dlm
✓ from pydlm import dlm
✗ from pydlm.dlm import dlm
The public API is at top-level; `pydlm.dlm` is a submodule, but direct import works.
Basic usage: create a DLM, add components, fit, and forecast.
from pydlm import dlm
import numpy as np
# Generate sample time series
data = [2.0, 2.5, 3.0, 3.5, 4.0]
# Create DLM with polynomial trend of order 1 and seasonal component 4
my_dlm = dlm(data) + dlm.trend(1) + dlm.seasonal(4)
# Fit the model
my_dlm.fit()
# One-step ahead predictions
predictions = my_dlm.predictN(N=1)
print(predictions)
# Access filtered states
filtered_states = my_dlm.getFilteredObs()
print(filtered_states)
Errors
Common errors & fixes
ImportError: cannot import name 'dlm' from 'pydlm'
Outdated package or incorrect import path.
fixRun `pip install --upgrade pydlm` and use `from pydlm import dlm`.
AttributeError: module 'pydlm' has no attribute 'dlm'
Using `import pydlm` and then `pydlm.dlm`; the class is not exposed at module level.
fixUse `from pydlm import dlm`.
ValueError: Can not detect multivariate dimension from the data.
Data is not a list of floats or has unexpected dimension (e.g., 2D array).
fixPass a simple Python list: `data = list(your_series)`.
Upgrade
Version history
0.1.1.13latest on PyPI · released Aug 13, 2024
Audit
Dependencies
No dependency data recorded yet.