Skip to content

Commit

Permalink
started new concept
Browse files Browse the repository at this point in the history
  • Loading branch information
CV-Neurognos committed Jul 29, 2022
1 parent 49fbda5 commit c0e898f
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions frontend/streamlit_concept_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,36 @@
#################################################################

POSITIVITY = 0.05
SIMULATIONS = 1000
SIMULATIONS = 250
NUM_SAMPLES = 10000

def simulate_population(pool_size,positivity,samples):
def simulate_population(samples,positivity,sims):
"""
input n: pool size
input n: sample number
p: positivity
sims: number of samples
sims: number of sims
returns: population """
population = np.random.binomial(pool_size, positivity, samples)
population = np.random.binomial(samples, positivity, sims)
return population

def check_positive(input_array):
if 1 in input_array:
return True
else:
return False

def mean_confidence_interval(data, confidence=0.95):
a = 1.0 * np.array(data)
n = len(a)
m, se = np.mean(a), scipy.stats.sem(a)
h = se * scipy.stats.t.ppf((1 + confidence) / 2., n - 1)
return m, m - h, m + h

#################################################################
################### SCRIPT ####################
#################################################################

x = simulate_population(pool_size = 5, positivity = POSITIVITY,samples = 1000)
print(x)
plt.hist(x)
plt.show()
# 1-. generate populations according with the positivity inputted
x = simulate_population(samples = NUM_SAMPLES, positivity = POSITIVITY, sims = SIMULATIONS)

# 2-. Randomly Distribute the number of positive

0 comments on commit c0e898f

Please sign in to comment.