Установка зависимостей
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from statsmodels.graphics.tsaplots import plot_acf
Анализ ACF
train_multilabel_CT010 = pd.read_excel('./signals/07HAH10CT010/Train_Multi (+Labels).xlsx')
train_multilabel_CT010['Время'] = pd.to_datetime(train_multilabel_CT010['Время'])
train_multilabel_CT010.set_index('Время', inplace=True)

train_multilabel_CT001 = pd.read_excel('./signals/07MAA10CT001/Train_Multi (+Lables).xlsx')
train_multilabel_CT001['Время'] = pd.to_datetime(train_multilabel_CT001['Время'])
train_multilabel_CT001.set_index('Время', inplace=True)
plot_acf(train_multilabel_CT001['07MAA10CT001'], lags=10)
plt.show()
plot_acf(train_multilabel_CT010['07HAH10CT010'], lags=10)
plt.show()
Гистограмма
import matplotlib.pyplot as plt

plt.hist(train_multilabel_CT001['07MAA10CT001'], bins=30, density=True, alpha=0.6, color='g')
plt.title('Histogram of Data')
plt.xlabel('Value')
plt.ylabel('Frequency')
plt.show()
Q-Q графики
import scipy.stats as stats

# Q-Q plot для нормального распределения
stats.probplot(train_multilabel_CT001['07MAA10CT001'], dist="norm", plot=plt)
plt.title('Q-Q Plot for Normal Distribution')
plt.show()

# Q-Q plot для распределения Стьюдента
stats.probplot(train_multilabel_CT001['07MAA10CT001'], dist="t", sparams=(5,), plot=plt)
plt.title('Q-Q Plot for Student\'s T Distribution')
plt.show()
Тест Андерсона-Дарлинга
result = stats.anderson(train_multilabel_CT001['07MAA10CT001'])
print(f"Statistic: {result.statistic}")
print(f"Critical Values: {result.critical_values}")
print(f"Significance Levels: {result.significance_level}")

# Интерпретация
for sig_level, crit_value in zip(result.significance_level, result.critical_values):
    if result.statistic < crit_value:
        print(f"Data does not reject the null hypothesis at the {sig_level}% significance level.")
    else:
        print(f"Data rejects the null hypothesis at the {sig_level}% significance level.")
Критерий Колмогорова-Смирнова
d_norm, p_norm = stats.kstest(train_multilabel_CT001['07MAA10CT001'], 'norm')
print(f"Kolmogorov-Smirnov test for Normal Distribution: D={d_norm}, p-value={p_norm}")

d_t, p_t = stats.kstest(train_multilabel_CT001['07MAA10CT001'], 't', args=(5,))
print(f"Kolmogorov-Smirnov test for Student\'s T Distribution: D={d_t}, p-value={p_t}")
Автоматический подбор распределения
from fitter import Fitter

f = Fitter(train_multilabel_CT001['07MAA10CT001'])
f.fit()
f.summary()

# # Get the shape (k) and scale (theta) parameters
# shape_param = f.get_shape_parameter()  # Replace with actual method name
# scale_param = f.get_scale_parameter()  # Replace with actual method name

# 'distribution': Gamma(shape=shape_param, scale=scale_param),

2024-05-20 17:33:21.158 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED _fit distribution (taking more than 30 seconds)
2024-05-20 17:33:28.110 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted anglit distribution with error=0.343552)
2024-05-20 17:33:36.824 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted arcsine distribution with error=0.361448)
2024-05-20 17:33:39.103 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted cauchy distribution with error=0.020402)
2024-05-20 17:33:42.338 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted bradford distribution with error=0.351769)
2024-05-20 17:33:44.810 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted alpha distribution with error=0.281018)
2024-05-20 17:33:50.190 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted argus distribution with error=0.349137)
2024-05-20 17:33:51.192 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED beta distribution (taking more than 30 seconds)
2024-05-20 17:33:51.230 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED burr distribution (taking more than 30 seconds)
2024-05-20 17:33:52.095 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted betaprime distribution with error=0.318638)
2024-05-20 17:33:52.711 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted cosine distribution with error=0.338254)
2024-05-20 17:33:53.009 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted expon distribution with error=0.356264)
2024-05-20 17:33:58.133 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED burr12 distribution (taking more than 30 seconds)
2024-05-20 17:33:58.621 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted dgamma distribution with error=0.000688)
2024-05-20 17:34:00.189 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted dweibull distribution with error=0.001982)
2024-05-20 17:34:04.892 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted exponnorm distribution with error=0.005878)
2024-05-20 17:34:09.116 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED chi distribution (taking more than 30 seconds)
2024-05-20 17:34:12.350 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED chi2 distribution (taking more than 30 seconds)
2024-05-20 17:34:20.205 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED crystalball distribution (taking more than 30 seconds)
2024-05-20 17:34:22.150 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED erlang distribution (taking more than 30 seconds)
2024-05-20 17:34:28.204 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED exponpow distribution (taking more than 30 seconds)
2024-05-20 17:34:28.653 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED exponweib distribution (taking more than 30 seconds)
2024-05-20 17:34:30.220 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED f distribution (taking more than 30 seconds)
2024-05-20 17:34:34.920 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED fatiguelife distribution (taking more than 30 seconds)
2024-05-20 17:34:39.139 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED fisk distribution (taking more than 30 seconds)
2024-05-20 17:34:42.382 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED foldcauchy distribution (taking more than 30 seconds)
2024-05-20 17:34:50.249 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED foldnorm distribution (taking more than 30 seconds)
2024-05-20 17:34:52.170 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED gamma distribution (taking more than 30 seconds)
2024-05-20 17:34:58.251 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED gausshyper distribution (taking more than 30 seconds)
2024-05-20 17:34:58.687 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED genexpon distribution (taking more than 30 seconds)
2024-05-20 17:35:00.329 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED genextreme distribution (taking more than 30 seconds)
2024-05-20 17:35:04.994 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED gengamma distribution (taking more than 30 seconds)
2024-05-20 17:35:09.223 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED genhalflogistic distribution (taking more than 30 seconds)
2024-05-20 17:35:12.461 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED genhyperbolic distribution (taking more than 30 seconds)
2024-05-20 17:35:14.366 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted gumbel_l distribution with error=0.280489)
2024-05-20 17:35:16.514 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted halfcauchy distribution with error=0.354615)
2024-05-20 17:35:17.073 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted gumbel_r distribution with error=0.273254)
2024-05-20 17:35:20.338 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED geninvgauss distribution (taking more than 30 seconds)
2024-05-20 17:35:22.173 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted halfnorm distribution with error=0.353164)
2024-05-20 17:35:22.311 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED genlogistic distribution (taking more than 30 seconds)
2024-05-20 17:35:24.801 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted halflogistic distribution with error=0.353549)
2024-05-20 17:35:28.546 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED gennorm distribution (taking more than 30 seconds)
2024-05-20 17:35:28.870 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED genpareto distribution (taking more than 30 seconds)
2024-05-20 17:35:30.641 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED gibrat distribution (taking more than 30 seconds)
2024-05-20 17:35:35.049 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED gompertz distribution (taking more than 30 seconds)
2024-05-20 17:35:46.729 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED halfgennorm distribution (taking more than 30 seconds)
2024-05-20 17:35:52.313 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED hypsecant distribution (taking more than 30 seconds)
2024-05-20 17:35:52.422 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED invgamma distribution (taking more than 30 seconds)
2024-05-20 17:35:54.983 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED invgauss distribution (taking more than 30 seconds)
2024-05-20 17:35:56.923 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED kstwo distribution (taking more than 30 seconds)
2024-05-20 17:35:58.777 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED invweibull distribution (taking more than 30 seconds)
2024-05-20 17:35:59.001 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED jf_skew_t distribution (taking more than 30 seconds)
2024-05-20 17:36:00.275 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted laplace distribution with error=0.00517)
2024-05-20 17:36:00.769 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED johnsonsb distribution (taking more than 30 seconds)
2024-05-20 17:36:05.163 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED johnsonsu distribution (taking more than 30 seconds)
2024-05-20 17:36:16.897 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED kappa3 distribution (taking more than 30 seconds)
2024-05-20 17:36:22.397 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED kappa4 distribution (taking more than 30 seconds)
2024-05-20 17:36:22.613 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED ksone distribution (taking more than 30 seconds)
2024-05-20 17:36:27.032 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted logistic distribution with error=0.000737)
2024-05-20 17:36:27.178 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED kstwobign distribution (taking more than 30 seconds)
2024-05-20 17:36:29.167 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED laplace_asymmetric distribution (taking more than 30 seconds)
2024-05-20 17:36:30.486 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED levy distribution (taking more than 30 seconds)
2024-05-20 17:36:30.978 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED levy_l distribution (taking more than 30 seconds)
2024-05-20 17:36:35.375 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED levy_stable distribution (taking more than 30 seconds)
2024-05-20 17:36:43.522 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted lognorm distribution with error=0.01237)
2024-05-20 17:36:43.667 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED multivariate_normal distribution (taking more than 30 seconds)
2024-05-20 17:36:47.021 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED loggamma distribution (taking more than 30 seconds)
2024-05-20 17:36:52.723 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED loglaplace distribution (taking more than 30 seconds)
2024-05-20 17:36:57.394 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED loguniform distribution (taking more than 30 seconds)
2024-05-20 17:36:59.432 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED lomax distribution (taking more than 30 seconds)
2024-05-20 17:37:00.634 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED maxwell distribution (taking more than 30 seconds)
2024-05-20 17:37:00.952 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted norm distribution with error=0.012712)
2024-05-20 17:37:01.125 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED mielke distribution (taking more than 30 seconds)
2024-05-20 17:37:05.514 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED moyal distribution (taking more than 30 seconds)
2024-05-20 17:37:12.644 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted powerlaw distribution with error=0.351678)
2024-05-20 17:37:13.967 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED nakagami distribution (taking more than 30 seconds)
2024-05-20 17:37:15.673 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted pareto distribution with error=0.356264)
2024-05-20 17:37:17.216 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED ncf distribution (taking more than 30 seconds)
2024-05-20 17:37:20.751 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted rayleigh distribution with error=0.344759)
2024-05-20 17:37:22.789 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED nct distribution (taking more than 30 seconds)
2024-05-20 17:37:27.548 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED ncx2 distribution (taking more than 30 seconds)
2024-05-20 17:37:30.776 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED norminvgauss distribution (taking more than 30 seconds)
2024-05-20 17:37:31.417 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED pearson3 distribution (taking more than 30 seconds)
2024-05-20 17:37:31.529 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED rv_continuous distribution (taking more than 30 seconds)
2024-05-20 17:37:31.775 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED rv_histogram distribution (taking more than 30 seconds)
2024-05-20 17:37:42.796 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED powerlognorm distribution (taking more than 30 seconds)
2024-05-20 17:37:44.094 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED powernorm distribution (taking more than 30 seconds)
2024-05-20 17:37:47.469 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED rdist distribution (taking more than 30 seconds)
2024-05-20 17:37:50.789 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED recipinvgauss distribution (taking more than 30 seconds)
2024-05-20 17:37:52.998 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED reciprocal distribution (taking more than 30 seconds)
2024-05-20 17:37:57.673 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED rel_breitwigner distribution (taking more than 30 seconds)
2024-05-20 17:38:01.049 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED rice distribution (taking more than 30 seconds)
2024-05-20 17:38:01.998 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED semicircular distribution (taking more than 30 seconds)
2024-05-20 17:38:13.193 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED skewcauchy distribution (taking more than 30 seconds)
2024-05-20 17:38:14.300 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED skewnorm distribution (taking more than 30 seconds)
2024-05-20 17:38:17.596 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED studentized_range distribution (taking more than 30 seconds)
2024-05-20 17:38:20.977 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED t distribution (taking more than 30 seconds)
2024-05-20 17:38:23.459 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED trapezoid distribution (taking more than 30 seconds)
2024-05-20 17:38:26.386 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted uniform distribution with error=0.351782)
2024-05-20 17:38:28.015 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED trapz distribution (taking more than 30 seconds)
2024-05-20 17:38:28.482 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED vonmises_fisher distribution (taking more than 30 seconds)
2024-05-20 17:38:29.734 | INFO     | fitter.fitter:_fit_single_distribution:337 - Fitted vonmises distribution with error=5.871878)
2024-05-20 17:38:31.321 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED triang distribution (taking more than 30 seconds)
2024-05-20 17:38:32.084 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED truncexpon distribution (taking more than 30 seconds)
2024-05-20 17:38:43.534 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED truncnorm distribution (taking more than 30 seconds)
2024-05-20 17:38:44.490 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED truncpareto distribution (taking more than 30 seconds)
2024-05-20 17:38:47.784 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED truncweibull_min distribution (taking more than 30 seconds)
2024-05-20 17:38:51.491 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED tukeylambda distribution (taking more than 30 seconds)
2024-05-20 17:38:58.824 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED vonmises_line distribution (taking more than 30 seconds)
2024-05-20 17:39:00.195 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED wald distribution (taking more than 30 seconds)
2024-05-20 17:39:01.783 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED weibull_max distribution (taking more than 30 seconds)
2024-05-20 17:39:02.156 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED weibull_min distribution (taking more than 30 seconds)
2024-05-20 17:39:13.658 | WARNING  | fitter.fitter:_fit_single_distribution:347 - SKIPPED wrapcauchy distribution (taking more than 30 seconds)
/home/pronin/.local/lib/python3.10/site-packages/scipy/integrate/_quadpack_py.py:1272: IntegrationWarning: The maximum number of subdivisions (50) has been achieved.
  If increasing the limit yields no improvement it is advised to analyze 
  the integrand in order to determine the difficulties.  If the position of a 
  local difficulty can be determined (singularity, discontinuity) one will 
  probably gain from splitting up the interval and calling the integrator 
  on the subranges.  Perhaps a special-purpose integrator should be used.
  quad_r = quad(f, low, high, args=args, full_output=self.full_output,

	sumsquare_error	aic	bic	kl_div	ks_statistic	ks_pvalue
dgamma	0.000688	11030.797391	11063.144893	inf	0.040265	0.0
logistic	0.000737	12892.902370	12914.467372	inf	0.047305	0.0
dweibull	0.001982	11330.004001	11362.351503	inf	0.034656	0.0
laplace	0.005170	9493.973938	9515.538940	inf	0.052052	0.0
exponnorm	0.005878	73776.967112	73809.314614	inf	0.102473	0.0

Пытаюсь понять какое у меня распределение, что скажешь по коду и по выводам?