コード例 #1
0
    def __init__(self, sample: Sample, std: Standard):
        self.sample = sample
        self.std = std

        self.distance = [sequence_distance_1(self.std.seq_max0, seq_max0) for seq_max0 in self.sample.seq_max0]
        self.va = [plot_image(visual_analysis, xr) for xr in self.distance]
        self.stat = [stat_analysis(xr) for xr in self.distance]
        self.ntest = [test_normal(xr, qq=True) for xr in self.distance]

        self.distance_apl = [sequence_distance_1(self.std.seq_max_apl, seq_max0) for seq_max0 in self.sample.seq_max0]
        self.va_apl = [plot_image(visual_analysis, xr) for xr in self.distance_apl]
        self.stat_apl = [stat_analysis(xr) for xr in self.distance_apl]
        self.ntest_apl = [test_normal(xr, qq=True) for xr in self.distance_apl]

        self.sample_name = self.sample.display()
コード例 #2
0
    def __init__(self, std: Standard, samples: list):
        self.std = std
        self.samples = samples[:]

        self.distance = [[
            sequence_distance_1(sample.seq_max[factor], self.std.seq_max)
            for sample in self.samples
        ] for factor in range(4)]

        self.max_list = []
        for factor in range(4):
            max_list_factor = []
            for sample_num in range(len(self.samples)):
                max_list_factor.append(
                    np.mean(self.distance[factor][sample_num]))
            self.max_list.append(max_list_factor)

        self.va = [
            plot_image(visual_analysis, max_list_factor)
            for max_list_factor in self.max_list
        ]
        self.stat = [
            stat_analysis(max_list_factor) for max_list_factor in self.max_list
        ]
        self.ntest = [
            test_normal(max_list_factor, qq=True)
            for max_list_factor in self.max_list
        ]
コード例 #3
0
    def __init__(self, sample: Sample, factor: int, std: Standard):
        self.sample = sample
        self.factor = factor
        self.std = std

        self.distance = sequence_distance_1(self.std.seq_max0, self.sample.seq_max0[factor])
        self.va = plot_image(visual_analysis, self.distance)
        self.stat = stat_analysis(self.distance)
        self.ntest = test_normal(self.distance, qq=True)

        self.distance_apl = sequence_distance_1(self.std.seq_max_apl, self.sample.seq_max0[factor])
        self.va_apl = plot_image(visual_analysis, self.distance_apl)
        self.stat_apl = stat_analysis(self.distance_apl)
        self.ntest_apl = test_normal(self.distance_apl, qq=True)

        self.sample_name = self.sample.display()
        self.factor_name = FACTORS_L[self.factor]
コード例 #4
0
    def __init__(self, stds: list, sample: Sample, factor: int):
        self.stds = stds[:]
        self.sample = sample
        self.factor = factor

        self.distance = [
            sequence_distance_1(self.sample.seq_max[factor], std.seq_max)
            for std in self.stds
        ]
        self.va = [plot_image(visual_analysis, xr) for xr in self.distance]
        self.stat = [stat_analysis(xr) for xr in self.distance]
        self.ntest = [test_normal(xr, qq=True) for xr in self.distance]

        self.sample_name = self.sample.display()
        self.factor_name = FACTORS_L[self.factor]
コード例 #5
0
    def __init__(self, stds: list, sample: Sample):
        self.stds = stds[:]
        self.sample = sample

        self.distance = [[
            sequence_distance_1(self.sample.seq_max[factor], std.seq_max)
            for factor in range(4)
        ] for std in self.stds]
        self.va = [[plot_image(visual_analysis, factor) for factor in xr]
                   for xr in self.distance]
        self.stat = [[stat_analysis(factor) for factor in xr]
                     for xr in self.distance]
        self.ntest = [[test_normal(factor, qq=True) for factor in xr]
                      for xr in self.distance]

        self.sample_name = self.sample.display()
コード例 #6
0
    def __init__(self, stds: list, samples: list, factor: int):
        self.stds = stds[:]
        self.samples = samples[:]
        self.factor = factor

        self.distance = [[
            sequence_distance_1(sample.seq_max[self.factor], std.seq_max)
            for sample in self.samples
        ] for std in self.stds]

        self.max_list = [[
            np.mean(std[sample_num]) for sample_num in range(len(self.samples))
        ] for std in self.distance]

        self.va = [plot_image(visual_analysis, xr) for xr in self.max_list]
        self.stat = [stat_analysis(xr) for xr in self.max_list]
        self.ntest = [test_normal(xr, qq=True) for xr in self.max_list]

        self.factor_name = FACTORS_L[self.factor]
コード例 #7
0
    def __init__(self, std: Standard, samples: list, factor: int):
        self.std = std
        self.samples = samples[:]
        self.factor = factor

        self.distance = [
            sequence_distance_1(sample.seq_max[self.factor], self.std.seq_max)
            for sample in self.samples
        ]

        self.max_list = []
        for sample_num in range(len(self.samples)):
            self.max_list.append(np.mean(self.distance[sample_num]))

        self.va = plot_image(visual_analysis, self.max_list)
        self.stat = stat_analysis(self.max_list)
        self.ntest = test_normal(self.max_list, qq=True)

        self.factor_name = FACTORS_L[self.factor]
コード例 #8
0
    def __init__(self, stds: list, samples: list):
        self.stds = stds[:]
        self.samples = samples[:]

        self.distance = [[[
            sequence_distance_1(factor, std.seq_max)
            for factor in sample.seq_max
        ] for sample in self.samples] for std in self.stds]

        self.max_list = [[[
            np.mean(std[sample_num][factor])
            for sample_num in range(len(self.samples))
        ] for factor in range(4)] for std in self.distance]

        self.va = [[plot_image(visual_analysis, factor) for factor in xr]
                   for xr in self.max_list]
        self.stat = [[stat_analysis(factor) for factor in std]
                     for std in self.max_list]
        self.ntest = [[test_normal(factor, qq=True) for factor in std]
                      for std in self.max_list]
コード例 #9
0
def report_ntest(report, doc: Printer):
    res_ok = "пройден"
    res_nok = "не пройден"

    shapiro = report["shapiro"]
    doc.add_paragraph("Тест нормальности Шапиро-Вилка: {}".format(res_ok if shapiro["res"] else res_nok))

    agostino = report["agostino"]
    doc.add_paragraph("Тест нормальности Д'Агостино и Пирсона: из {0} прогонов доля {1}/{0} = {2:.2f} отклоняет "
                      "гипотезу о нормальности на уровне отклонения {3}"
                      .format(agostino["num_tests"], agostino["num_rejects"], agostino["ratio"], agostino["alpha"]))

    ks = report["ks"]
    doc.add_paragraph("Тест нормальности Колмогорова-Смирнова: из {0} прогонов доля {1}/{0} = {2:.2f} отклоняет "
                      "гипотезу о нормальности на уровне отклонения {3}"
                      .format(ks["num_tests"], ks["num_rejects"], ks["ratio"], ks["alpha"]))

    if report['qq'] and doc.destination == "doc":
        img = plot_image(test_normal_plot, report)
        doc.add_paragraph("QQ-тест:")
        doc.add_picture(img, width=Cm(12.5))