moru-quant 0.1.0

Rust library for quantitative finance and derivatives valuation: option pricing, implied volatility, Greeks, yield curves, and finite-difference / Monte Carlo engines.
Documentation
//! # moru-quant
//!
//! Rust library for quantitative finance and derivatives valuation: option
//! pricing, implied volatility, Greeks, yield curves, and finite-difference /
//! Monte Carlo engines.
//!
//! The repository's `docs/design/architecture.md` describes the planned
//! module layout.
//!
//! ## API map
//!
//! | Module | Purpose | Start from |
//! |---|---|---|
//! | [`math`] | Special functions: standard normal PDF, CDF, inverse CDF | [`math::normal::cdf`] |
//! | [`analytic`] | Closed-form prices: generalized Black–Scholes–Merton | [`analytic::bsm::Inputs::new`], then [`analytic::bsm::price`] |
//!
//! Every fallible function returns [`Error`], which names the rejected
//! input and its value, or the derived quantity that is not representable.
//!
//! ## Example
//!
//! ```
//! use moru_quant::analytic::bsm::{self, Inputs};
//! use moru_quant::analytic::OptionType;
//!
//! // Futures option (Black 1976): cost of carry b = 0.
//! let inputs = Inputs::new(19.0, 19.0, 0.10, 0.0, 0.28, 0.75)?;
//! let call = bsm::price(OptionType::Call, &inputs);
//! assert!((call - 1.7011).abs() < 5e-5);
//! # Ok::<(), moru_quant::Error>(())
//! ```

pub mod analytic;
mod error;
pub mod math;

pub use error::{Error, Input};