Coverage for src/jsharpe/sharpe/__init__.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.14.3, created at 2026-06-29 13:57 +0000

1"""Sharpe-related utilities for statistical analysis and hypothesis testing. 

2 

3This package provides comprehensive tools for Sharpe ratio analysis, including: 

4 - Variance estimation under non-Gaussian returns 

5 - Statistical significance testing 

6 - Multiple testing corrections (FDR, FWER) 

7 - Portfolio optimization utilities 

8 

9The implementation is split across topical sub-modules: 

10 - :mod:`jsharpe.sharpe.linalg`: probability points and covariance helpers 

11 - :mod:`jsharpe.sharpe.clustering`: effective rank and clustering 

12 - :mod:`jsharpe.sharpe.quadrature`: Gauss-Hermite expectation and moments 

13 - :mod:`jsharpe.sharpe.psr`: Sharpe variance, track record and PSR core 

14 - :mod:`jsharpe.sharpe.corrections`: FWER/FDR multiple-testing corrections 

15 - :mod:`jsharpe.sharpe.generators`: synthetic data and autocorrelation 

16 

17The full public API is re-exported here so existing imports such as 

18``from jsharpe.sharpe import sharpe_ratio_variance`` keep resolving unchanged. 

19""" 

20 

21from .clustering import effective_rank, number_of_clusters 

22from .corrections import ( 

23 FDR_critical_value, 

24 adjusted_p_values_bonferroni, 

25 adjusted_p_values_holm, 

26 adjusted_p_values_sidak, 

27 control_for_FDR, 

28 oFDR, 

29 pFDR, 

30) 

31from .generators import ( 

32 autocorrelation, 

33 generate_autocorrelated_non_gaussian_data, 

34 generate_non_gaussian_data, 

35 get_random_correlation_matrix, 

36) 

37from .linalg import ( 

38 minimum_variance_weights_for_correlated_assets, 

39 ppoints, 

40 robust_covariance_inverse, 

41) 

42from .psr import ( 

43 critical_sharpe_ratio, 

44 expected_maximum_sharpe_ratio, 

45 minimum_track_record_length, 

46 probabilistic_sharpe_ratio, 

47 sharpe_ratio_power, 

48 sharpe_ratio_variance, 

49 variance_of_the_maximum_of_k_Sharpe_ratios, 

50) 

51from .quadrature import E_under_normal, make_expectation_gh, moments_Mk 

52 

53__all__ = [ 

54 "E_under_normal", 

55 "FDR_critical_value", 

56 "adjusted_p_values_bonferroni", 

57 "adjusted_p_values_holm", 

58 "adjusted_p_values_sidak", 

59 "autocorrelation", 

60 "control_for_FDR", 

61 "critical_sharpe_ratio", 

62 "effective_rank", 

63 "expected_maximum_sharpe_ratio", 

64 "generate_autocorrelated_non_gaussian_data", 

65 "generate_non_gaussian_data", 

66 "get_random_correlation_matrix", 

67 "make_expectation_gh", 

68 "minimum_track_record_length", 

69 "minimum_variance_weights_for_correlated_assets", 

70 "moments_Mk", 

71 "number_of_clusters", 

72 "oFDR", 

73 "pFDR", 

74 "ppoints", 

75 "probabilistic_sharpe_ratio", 

76 "robust_covariance_inverse", 

77 "sharpe_ratio_power", 

78 "sharpe_ratio_variance", 

79 "variance_of_the_maximum_of_k_Sharpe_ratios", 

80]