Skip to content

Finalytics 1.0.0-rc.3

Pre-release
Pre-release

Choose a tag to compare

@Nnamdi-sys Nnamdi-sys released this 06 Nov 15:55
· 106 commits to main since this release

Added

  • Goal planning: Assets::plan (assets.plan(...) in Python and JavaScript) tests a plan of
    saving, spending and investing against one goal, an amount by a date (Target) or payments
    over a period (Payments), or projects it to a month without one. The plan runs month by month
    through simulated markets, 10,000 by default: a stationary block bootstrap of the assets'
    monthly returns (the default), a normal distribution, or every stretch of the history. Every
    amount is in today's money: returns are after inflation, a fixed rate or a price index, and
    fees. Flows are paid in (Saving) or taken out (Spending) once or regularly, and a mix is
    fixed weights or a glide path. The results give the chance of the goal and its status against
    the chance wanted; the value over time in strong, average and weak markets; for payments, the
    share paid and when the money runs short; the smallest change to the saving, the start value,
    the amount or the date that reaches the chance wanted (or the largest that keeps it); the plan
    with returns a point a year lower and with the worst twelve months of the history placed in
    it; and other mixes compared on the same simulations. The planning report shows them as a
    page, in 80 columns of text and as tables. A new crate, finalytics-plan, holds the engine;
    the finalytics::planning module re-exports it. The methods page is
    docs/methods/planning.md, and the engine is checked against an independent implementation
    in NumPy (scripts/reference/planning.py).
  • Backtests and comparisons can follow money as well as returns: start_value and flows
    (.start_value(...) and .flow(date, amount) in Rust) start each run with a value and pay
    money in or take it out on dates. The comparison and backtest reports then show each run's
    money paid in and taken out, its ending value and its money-weighted return, as text, on the
    page and in a money table.
  • A parallel feature, on by default in the finalytics crate and in the native Python package,
    runs independent work on several threads with rayon: the strategies of a comparison or
    backtest, the walk-forward fits (the first window is fitted first; then the refit dates are
    found, the other fits run at once, and the simulation runs in order), the histories of
    resampled optimisation and the points of an efficient frontier. Results are the same to the
    last bit on any number of threads, and the first error in order is the one reported. The
    thread pool is the caller's: rayon's global pool by default, sized by RAYON_NUM_THREADS.
    The WebAssembly package and Pyodide leave the feature out and run on one thread.
    finalytics_core::parallel::map is the helper.
  • The Python package releases the GIL during the engine's longer calls (building assets and
    portfolios, optimising, comparing, backtesting, reports, value and holding series, performance,
    rebalancing, scenarios, rolling statistics, statistical factor models, and solving, resampling
    and tracing the frontier of fl.opt.Problem), so other Python threads run meanwhile.
  • The minimum-semivariance optimisation report shows the downside deviation the weights reach
    (OptimisationSummary.downside_deviation), and the minimum-CDaR report the conditional
    drawdown at risk (OptimisationSummary.drawdown_at_risk, a DrawdownFigure), as the
    minimum-CVaR report shows its expected shortfall.

Changed

  • Breaking: resampled optimisation seeds each history with the k-th number SplitMix64 gives
    from the seed, so that histories can be simulated in any order. Resampled weights differ from
    rc.2's for the same seed. The reference script reimplements the new seeding. The random numbers
    are now finalytics_core::random, which plans draw from too; resampled weights are unchanged
    by the move.
  • Breaking (Rust): the backtest engine's Fitter is Send + Sync, so that fits can run on
    several threads, and it reports problems by returning an error, never by panicking: walk-forward
    validation fits every window before it uses the refits.
  • Reports of fixed weights scored on the returns given, with no method fitted, no longer call
    the periods "in sample": the header says "Fixed weights", headings name the dates alone, and
    the strategies are counted and named as portfolios ("2 portfolios", "How the portfolios were
    tested"), or as strategies when methods and fixed weights are mixed. A holdout of fixed weights
    is split "Before" and "From" the start of the test in its charts.
  • The comparison report says that its highlights and bold figures rank the strategies, beside a
    benchmark that is not ranked. With one strategy, its tiles name the figures plainly ("Sharpe
    ratio", not "Highest Sharpe ratio").
  • Names keep their case in the comparison report's tiles and notes ("Min-CVaR", not
    "min-CVaR").
  • The optimisation report's header counts three or more group limits ("11 group limits"); the
    Method section still lists each one.
  • The text backtest report gives the strategy's and benchmark's names more room before
    shortening them.
  • The methods pages on tail risk and risk decomposition explain how the historical expected
    shortfall and the Rockafellar–Uryasev tail mean differ.

Removed

  • Breaking: the S&P 500 dataset: datasets::sp500, sp500_index, sp500_companies and
    Company in Rust, with the sp500 feature; fl.datasets.sp500, sp500_table, sp500_index,
    sp500_index_table and sp500_companies in Python; datasets.sp500(), sp500Index() and
    sp500Companies() in JavaScript; and its three files from the dataset files. The files, 2.6 MB
    of CSV, are now test data in tests/sp500 in the repository, outside the packages. The
    household portfolio and the asset-class indices remain.