<jupyter_start><jupyter_text>Study Topics  We want to simulate the real-world situation where people in your profession circle make change for their career. In the last 6 mths there are around 10 people  Assumptions Made 1. Assume the distribution of years of experience in a particular person's circle follows normal distribution with mean of the same yrs of experience of the person and regular stdev of 1.0.2. Assume that the average time for a person to switch job is around 3 yrs. So the distribution is a normal distribution follows normal distribution with mean as 5 and stdev as 1.0.3. In this study, we constrain the interested time window into 1 year or 12 months. 4. We assume the number of people a person know relatively intimately is around 50 people. 5. For people across different yrs of experience will at any time point will have 50% chance of looking for a new job.6. Assume the average preparation time is 6 month. 7. Assume the people who are looking and prepared have 35% chance to find the job they want and the other also want them. 8. Assume that the preparation could start at any time point in the year which implies a uniform distribution. **Question to answer** we are trying to figure out how many people will leave the circle based on the simulation.   Questions 1. Years of experience in total or in one company? - in this case, I think we should just concern the years of experience in one company2. The possibility of change   Simulation<jupyter_code>import numpy as np
import matplotlib.pyplot as plt

from scipy import stats
import seaborn as sns

sns.set(color_codes = True)
%matplotlib inline
%config InlineBackend.figure_format = 'retina'<jupyter_output><empty_output><jupyter_text>Hyperparameters<jupyter_code>num_pop = 50

avg_exp = 3
stdev_exp = 1.0

avg_ts = 3
stdev_ts = 1.0<jupyter_output><empty_output><jupyter_text>Simulate the yrs of experience<jupyter_code>print('number of people who are looking for a new role at any time point is %s' % len(exp_pop))<jupyter_output>number of people who are looking for a new role at any time point is 25<jupyter_text>Simulate the starting and the ending date of preparation<jupyter_code>sta_prep = np.random.uniform(low=1, high =12, size = int(num_pop/2))
sta_prep
end_prep = sta_prep + np.random.normal(6,3,int(num_pop/2))
end_prep<jupyter_output><empty_output><jupyter_text>**For those who have the end date > 12 will be ruled out becasue they pass 1 yr boundary in this case.**<jupyter_code># 1 year window size
end_pop = [i for i in end_prep if i <= 18]
len(end_pop)
# first 6 month window size 
halfyr_end_pop = [i for i in end_prep if i <= 12]
len(halfyr_end_pop)<jupyter_output><empty_output><jupyter_text>Ramdon sample these people years of experience in the company<jupyter_code>exp_pop = np.random.normal(avg_exp,stdev_exp,len(end_pop))
exp_pop
pop_w_3more_exp = [i for i in exp_pop if i >= 3]
len(pop_w_3more_exp)
pop_w_3less_exp = [i for i in exp_pop if i < 3]
len(pop_w_3less_exp)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup