| Crates.io | toraniko-model |
| lib.rs | toraniko-model |
| version | 0.2.0 |
| created_at | 2025-12-22 15:28:45.258944+00 |
| updated_at | 2025-12-25 15:46:38.072938+00 |
| description | Factor return estimation for the toraniko factor model |
| homepage | https://github.com/factordynamics/toraniko-rs |
| repository | https://github.com/factordynamics/toraniko-rs |
| max_upload_size | |
| id | 1999872 |
| size | 98,453 |
Factor return estimation for the toraniko factor model.
This crate provides the core factor return estimation logic, implementing a characteristic factor model similar to Barra and Axioma systems.
FactorReturnsEstimator - Main entry point for factor return estimationEstimatorConfig - Configuration for the estimatoruse toraniko_model::{FactorReturnsEstimator, EstimatorConfig};
use toraniko_traits::ReturnsEstimator;
let estimator = FactorReturnsEstimator::with_config(EstimatorConfig {
winsor_factor: Some(0.05),
residualize_styles: true,
});
let (factor_returns, residuals) = estimator.estimate(
returns_df,
mkt_cap_df,
sector_df,
style_df,
)?;
The factor model decomposes asset returns as:
r_asset = β_market * r_market + Σ(β_sector * r_sector) + Σ(β_style * r_style) + ε
Where:
r_market is the market factor returnr_sector are sector factor returns (constrained to sum to zero)r_style are style factor returnsε is the idiosyncratic residual