toraniko-model

Crates.iotoraniko-model
lib.rstoraniko-model
version0.2.0
created_at2025-12-22 15:28:45.258944+00
updated_at2025-12-25 15:46:38.072938+00
descriptionFactor return estimation for the toraniko factor model
homepagehttps://github.com/factordynamics/toraniko-rs
repositoryhttps://github.com/factordynamics/toraniko-rs
max_upload_size
id1999872
size98,453
refcell (refcell)

documentation

README

toraniko-model

Factor return estimation for the toraniko factor model.

Overview

This crate provides the core factor return estimation logic, implementing a characteristic factor model similar to Barra and Axioma systems.

Key Types

  • FactorReturnsEstimator - Main entry point for factor return estimation
  • EstimatorConfig - Configuration for the estimator

Usage

use 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,
)?;

Mathematical Model

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 return
  • r_sector are sector factor returns (constrained to sum to zero)
  • r_style are style factor returns
  • ε is the idiosyncratic residual
Commit count: 0

cargo fmt