Summary: Speed#

This file provides a concise summary of the speed benchmarks provided previously.

  1. Fifty tests were performed with varying number of x-values in the x-array to be evaluated.

  2. In the majority of test cases, the pymultifit implementation performs faster then scipy.

  3. However, beta consistently show performance parity with scipy. Notable performance degradations are observed in these distributions.

  4. Other distributions, such as arcsine, and foldnorm exhibit some variability, with occasional high computation time from pymultifit.

Overall, the benchmarks suggest that pymultifit implementations generally offers better performance over large values of x-array sizes. These comparisons are made using scalar (float) parameters only. The custom distributions do not yet support broadcasting over array-valued parameters (e.g., mu, sigma, etc.) like SciPy’s implementations do.

[1]:
import numpy as np
import pandas as pd

from functions import boxplot_comparison, heatmap

All the PDF/CDF functions were applied on the following number of points in x-arrays

[2]:
n_points_list = np.logspace(0.3, 6, num=50, dtype=int)

print(n_points_list)
[      1       2       3       4       5       7       9      13      17
      22      29      37      49      64      84     110     144     189
     247     323     423     553     723     945    1235    1614    2111
    2759    3606    4714    6163    8056   10530   13764   17992   23519
   30743   40186   52530   68664   89755  117324  153360  200466  262039
  342526  447734  585257  765021 1000000]

PDF comparison#

[3]:
m_df1 = pd.read_csv('./PDF_multifit_df.csv')
s_df1 = pd.read_csv('./PDF_scipy_df.csv')

m_df2 = pd.read_csv('./PDF_multifit_variable_df.csv')
s_df2 = pd.read_csv('./PDF_scipy_variable_df.csv')
[4]:
heatmap(m_df1, s_df1, 'standard parameter PDF')
boxplot_comparison(m_df1, s_df1, 'standard parameter PDFs')
../_images/benchmarks__bm_summary_6_0.png
../_images/benchmarks__bm_summary_6_1.png
[5]:
heatmap(m_df2, s_df2, 'variable parameter PDF')
boxplot_comparison(m_df2, s_df2, 'variable parameter PDFs')
../_images/benchmarks__bm_summary_8_0.png
../_images/benchmarks__bm_summary_8_1.png

CDF comparison#

[6]:
m_df1 = pd.read_csv('./CDF_multifit_df.csv')
s_df1 = pd.read_csv('./CDF_scipy_df.csv')

m_df2 = pd.read_csv('./CDF_multifit_variable_df.csv')
s_df2 = pd.read_csv('./CDF_scipy_variable_df.csv')
[7]:
heatmap(m_df1, s_df1, 'standard parameter CDF')
boxplot_comparison(m_df1, s_df1, 'standard parameter CDFs')
../_images/benchmarks__bm_summary_11_0.png
../_images/benchmarks__bm_summary_11_1.png
[8]:
heatmap(m_df2, s_df2, 'variable parameter CDF')
boxplot_comparison(m_df2, s_df2, 'variable parameter CDFs')
../_images/benchmarks__bm_summary_12_0.png
../_images/benchmarks__bm_summary_12_1.png