Migrating from QuantStats to qis¶
Author: Artur Sepp / First recorded: 2026-10-07
Implemented in qis — Quantitative Investment Strategies. Software citation: CITATION.cff.
This guide maps a QuantStats workflow onto qis: the
reports, the qs.stats metrics and the qs.plots charts. For each metric it states whether the
two packages agree on the same input and, where they do not, which convention differs.
The qis.factsheet facade returns Matplotlib figures or saves a PDF. A separate optional
PyBloqs backend and examples
support HTML/PDF reporting.
The mappings were checked on 6 October 2026 with qis 5.33.3 and QuantStats 0.0.86, on the frozen
synthetic series used below. QuantStats has changed its statistic conventions between releases,
including how cagr counts years, so check the release you install before comparing numbers.
Reports¶
QuantStats |
qis |
Notes |
|---|---|---|
|
|
A multi-page matplotlib report saved as PDF rather than HTML. |
|
|
Choose the reporting grid with |
|
|
Tables as pandas DataFrames; see below. |
|
|
figures = qis.factsheet(
navs,
benchmark='benchmark',
reporting_frequency='monthly',
factsheet_name='Strategy versus benchmark',
)
qis.save_figs_to_pdf(figures, file_name='tearsheet', local_path=...) writes the figures to one PDF.
The factsheet reference covers the report types, including the single-strategy
report built from a backtested portfolio.
qis.factsheet also accepts the returns themselves with data_is_returns=True. In qis releases
after 5.33.3 that path adds the same base observation, one period of the inferred native
frequency before a non-zero first return, so it renders the same report as the NAVs above. In
qis 5.33.3 and earlier it compounds through qis.returns_to_nav without a base and drops the
first return, so pass the NAVs above instead.
QuantStats metrics and qis columns¶
QuantStats computes its metrics on daily simple returns annualised with periods=252. qis states
its conventions in PerfParams. These parameters select the same daily simple-return grid:
daily = qis.PerfParams(freq='B', freq_skewness='B', return_type=qis.ReturnTypes.RELATIVE)
performance = qis.compute_ra_perf_table_with_benchmark(
prices=navs, benchmark='benchmark', perf_params=daily
)
moments = qis.compute_risk_table(prices=navs, perf_params=daily)
freq='B' sets the volatility, regression and excess-return grids to business days, and
ReturnTypes.RELATIVE computes volatility from simple rather than log returns. freq does not
set the skewness grid, which keeps its monthly default unless freq_skewness is given.
On the synthetic strategy above, with the NAV base observation:
QuantStats metric |
QuantStats |
qis column |
qis |
Agree? |
|---|---|---|---|---|
|
0.5594 |
|
0.5594 |
Yes |
|
0.1636 |
|
0.1636 |
Yes, with |
|
0.4098 |
|
0.4098 |
Yes |
|
−0.2869 |
|
−0.2869 |
Yes, with the base observation |
|
0.1469 |
|
0.1469 |
Yes, with |
|
0.0676 |
|
0.0676 |
Yes, with |
|
1.6636 |
|
1.6636 |
Yes, on the daily regression grid |
|
0.005923 |
|
0.005923 |
Yes, on the daily regression grid |
|
0.0551 |
|
0.0571 |
No: year count |
|
0.1922 |
|
0.1992 |
No: annual return in the numerator |
|
0.6021 |
|
0.6154 |
No: different definition |
|
0.0256 |
|
0.4064 |
No: qis annualises by \(\sqrt{252}\) |
The differences come from a few conventions:
Annual return. In 0.0.86,
cagrcounts years as the number of returns divided byperiods. qis counts calendar days divided by 365.25 between the first and last NAV dates. The statistic catalogue gives every qis formula.Two Sharpe ratios.
qs.stats.sharpeis the arithmetic Sharpe ratio, \(\sqrt{252}\,\bar r/s(r)\), which isSHARPE_ARITH. The qis column labelledSharpe (rf=0),SHARPE_RF0, divides the per-annum compounded return by volatility; on this series it is 0.349. See the three table conventions.Sortino ratio. QuantStats divides the mean return by the root mean square of the negative returns over all observations. qis divides the per-annum excess return by the standard deviation of the negative returns only.
Information ratio.
qs.stats.information_ratiois the per-period mean of the active return over its standard deviation, not annualised.qis.compute_te_ir_errorsreturns the annualised tracking error and information ratio of the return differences you pass it.
The information ratio in the table comes from daily simple-return differences:
active = (returns - benchmark).to_frame('strategy vs benchmark')
tracking_error, information_ratio = qis.compute_te_ir_errors(active)
Risk-free rate¶
QuantStats takes rf as an annual rate, or a series, and converts a constant rate to a per-period
rate as \((1+r_f)^{1/252}-1\). qis takes a series of annualised cash rates in
PerfParams.rates_data and accrues it by calendar days; the excess columns, such as
SHARPE_EXCESS and SHARPE_ARITH_EXCESS, use it. See
excess returns and funding.
Metrics without a column¶
qs.stats.sharpe(smart=True) applies an autocorrelation penalty. qis does not adjust the table
Sharpe ratio; the serial dependence chapter shows how
autocorrelation changes annualised volatility and the Sharpe ratio. value_at_risk, conditional_value_at_risk and
the remaining QuantStats metrics have no column in the qis performance tables. win_rate excludes
zero returns from its denominator, while the POSITIVE column of qis.compute_desc_table counts
every observation.
Plots¶
QuantStats |
qis |
Notes |
|---|---|---|
|
|
Cumulative NAV with the drawdown panel. |
|
|
|
|
|
|
|
|
|
|
|
qis rolls over log returns; values differ from the simple-return version. |
|
|
|
|
|
An exponentially weighted beta rather than fixed windows. |
|
|
Years by months, with an annual column. |
|
|
|
|
|
|
|
No direct counterpart |
qis resampling and the bootstrap covers block-bootstrap paths. |
QuantStats’ default rolling window is 126 periods; qis defaults to 260, so pass roll_periods to
compare like with like:
strategy_nav = navs['strategy']
snapshot = qis.plot_prices_with_dd(prices=strategy_nav)
rolling_sharpe = qis.plot_rolling_perf_stat(
prices=strategy_nav, rolling_perf_stat=qis.RollingPerfStat.SHARPE,
roll_periods=126, roll_freq='B',
)
heatmap = qis.plot_returns_heatmap(prices=strategy_nav)
yearly = qis.plot_periodic_returns_table(prices=navs, freq='YE')
monthly_returns = qis.to_returns(prices=strategy_nav, freq='ME', drop_first=True)
distribution = qis.plot_histogram(df=monthly_returns)
Pandas extensions¶
qs.extend_pandas() attaches QuantStats functions as methods on pandas objects, as in
returns.sharpe(). qis has no pandas extension; call the qis functions with the series as an
argument.
See also¶
References¶
QuantStats contributors. Repository, including stats.py and reports.py.
Sepp, A. qis: Performance analytics, portfolio backtesting, risk analysis, and factsheet reporting in Python. Software citation metadata.