Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -115,17 +115,18 @@ def compute_low_y_curve(betas, z_a, y):
|
|
115 |
|
116 |
@st.cache_data
|
117 |
def compute_high_y_curve(betas, z_a, y):
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
|
|
129 |
|
130 |
def generate_z_vs_beta_plot(z_a, y, z_min, z_max, beta_steps, z_steps):
|
131 |
if z_a <= 0 or y <= 0 or z_min >= z_max:
|
|
|
115 |
|
116 |
@st.cache_data
|
117 |
def compute_high_y_curve(betas, z_a, y):
|
118 |
+
"""
|
119 |
+
Compute the expression: (-4a(a-1)yβ - 2ay + 2a(2a-1))/(1-2a)
|
120 |
+
"""
|
121 |
+
a = z_a # for clarity in the formula
|
122 |
+
betas = np.array(betas)
|
123 |
+
denominator = 1 - 2*a
|
124 |
+
|
125 |
+
if denominator == 0:
|
126 |
+
return np.full_like(betas, np.nan)
|
127 |
+
|
128 |
+
numerator = -4*a*(a-1)*y*betas - 2*a*y + 2*a*(2*a-1)
|
129 |
+
return numerator/denominator
|
130 |
|
131 |
def generate_z_vs_beta_plot(z_a, y, z_min, z_max, beta_steps, z_steps):
|
132 |
if z_a <= 0 or y <= 0 or z_min >= z_max:
|