pub fn calibrate_ou_params(
prices: &[f64],
) -> Result<OuProcessParams, SyntheticBacktestError>Expand description
Fits the discrete O-U process to a price series by OLS of P_t on P_{t-1} (AFML
§13.5.1, step 1).
sigma is the sample standard deviation of the residuals; equilibrium is
intercept / (1 - phi), or the mean price when phi is within 1e-12 of 1.
§Errors
SyntheticBacktestError::TooFewPricesfor fewer than three prices.SyntheticBacktestError::Invalidif a price is not finite.SyntheticBacktestError::ConstantPricesif the lagged prices are constant.SyntheticBacktestError::NonPositiveInnovationSigmaif the fit is exact (zero residual deviation).