Probabilistic Model Specification
NimbusSDK provides pre-built probabilistic models (Bayesian LDA and Bayesian GMM) powered by RxInfer.jl, a reactive message passing framework for efficient Bayesian inference.Current Status: NimbusSDK provides ready-to-use models (Bayesian LDA / RxLDA and Bayesian GMM / RxGMM) rather than a custom model specification language. This page documents the conceptual foundations and future directions.
Available Models
Bayesian LDA (RxLDA)
API Name:RxLDAModelMathematical Model: Pooled Gaussian Classifier (PGC) A probabilistic classifier using Bayesian LDA with reactive message passing:
- Shared covariance across all classes (Pooled Gaussian Classifier)
- Fast inference: 10-20ms per trial
- Best for: Well-separated classes (motor imagery, P300)
- Mathematical model:
Bayesian GMM (RxGMM)
API Name:RxGMMModelMathematical Model: Heteroscedastic Gaussian Classifier (HGC) A more flexible classifier with class-specific covariances:
- Class-specific covariances (Heteroscedastic Gaussian Classifier)
- Moderate inference: 15-25ms per trial
- Best for: Overlapping classes, complex distributions
- Mathematical model:
Model Architecture
Both Bayesian LDA and Bayesian GMM are built on factor graphs with reactive message passing:Factor Graphs
Factor graphs represent the joint probability distribution: Components:- Prior: - uniform or learned class probabilities
- Likelihood: - Gaussian distributions
- Posterior: - computed via message passing
Reactive Message Passing
RxInfer.jl uses reactive programming for efficient inference:- Incremental processing: Process data chunks as they arrive
- Low latency: 10-25ms per chunk
- Memory efficient: Constant memory usage
- Real-time capable: Streaming inference without buffering
Training Process
Supervised Training
Both models learn from labeled training data:- Initialize parameters: (RxLDA) or (RxGMM)
- E-step: Compute posterior probabilities
- M-step: Update model parameters to maximize likelihood
- Iterate: Repeat until convergence
Model Calibration
Adapt pre-trained models to individual users:- Class means to match user-specific patterns
- Covariance to reflect user variability
- Prior probabilities based on user performance
Inference Modes
Batch Inference
Process entire trials at once:- Offline analysis
- Model validation
- Performance benchmarking
Streaming Inference
Process data incrementally in real-time:- Real-time BCI control
- Online neurofeedback
- Adaptive systems
Uncertainty Quantification
Both models provide explicit uncertainty measures:Confidence Scores
Posterior Distributions
Model Limitations
Current Limitations of RxLDA/RxGMM:
- Gaussian assumptions: Assume features follow Gaussian distributions
- Static models: No built-in temporal dynamics (use preprocessing for temporal features)
- Supervised only: Require labeled training data
- Fixed structure: Cannot modify factor graph structure
- Linear decision boundaries (RxLDA): May struggle with complex, nonlinear patterns
Future Directions
Coming Soon
Advanced Models (Planned):
- Hidden Markov Models (HMM): Temporal sequence modeling
- Kalman Filters: Continuous state tracking
- Custom Factor Graphs: User-defined probabilistic models
- Hierarchical Models: Multi-level Bayesian models
- Transfer Learning: Cross-subject model adaptation
Custom Model Development
Using RxInfer.jl Directly
Advanced users can build custom models using RxInfer.jl:Model Comparison
| Feature | RxLDA | RxGMM |
|---|---|---|
| Covariance | Shared across classes | Class-specific |
| Flexibility | Lower | Higher |
| Speed | Faster (10-20ms) | Slower (15-25ms) |
| Training Time | Fast | Moderate |
| Parameters | Fewer (efficient) | More (flexible) |
| Best For | Well-separated classes | Overlapping distributions |
| Overfitting Risk | Lower | Higher (more parameters) |
Next Steps
RxLDA Model
Deep dive into RxLDA implementation
RxGMM Model
Deep dive into RxGMM implementation
Model Training
Train custom models on your data
Streaming Inference
Real-time model deployment
Development Philosophy: NimbusSDK prioritizes battle-tested, production-ready models (RxLDA, RxGMM) over experimental architectures. Custom model specification may be added in future releases based on user demand.