Kalman
Golang Kalman filter and smoother for non-uniformly sampled time series data
Install / Use
/learn @rosshemsley/KalmanREADME
⚡️Kalman Filter
A package implementing Kalman filtering and smoothing for continuous time-indexed models with non-uniform time transitions. A collection of models are also provided, including a constant velocity motion model and a Brownian motion model. Support for prediction, filtering, smoothing and sensor fusion are currently implemented.
Design
The package has two main components
Kalman Filter/Smoother
These implement state space estimation for a given model and measurements.
Model
The model (such as models.LinearModel) provide common example models for modelling
time series data. For example models.ConstantVelocityModel, models the position
and velocity of a particle over time.
Examples

For runnable examples, see /examples. Below, a full runnable example of filtering
a noisy time series. The model here is just a Brownian motion model, which assumes
that the time series represents a hidden value that is static apart from a Brownian noise
component.
package main
import (
"fmt"
"time"
"github.com/rosshemsley/kalman"
"github.com/rosshemsley/kalman/models"
)
func main() {
var t time.Time
values := []float64{1.3, 10.2, 5.0, 3.4}
model := models.NewSimpleModel(t, values[0], models.SimpleModelConfig{
InitialVariance: 1.0,
ProcessVariance: 1.0,
ObservationVariance: 2.0,
})
filter := kalman.NewKalmanFilter(model)
for _, v := range values {
t = t.Add(time.Second)
filter.Update(t, model.NewMeasurement(v))
fmt.Printf("filtered value: %f\n", model.Value(filter.State()))
}
}
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
