pop_size=D.POP_SIZE,
    parameters=P.ParametersFixed(diagnostic=P.Diagnostic.NSB))

# simulate the cohort over the specified time steps
myCohort_NSB.simulate(sim_length=D.SIM_LENGTH)

# print the outcomes of this simulated cohort
Support.print_outcomes(sim_outcomes=myCohort_NSB.cohortOutcomes,
                       diagnostic_name=P.Diagnostic.NSB)

# histograms of the simulated cohort
Support.print_histograms(sim_outcomes=myCohort_NSB.cohortOutcomes,
                         diagnostic_name=P.Diagnostic.NSB)

PathCls.graph_sample_path(sample_path=myCohort.cohortOutcomes.nLivingPatients,
                          title='Survival Curve (Standard of Care Diagnostic)',
                          x_label='Time-Step (Week)',
                          y_label='Number Survived')

PathCls.graph_sample_path(
    sample_path=myCohort_NSB.cohortOutcomes.nLivingPatients,
    title='Survival Curve (SOC + Urine LAM)',
    x_label='Time-Step (Week)',
    y_label='Number Survived')

survival_curves = [
    myCohort.cohortOutcomes.nLivingPatients,
    myCohort_NSB.cohortOutcomes.nLivingPatients
]

# graph survival curve
# graph survival curve
Esempio n. 2
0
# record the observations
path2.record(0.5, 4)
path2.record(1.8, -2)
path2.record(5.5, 1)

# third sample path with initial size = 1
path3 = Path.PrevalencePathBatchUpdate('Path 3',
                                       0,
                                       times_of_changes=[1.5, 2, 5],
                                       increments=[2, -1, 0],
                                       sim_rep=1)

# plot path 1 only
Path.graph_sample_path(sample_path=path1,
                       title='Plotting a single sample path',
                       x_label='time',
                       y_label='observed value',
                       legend='Path 1',
                       color_code='r')

# plot path 3 only
Path.graph_sample_path(
    sample_path=path3,
    title='Plotting a single sample path that is updated in batch',
    x_label='time',
    y_label='observed value',
    legend='Path 3',
    color_code='r')

# plot both paths
Path.graph_sample_paths(sample_paths=[path1, path2],
                        title='Plot two sample paths with different color',
Esempio n. 3
0
def print_histograms(sim_outcomes, diagnostic_name):
    # plot the sample path (survival curve)
    PathCls.graph_sample_path(sample_path=sim_outcomes.nLivingPatients,
                              title=f'Survival Curve {diagnostic_name}',
                              x_label='Time-Step (Week)',
                              y_label='Number Survived')

    # plot the histogram of survival times
    Figs.graph_histogram(
        data=sim_outcomes.survivalTimes,
        title=f'Histogram of Patient Survival Time {diagnostic_name}',
        x_label='Survival Time (Week)',
        y_label='Count',
        bin_width=1)

    # Figs.graph_histogram(
    #     data=sim_outcomes.timesINFECTEDtoHOSP_TBD,
    #     title=f'Histogram of INFECTED to HOSP_TBD {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesINFECTEDtoHOSP_TBM,
    #     title=f'Histogram of INFECTED to HOSP_TBM {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesINFECTEDtoDX_TBD,
    #     title=f'Histogram of INFECTED to DX_TBD {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesINFECTEDtoCLEARED,
    #     title=f'Histogram of INFECTED to CLEARED {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesCLEAREDtoDEAD,
    #     title=f'Histogram of CLEARED to DEAD {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesHOSP_TBDtoDEAD,
    #     title=f'Histogram of HOSP_TBD to DEAD {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesHOSP_TBDtoDX_TBD,
    #     title=f'Histogram of HOSP_TBD to DX_TBD {diagnostic_name}',
    #     x_label='Survival Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesHOSP_TBMtoDEAD,
    #     title=f'Histogram of HOSP_TBM to DEAD {diagnostic_name}',
    #     x_label='Survival Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesHOSP_TBMtoDX_TBM,
    #     title=f'Histogram of HOSP_TBM to DX_TBM {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesDX_TBDtoDEAD,
    #     title=f'Histogram of DX_TBD to DEAD {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesDX_TBDtoCLEARED,
    #     title=f'Histogram of DX_TBD to CLEARED {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesDX_TBMtoDEAD,
    #     title=f'Histogram of DX_TBM to DEAD {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesDX_TBMtoCLEARED,
    #     title=f'Histogram of DX_TBM to CLEARED {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesINFECTED,
    #     title=f'Histogram of INFECTED {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesHOSP_TBM,
    #     title=f'Histogram of HOSP_TBM {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesHOSP_TBD,
    #     title=f'Histogram of HOSP_TBD {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesDX_TBD,
    #     title=f'Histogram of DX_TBD {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesDX_TBM,
    #     title=f'Histogram of DX_TBM {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)
    #
    # Figs.graph_histogram(
    #     data=sim_outcomes.timesCLEARED,
    #     title=f'Histogram of CLEARED {diagnostic_name}',
    #     x_label='Time (Week)',
    #     y_label='Count',
    #     bin_width=1)

    # Figs.graph_histogram(
    #     data=sim_outcomes.costs,
    #     title=f'Histogram of Cost {diagnostic_name}',
    #     x_label='Cost (Dollars)',
    #     y_label='Count',
    #     bin_width=1)

    Figs.graph_histogram(
        data=sim_outcomes.costsPresenting,
        title=f'Histogram of Cost (Patients Presenting) {diagnostic_name}',
        x_label='Cost (Dollars)',
        y_label='Count',
        bin_width=1)
Esempio n. 4
0
# selected therapy
therapy_none = P.Therapies.NO

# create a cohort
myCohort_0 = Cls.Cohort(id=0,
                      pop_size=D.POP_SIZE,
                      parameters=P.ParametersFixed(therapy=therapy_none))

# simulate the cohort over the specified time steps
myCohort_0.simulate(sim_length=D.SIM_LENGTH)

# plot the sample path (survival curve)
Path.graph_sample_path(
    sample_path=myCohort_0.cohortOutcomes.nLivingPatients,
    title='Survival Curvel for No Therapy',
    x_label='Time-Step (Year)',
    y_label='Number Survived')

# plot the histogram of survival times
Fig.graph_histogram(
    data=myCohort_0.cohortOutcomes.survivalTimes,
    title='Histogram of Patient Survival Times for No Therapy',
    x_label='Survival Time (Year)',
    y_label='Count',
    bin_width=1)

# print the outcomes of this simulated cohort
Support.print_outcomes(sim_outcomes=myCohort_0.cohortOutcomes,therapy_name=therapy_none)