Пример #1
0
dArrayNptsd = deque([0.])
plotWidth = 500

agents = []
totInput = [0.]

minSep = .0025
rSigma = .3

dataFileName = ''


# Initialize random seed
seed(3)
if doingLogging:
    writelog.init('run.log')


# Codes for four-point Bezier spline
codes = [Path.MOVETO,
         Path.CURVE4,
         Path.CURVE4,
         Path.CURVE4,
         ]

#%%########[ probRaceEthncy ]#######
def probDemographics(boroIndx):
#
# For each demographic category [Income, Age, Sex, Race-Ethnicity]
# establish thresholds such that a random % variable rand()*100. is
# likely to fall into the appropriate category matching demographics
lastX = 0.
lastT = 0.
dt = 1
dArray = deque([0.])
tArray = deque([0.])
plotWidth = 500
isFemale = 0
isYoung = 1
race = 'white'
ethn = 'hispanic'
income = 'lowrange'
hadStressors = 0
nSandyTraumas = 0
PTSD_sx = 0

writelog.init('PTSD_Combo1.log')
writelog.write('sex \t age \t race \t ethn \t\t income \t hadStr  nSandTr exp(P)\n')
writelog.write('=== \t === \t ==== \t ==== \t\t ====== \t ======  ======= ======\n\n')

plt.close('all')
fig = plt.figure(figsize=(12,6))
fig.canvas.set_window_title('PTSD_Distribution.py')

# Create axes boxes in a linspace xorg line
xorg = np.linspace(.05,.9,7)
axSex    = plt.axes([xorg[0],.6,.08,.2]); axSex.set_title('Sex')
axAge    = plt.axes([xorg[1],.6,.08,.2]); axAge.set_title('Age')
axRace   = plt.axes([xorg[2],.6,.08,.2]); axRace.set_title('Race')
axEthn   = plt.axes([xorg[3],.6,.08,.2]); axEthn.set_title('Ethn')
axIncome = plt.axes([xorg[4],.6,.08,.2]); axIncome.set_title('Income')
axStress = plt.axes([xorg[5],.6,.08,.2]); axStress.set_title('Stress')
Пример #3
0
lastT = 0.
dt = 10
dArray = deque([0.])
tArray = deque([0.])
plotWidth = 500
isMale = 0
isOld = 1
isBlack = 0.
race = 'white'
ethn = 'hispanic'
# income = 'lowrange'
hadPrior = 0
logitCBT = 0
probCBT  = 0

writelog.init('PTSD_Logistic.log')
writelog.write('sex \t age \t race \t ethn \t\t nPrior \t logitCBT \t\t probCBT \n')
writelog.write('=== \t === \t ==== \t ==== \t\t ====== \t ======   \t\t ======= \n\n')

plt.close('all')
fig = plt.figure(figsize=(12,6))
fig.canvas.set_window_title('PTSD_LogisticCombo.py')

# Create axes boxes in a linspace xorg line
xorg = np.linspace(.05,.9,5)
axSex    = plt.axes([xorg[0],.6,.08,.2]); axSex.set_title('Sex')
axAge    = plt.axes([xorg[1],.6,.08,.2]); axAge.set_title('Age')
axRace   = plt.axes([xorg[2],.6,.08,.2]); axRace.set_title('Race')
axEthn   = plt.axes([xorg[3],.6,.08,.2]); axEthn.set_title('Ethn')
# axIncome = plt.axes([xorg[4],.6,.08,.2]); axIncome.set_title('Income')
# axStress = plt.axes([xorg[5],.6,.08,.2]); axStress.set_title('Stress')