# print s_without.percentile(survivals, 0.5) #except: pass s= Simulator(iters=50000, age=age, ca125=True, model=Model) s.run() s.clear_survival_curves() s.add_survival_curve(start_states=[S_Start], end_states=[S_DeadCancer, S_DeadChemo]) s.add_survival_curve(start_states=[S_Start], end_states=[S_DeadAge]) s.draw_survival_curves(name="crossing_curves.png") #s.draw_histograms({ # "Quality Years" : # lambda pt: int(CostEvaluator.EvaluatePatient(pt)['quality']), # "Cost" : # lambda pt: int(CostEvaluator.EvaluatePatient(pt)['cost']), # "Rounds of Chemo" : # lambda pt: math.ceil(pt.ChemoCount()) # }, names=["quality_years", "cost", "rounds"] # ) #
from Simulator import Simulator from States import S_Start, S_DeadCancer, S_DeadAge, S_DeadChemo from numpy import average import ConundrumModel as Model s= Simulator(iters=10000, age=60, ca125=True, model=Model) s.run() print average([len(p.states) for p in s.patients]) s.clear_survival_curves() s.add_survival_curve(start_states=[S_Start], end_states=[S_DeadCancer]) s.add_survival_curve(start_states=[S_Start], end_states=[S_DeadChemo]) s.add_survival_curve(start_states=[S_Start], end_states=[S_DeadAge]) s.draw_survival_curves(name="conundrum.png")
from Simulator import Simulator from States import S_Start, S_DeadAge import HW1_model as Model for time_increment in [1.0, 1./12, 1./52, 1./365]: s= Simulator(iters=5000, age=60, model=Model, time_increment = 1.0 / 52) s.run() s.clear_survival_curves() s.add_survival_curve(start_states=[S_Start], end_states=[S_DeadAge]) s.draw_survival_curves(name="Survival_HW_1.%s"%time_increment)