Abubakari commited on
Commit
20c702f
1 Parent(s): a7663b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -9
app.py CHANGED
@@ -12,15 +12,23 @@ def Phi(z):
12
  def phi(z):
13
  return norm.pdf(z)
14
 
15
-
16
- def F_BCNOLLN(y1, y2, params):
17
- z1 = (y1 - mu_1) / sigma_1
18
- z2 = (y2 - mu_2) / sigma_2
19
- term = (Phi(z1)*params["alpha_1"] / H(z1, params["alpha_1"], params["beta_1"]))*(-params["lambda_val"]) + \
20
- (Phi(z2)*params["alpha_2"] / H(z2, params["alpha_2"], params["beta_2"]))*(-params["lambda_val"]) - 1
21
- return term**(-1/params["lambda_val"])
22
-
23
-
 
 
 
 
 
 
 
 
24
 
25
  def f_BCNOLLN(y1, y2, mu1, sigma1, alpha1, beta1, mu2, sigma2, alpha2, beta2, lambd):
26
  z1 = (y1 - mu1) / sigma1
 
12
  def phi(z):
13
  return norm.pdf(z)
14
 
15
+ # Define the BCNOLLN CDF based on the provided formula
16
+ def F_BCNOLLN(y1, y2, mu1, sigma1, alpha1, beta1, mu2, sigma2, alpha2, beta2, lambd):
17
+ # Convert y1, y2 to z-scores
18
+ z1 = (y1 - mu1) / sigma1
19
+ z2 = (y2 - mu2) / sigma2
20
+
21
+ # Compute H functions
22
+ H1_z1 = Phi(z1)**alpha1 + (1 - Phi(z1))**beta1
23
+ H2_z2 = Phi(z2)**alpha2 + (1 - Phi(z2))**beta2
24
+
25
+ # Compute the BCNOLLN CDF
26
+ term1 = (Phi(z1)*alpha1 / H1_z1)**(-lambd)
27
+ term2 = (Phi(z2)*alpha2 / H2_z2)**(-lambd)
28
+ term = term1 + term2 - 1
29
+ cdf = term**(-1/lambd)
30
+
31
+ return cdf
32
 
33
  def f_BCNOLLN(y1, y2, mu1, sigma1, alpha1, beta1, mu2, sigma2, alpha2, beta2, lambd):
34
  z1 = (y1 - mu1) / sigma1