Expand description
Simple and logarithmic returns from prices.
§Error handling (v0.1+)
All public functions return FinanceResult. Empty series, zero start prices, and
non-positive prices for log/CAGR paths are structured errors.
Functions§
- cagr
- Compound annual growth rate:
(end / start)^(1/years) - 1. - log_
return - Logarithmic return:
ln(p1 / p0). Requires strictly positive prices. - log_
returns - Log returns for consecutive prices: length
prices.len() - 1. - mean_
return - Arithmetic mean of a return series.
- simple_
return - Simple return between two prices:
(p1 - p0) / p0. - simple_
returns - Simple returns for consecutive prices: length
prices.len() - 1. - total_
return - Total simple return from first to last price:
(end - start) / start.