def __init__(self, samples: list, factor: int, std: Standard):
        self.samples = samples[:]
        self.factor = factor
        self.std = std

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

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

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

        self.distance_apl = [
            sequence_distance_1(std.seq_max_apl, sample.seq_max0[factor])
            for sample in samples
        ]

        self.max_list_apl = []
        for sample_num in range(len(samples)):
            self.max_list_apl.append(
                np.mean(self.distance_apl[sample_num][factor]))

        self.va_apl = plot_image(visual_analysis, self.max_list_apl)
        self.ntest_apl = test_normal(self.max_list_apl, qq=False)
        self.stat_apl = stat_analysis(self.max_list_apl)
    def __init__(self, sample: Sample, stds: list):
        self.sample = sample
        self.stds = stds[:]

        self.distance = [[
            sequence_distance_1(std.seq_max0, self.sample.seq_max0[factor])
            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.distance_apl = [[
            sequence_distance_1(std.seq_max_apl, self.sample.seq_max0[factor])
            for factor in range(4)
        ] for std in self.stds]
        self.va_apl = [[plot_image(visual_analysis, factor) for factor in xr]
                       for xr in self.distance_apl]
        self.stat_apl = [[stat_analysis(factor) for factor in xr]
                         for xr in self.distance_apl]
        self.ntest_apl = [[test_normal(factor, qq=True) for factor in xr]
                          for xr in self.distance_apl]

        self.sample_name = sample.display()
    def __init__(self, sample: Sample, factor: int, stds: list):
        self.sample = sample
        self.factor = factor
        self.stds = stds[:]

        self.distance = [
            sequence_distance_1(std.seq_max0,
                                self.sample.seq_max0[self.factor])
            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.distance_apl = [
            sequence_distance_1(std.seq_max_apl, self.sample.seq_max0[factor])
            for std in self.stds
        ]
        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()
        self.factor_name = FACTORS_L[self.factor]
    def __init__(self, samples: list, std: Standard):
        self.samples = samples[:]
        self.std = std

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

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

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

        self.distance_apl = [[
            sequence_distance_1(std.seq_max_apl, sample.seq_max0[factor])
            for factor in range(4)
        ] for sample in samples]

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

        self.va_apl = [
            plot_image(visual_analysis, xr) for xr in self.max_list_apl
        ]
        self.ntest_apl = [
            test_normal(max_list_factor, qq=False)
            for max_list_factor in self.max_list_apl
        ]
        self.stat_apl = [
            stat_analysis(max_list_factor)
            for max_list_factor in self.max_list_apl
        ]
예제 #5
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
        ]
예제 #6
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))
예제 #7
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]
예제 #8
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()
예제 #9
0
    def __init__(self, std: Standard, sample: Sample):
        self.std = std
        self.sample = sample

        self.distance = [
            sequence_distance_1(seq_max, self.std.seq_max)
            for seq_max in self.sample.seq_max
        ]
        self.kde = plot_image(graph_kde, self.distance)
        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.distance3 = [
            sequence_distance_1(self.sample.seq_max[factor],
                                self.sample.seq_max[0])
            for factor in range(1, 4)
        ]
        self.kde3 = plot_image(graph_kde3, self.distance3)
        self.stat3 = [stat_analysis(xr) for xr in self.distance3]
        self.ntest3 = [test_normal(xr, qq=True) for xr in self.distance3]

        self.sample_name = self.sample.display()
    def __init__(self, samples: list, stds: list):
        self.samples = samples[:]
        self.stds = stds[:]

        self.distance = [[[
            sequence_distance_1(std.seq_max, factor)
            for factor in sample.seq_max
        ] for sample in samples] for std in 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.ntest = [[test_normal(factor, qq=False) for factor in std]
                      for std in self.max_list]
        self.stat = [[stat_analysis(factor) for factor in std]
                     for std in self.max_list]

        self.distance_apl = [[[
            sequence_distance_1(std.seq_max_apl, factor)
            for factor in sample.seq_max0
        ] for sample in samples] for std in stds]

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

        self.va_apl = [[plot_image(visual_analysis, factor) for factor in xr]
                       for xr in self.max_list_apl]
        self.ntest_apl = [[test_normal(factor, qq=False) for factor in std]
                          for std in self.max_list_apl]
        self.stat_apl = [[stat_analysis(factor) for factor in std]
                         for std in self.max_list_apl]
예제 #11
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]
예제 #12
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]