lifejacket 1.0.0__py3-none-any.whl → 1.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lifejacket/calculate_derivatives.py +0 -2
- lifejacket/constants.py +4 -16
- lifejacket/deployment_conditioning_monitor.py +19 -12
- lifejacket/form_adjusted_meat_adjustments_directly.py +25 -27
- lifejacket/get_datum_for_blowup_supervised_learning.py +71 -77
- lifejacket/helper_functions.py +15 -148
- lifejacket/input_checks.py +49 -50
- lifejacket/{after_study_analysis.py → post_deployment_analysis.py} +127 -124
- lifejacket/small_sample_corrections.py +11 -13
- {lifejacket-1.0.0.dist-info → lifejacket-1.0.2.dist-info}/METADATA +1 -1
- lifejacket-1.0.2.dist-info/RECORD +17 -0
- lifejacket-1.0.2.dist-info/entry_points.txt +2 -0
- lifejacket-1.0.0.dist-info/RECORD +0 -17
- lifejacket-1.0.0.dist-info/entry_points.txt +0 -2
- {lifejacket-1.0.0.dist-info → lifejacket-1.0.2.dist-info}/WHEEL +0 -0
- {lifejacket-1.0.0.dist-info → lifejacket-1.0.2.dist-info}/top_level.txt +0 -0
|
@@ -18,20 +18,18 @@ def perform_desired_small_sample_correction(
|
|
|
18
18
|
small_sample_correction,
|
|
19
19
|
per_subject_joint_adjusted_meat_contributions,
|
|
20
20
|
per_subject_classical_meat_contributions,
|
|
21
|
-
|
|
21
|
+
per_subject_classical_bread_contributions,
|
|
22
22
|
num_subjects,
|
|
23
23
|
theta_dim,
|
|
24
24
|
):
|
|
25
25
|
|
|
26
|
-
# We first compute the classical
|
|
26
|
+
# We first compute the classical bread matrix and invert it. While
|
|
27
27
|
# it is possible to avoid this inversion using a QR decomposition and
|
|
28
28
|
# solving linear systems (discussed more below), we typically don't have
|
|
29
29
|
# issues with the conditioning of just the classical bread.
|
|
30
|
-
|
|
31
|
-
per_subject_classical_bread_inverse_contributions, axis=0
|
|
32
|
-
)
|
|
30
|
+
classical_bread_matrix = jnp.mean(per_subject_classical_bread_contributions, axis=0)
|
|
33
31
|
classical_bread_matrix = invert_matrix_and_check_conditioning(
|
|
34
|
-
|
|
32
|
+
classical_bread_matrix,
|
|
35
33
|
)[0]
|
|
36
34
|
|
|
37
35
|
# These will hold either corrective matrices or scalar weights depending on
|
|
@@ -43,9 +41,9 @@ def perform_desired_small_sample_correction(
|
|
|
43
41
|
per_subject_classical_correction_weights = np.ones(num_subjects)
|
|
44
42
|
if small_sample_correction == SmallSampleCorrections.NONE:
|
|
45
43
|
logger.info(
|
|
46
|
-
"No small sample correction requested. Using the raw per-subject joint adjusted bread
|
|
44
|
+
"No small sample correction requested. Using the raw per-subject joint adjusted bread contributions."
|
|
47
45
|
)
|
|
48
|
-
elif small_sample_correction == SmallSampleCorrections.
|
|
46
|
+
elif small_sample_correction == SmallSampleCorrections.Z1theta:
|
|
49
47
|
logger.info(
|
|
50
48
|
"Using HC1 small sample correction at the subject trajectory level. Note that we are treating the number of parameters as simply the size of theta, despite the presence of betas."
|
|
51
49
|
)
|
|
@@ -53,12 +51,12 @@ def perform_desired_small_sample_correction(
|
|
|
53
51
|
per_subject_classical_correction_weights
|
|
54
52
|
) = (num_subjects / (num_subjects - theta_dim) * np.ones(num_subjects))
|
|
55
53
|
elif small_sample_correction in {
|
|
56
|
-
SmallSampleCorrections.
|
|
57
|
-
SmallSampleCorrections.
|
|
54
|
+
SmallSampleCorrections.Z2theta,
|
|
55
|
+
SmallSampleCorrections.Z3theta,
|
|
58
56
|
}:
|
|
59
57
|
logger.info("Using %s small sample correction at the subject trajectory level.")
|
|
60
58
|
|
|
61
|
-
power = 1 if small_sample_correction == SmallSampleCorrections.
|
|
59
|
+
power = 1 if small_sample_correction == SmallSampleCorrections.Z2theta else 2
|
|
62
60
|
|
|
63
61
|
# It turns out to typically not make sense to compute the adjusted analog
|
|
64
62
|
# of the classical leverages, since this involves correcting the joint adjusted meat matrix
|
|
@@ -75,12 +73,12 @@ def perform_desired_small_sample_correction(
|
|
|
75
73
|
|
|
76
74
|
# TODO: Write a unit test for some level of logic here and then rewrite this to not require
|
|
77
75
|
# the classical bread explicitly. May be slower, probably needs a for loop so that can use
|
|
78
|
-
# a solver for each matrix multiplication after a QR decomposition of the bread
|
|
76
|
+
# a solver for each matrix multiplication after a QR decomposition of the bread
|
|
79
77
|
# transpose.
|
|
80
78
|
classical_leverages_per_subject = (
|
|
81
79
|
np.einsum(
|
|
82
80
|
"nij,ji->n",
|
|
83
|
-
|
|
81
|
+
per_subject_classical_bread_contributions,
|
|
84
82
|
classical_bread_matrix,
|
|
85
83
|
)
|
|
86
84
|
/ num_subjects
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
lifejacket/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
lifejacket/arg_threading_helpers.py,sha256=jiPdG-1USYUXqXAEfRPL-3KBKno7uMr4-fCl9GrZ7Fw,17599
|
|
3
|
+
lifejacket/calculate_derivatives.py,sha256=Jv-N54lbUSi36H9hTKtupy0ReoXKzI8mFlgqmQddL5U,37476
|
|
4
|
+
lifejacket/constants.py,sha256=cQjA2-YRwsGDMjsndkbFK7m56xbVpUo-XCyyg9gY1BA,313
|
|
5
|
+
lifejacket/deployment_conditioning_monitor.py,sha256=Go4YhJZfkwj9g0mP0vYCVROKS397CIviHUtprdLNYTk,43813
|
|
6
|
+
lifejacket/form_adjusted_meat_adjustments_directly.py,sha256=AVlGOuw_FgVDcVnhQs1GorxtBMKUXvmYCQZgqG675k4,13539
|
|
7
|
+
lifejacket/get_datum_for_blowup_supervised_learning.py,sha256=sCH-PlrFlLJgCYpTmdeasiHwHYSEy9wxspkOTDuDPuY,58594
|
|
8
|
+
lifejacket/helper_functions.py,sha256=SdAbUwXNx-3JFsyTfLyliQ7kUOm0eABaiNgoYLR8NG0,16967
|
|
9
|
+
lifejacket/input_checks.py,sha256=q7HFZq5n18edQU8X5laONsBgWSMidLRy6Nhqdw5FpOw,47084
|
|
10
|
+
lifejacket/post_deployment_analysis.py,sha256=XdKObve0hOXVwPWSDD2lEEfrWAdcZK-c-uh53HIrKLM,82664
|
|
11
|
+
lifejacket/small_sample_corrections.py,sha256=aB6qi-r3ANoBMgf2Oo5-lCXCy_L4H3FlBffGwPcfXkg,5610
|
|
12
|
+
lifejacket/vmap_helpers.py,sha256=pZqYN3p9Ty9DPOeeY9TKbRJXR2AV__HBwwDFOvdOQ84,2688
|
|
13
|
+
lifejacket-1.0.2.dist-info/METADATA,sha256=L48u8IMsEXMTwtBJlFwh4mJ-pZUD8NcQEuqgjV0zkjo,1773
|
|
14
|
+
lifejacket-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
+
lifejacket-1.0.2.dist-info/entry_points.txt,sha256=CZ9AUPN0xfnpYqwtGTr6n9l5mpyEOddsXX8fnxKRB6U,71
|
|
16
|
+
lifejacket-1.0.2.dist-info/top_level.txt,sha256=vKl8m7jOQ4pkbzVuHCJsq-8LcXRrOAWnok3bBo9qpsE,11
|
|
17
|
+
lifejacket-1.0.2.dist-info/RECORD,,
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
lifejacket/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
lifejacket/after_study_analysis.py,sha256=-6LCfl0dz9eHkP5aLs-J2YqpxVJ57J8Ov4wEWKbZMWA,83315
|
|
3
|
-
lifejacket/arg_threading_helpers.py,sha256=jiPdG-1USYUXqXAEfRPL-3KBKno7uMr4-fCl9GrZ7Fw,17599
|
|
4
|
-
lifejacket/calculate_derivatives.py,sha256=wFMS1pSm5MI8D7FYK2nPEAdvtVJAxKy8OVtUj7giII0,37520
|
|
5
|
-
lifejacket/constants.py,sha256=2L05p6NJ7l3qRZ1hD2KlrvzWF1ReSmWRUkULPIhdvJo,842
|
|
6
|
-
lifejacket/deployment_conditioning_monitor.py,sha256=5PMBfDQfyxwoYXr3qh1pTdMBefnSjjQMFyCj3_sItVY,43526
|
|
7
|
-
lifejacket/form_adjusted_meat_adjustments_directly.py,sha256=ML7FOB_hnDEM1ndC2X4j_oaqdqn-EPr9j-MetlOqSE8,13740
|
|
8
|
-
lifejacket/get_datum_for_blowup_supervised_learning.py,sha256=SjA3H7H8RBZc9GxzgsccqZoLZnAD68mxaPH1E87s2lA,59092
|
|
9
|
-
lifejacket/helper_functions.py,sha256=ldkanFn5b2lwBlni-HtXPVd7QvxEKmzL1UsJMsG6f6g,23478
|
|
10
|
-
lifejacket/input_checks.py,sha256=RhS2tnq74jOU5_pVSXsxthSmuGhlmoMc5eJiourQiS0,47513
|
|
11
|
-
lifejacket/small_sample_corrections.py,sha256=bnbtxjEKZBiFrCSF2WA0vczaVeIqao1NekxJRZdmwCU,5692
|
|
12
|
-
lifejacket/vmap_helpers.py,sha256=pZqYN3p9Ty9DPOeeY9TKbRJXR2AV__HBwwDFOvdOQ84,2688
|
|
13
|
-
lifejacket-1.0.0.dist-info/METADATA,sha256=UGZsalPpzX8K7BnstZ0RDFq-1ZpL5CsXcUd_hYvQWus,1773
|
|
14
|
-
lifejacket-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
-
lifejacket-1.0.0.dist-info/entry_points.txt,sha256=4k8ibVIUT-OHxPaaDv-QwWpC64ErzhdemHpTAXCnb8w,67
|
|
16
|
-
lifejacket-1.0.0.dist-info/top_level.txt,sha256=vKl8m7jOQ4pkbzVuHCJsq-8LcXRrOAWnok3bBo9qpsE,11
|
|
17
|
-
lifejacket-1.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|