1500 lines
308 KiB
Plaintext
1500 lines
308 KiB
Plaintext
|
{
|
|||
|
"cells": [
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 8,
|
|||
|
"id": "b4c54963-9622-4e66-9910-2ba3e5ba69af",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"import numpy as np\n",
|
|||
|
"import pandas as pd\n",
|
|||
|
"from scipy import stats\n",
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"\n",
|
|||
|
"# Укажите путь к файлу xlsx\n",
|
|||
|
"xlsx_file_path = \"example.xlsx\"\n",
|
|||
|
"\n",
|
|||
|
"# Прочитайте файл xlsx в DataFrame\n",
|
|||
|
"df = pd.read_excel(xlsx_file_path)\n",
|
|||
|
"\n",
|
|||
|
"X = df['X']\n",
|
|||
|
"Y = df['Y']\n",
|
|||
|
"Z = df['Z']\n",
|
|||
|
"D = df['D']"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 9,
|
|||
|
"id": "8d13a687-0b28-421e-92a1-06a2ef6bda90",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"KS test for X (normal): statistic=0.08531409319640998, p-value=0.10260887852786338\n",
|
|||
|
"KS test for Y (normal): statistic=0.08852268726983759, p-value=0.0818774378282563\n",
|
|||
|
"KS test for Z (normal): statistic=0.03701671447372634, p-value=0.9373639241505186\n",
|
|||
|
"KS test for D (normal): statistic=0.04950094422191759, p-value=0.6921286443105663\n",
|
|||
|
"Гипотеза о нормальном распределении X не отвергается\n",
|
|||
|
"Гипотеза о нормальном распределении Y не отвергается\n",
|
|||
|
"Гипотеза о нормальном распределении Z не отвергается\n",
|
|||
|
"Гипотеза о нормальном распределении D не отвергается\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# Колмогоров-Смирнов тест для нормального распределения\n",
|
|||
|
"ks_statistic_X, ks_pvalue_X = stats.kstest(X, 'norm', args=(X.mean(), X.std()))\n",
|
|||
|
"ks_statistic_Y, ks_pvalue_Y = stats.kstest(Y, 'norm', args=(Y.mean(), Y.std()))\n",
|
|||
|
"ks_statistic_Z, ks_pvalue_Z = stats.kstest(Z, 'norm', args=(Z.mean(), Z.std()))\n",
|
|||
|
"ks_statistic_D, ks_pvalue_D = stats.kstest(D, 'norm', args=(D.mean(), D.std()))\n",
|
|||
|
"\n",
|
|||
|
"print(f\"KS test for X (normal): statistic={ks_statistic_X}, p-value={ks_pvalue_X}\")\n",
|
|||
|
"print(f\"KS test for Y (normal): statistic={ks_statistic_Y}, p-value={ks_pvalue_Y}\")\n",
|
|||
|
"\n",
|
|||
|
"print(f\"KS test for Z (normal): statistic={ks_statistic_Z}, p-value={ks_pvalue_Z}\")\n",
|
|||
|
"print(f\"KS test for D (normal): statistic={ks_statistic_D}, p-value={ks_pvalue_D}\")\n",
|
|||
|
"# Выводы по результатам тестов\n",
|
|||
|
"alpha = 0.05\n",
|
|||
|
"if ks_pvalue_X < alpha:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении X отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении X не отвергается\")\n",
|
|||
|
"\n",
|
|||
|
"if ks_pvalue_Y < alpha:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении Y отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении Y не отвергается\")\n",
|
|||
|
"\n",
|
|||
|
"if ks_pvalue_Z < alpha:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении Z отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении Z не отвергается\")\n",
|
|||
|
"\n",
|
|||
|
"if ks_pvalue_D < alpha:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении D отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении D не отвергается\")\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 11,
|
|||
|
"id": "dda26828-2972-4b58-8814-abeccc612ffd",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Chi-square test for X (Poisson): statistic=67.92056123161348, p-value=1.933614930324732e-09\n",
|
|||
|
"Гипотеза о Пуассоновском распределении X отвергается\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# Хи-квадрат тест для Пуассоновского распределения\n",
|
|||
|
"observed_counts, bins = np.histogram(X, bins='auto')\n",
|
|||
|
"expected_counts = len(X) * np.diff(stats.poisson.cdf(bins, mu=X.mean()))\n",
|
|||
|
"\n",
|
|||
|
"# Нормализация ожидаемых частот\n",
|
|||
|
"expected_counts *= observed_counts.sum() / expected_counts.sum()\n",
|
|||
|
"\n",
|
|||
|
"chi2_statistic, chi2_pvalue = stats.chisquare(observed_counts, f_exp=expected_counts)\n",
|
|||
|
"\n",
|
|||
|
"print(f\"Chi-square test for X (Poisson): statistic={chi2_statistic}, p-value={chi2_pvalue}\")\n",
|
|||
|
"\n",
|
|||
|
"if chi2_pvalue < alpha:\n",
|
|||
|
" print(\"Гипотеза о Пуассоновском распределении X отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о Пуассоновском распределении X не отвергается\")\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 12,
|
|||
|
"id": "7dc6545e-684b-4f6d-9c4b-c9da5d49db57",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"KS test for Z (normal): statistic=0.03701671447372634, p-value=0.9373639241505186\n",
|
|||
|
"Гипотеза о нормальном распределении Z не отвергается\n",
|
|||
|
"KS test for D (normal): statistic=0.04950094422191759, p-value=0.6921286443105663\n",
|
|||
|
"Гипотеза о нормальном распределении D не отвергается\n",
|
|||
|
"KS test for Y (uniform): statistic=0.04778545860688088, p-value=0.732512122073677\n",
|
|||
|
"Гипотеза о равномерном распределении Y не отвергается\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# Тест Колмогорова-Смирнова для нормального распределения Z\n",
|
|||
|
"ks_statistic_Z, ks_pvalue_Z = stats.kstest(Z, 'norm', args=(Z.mean(), Z.std()))\n",
|
|||
|
"print(f\"KS test for Z (normal): statistic={ks_statistic_Z}, p-value={ks_pvalue_Z}\")\n",
|
|||
|
"\n",
|
|||
|
"if ks_pvalue_Z < alpha:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении Z отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении Z не отвергается\")\n",
|
|||
|
"\n",
|
|||
|
"# Тест Колмогорова-Смирнова для нормального распределения D\n",
|
|||
|
"ks_statistic_D, ks_pvalue_D = stats.kstest(D, 'norm', args=(D.mean(), D.std()))\n",
|
|||
|
"print(f\"KS test for D (normal): statistic={ks_statistic_D}, p-value={ks_pvalue_D}\")\n",
|
|||
|
"\n",
|
|||
|
"if ks_pvalue_D < alpha:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении D отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении D не отвергается\")\n",
|
|||
|
"\n",
|
|||
|
"# Тест Колмогорова-Смирнова для равномерного распределения Y\n",
|
|||
|
"ks_statistic_Y, ks_pvalue_Y = stats.kstest(Y, 'uniform', args=(Y.min(), Y.max()-Y.min()))\n",
|
|||
|
"print(f\"KS test for Y (uniform): statistic={ks_statistic_Y}, p-value={ks_pvalue_Y}\")\n",
|
|||
|
"\n",
|
|||
|
"if ks_pvalue_Y < alpha:\n",
|
|||
|
" print(\"Гипотеза о равномерном распределении Y отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о равномерном распределении Y не отвергается\")\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 14,
|
|||
|
"id": "12916750-f81f-42be-92dc-cd50dbc2e93a",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Chi-square test for X (Poisson): statistic=67.92056123161348, p-value=1.933614930324732e-09\n",
|
|||
|
"Гипотеза о Пуассоновском распределении X отвергается\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# Хи-квадрат тест для Пуассоновского распределения X\n",
|
|||
|
"observed_counts, bins = np.histogram(X, bins='auto')\n",
|
|||
|
"expected_counts = len(X) * np.diff(stats.poisson.cdf(bins, mu=X.mean()))\n",
|
|||
|
"\n",
|
|||
|
"# Нормализация ожидаемых частот\n",
|
|||
|
"expected_counts *= observed_counts.sum() / expected_counts.sum()\n",
|
|||
|
"\n",
|
|||
|
"chi2_statistic, chi2_pvalue = stats.chisquare(observed_counts, f_exp=expected_counts)\n",
|
|||
|
"\n",
|
|||
|
"print(f\"Chi-square test for X (Poisson): statistic={chi2_statistic}, p-value={chi2_pvalue}\")\n",
|
|||
|
"\n",
|
|||
|
"alpha = 0.05\n",
|
|||
|
"if chi2_pvalue < alpha:\n",
|
|||
|
" print(\"Гипотеза о Пуассоновском распределении X отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о Пуассоновском распределении X не отвергается\")\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 21,
|
|||
|
"id": "fa7778c3-c4e9-45b4-a2f2-3d5d902b12de",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"ename": "ValueError",
|
|||
|
"evalue": "For each axis slice, the sum of the observed frequencies must agree with the sum of the expected frequencies to a relative tolerance of 1e-08, but the percent differences are:\n0.0015721607138329905",
|
|||
|
"output_type": "error",
|
|||
|
"traceback": [
|
|||
|
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
|||
|
"\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)",
|
|||
|
"\u001b[1;32m~\\AppData\\Local\\Temp\\ipykernel_12128\\831602892.py\u001b[0m in \u001b[0;36m?\u001b[1;34m()\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[0mexpected_freqs\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpoisson\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpmf\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mX\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmax\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlambda_X\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m*\u001b[0m \u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mX\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;31m# Chi-square test\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[0mobs_freqs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0m_\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mhistogram\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mX\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mbins\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mX\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmax\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 9\u001b[1;33m \u001b[0mchi2_stat_X\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mp_value_X\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mchisquare\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mobs_freqs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexpected_freqs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 10\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 11\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34mf'Chi-square test for X (Poisson): statistic={chi2_stat_X}, p-value={p_value_X}'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
|||
|
"\u001b[1;32m~\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\scipy\\stats\\_stats_py.py\u001b[0m in \u001b[0;36m?\u001b[1;34m(f_obs, f_exp, ddof, axis)\u001b[0m\n\u001b[0;32m 8208\u001b[0m ... axis=1)\n\u001b[0;32m 8209\u001b[0m \u001b[0mPower_divergenceResult\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mstatistic\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0marray\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m3.5\u001b[0m \u001b[1;33m,\u001b[0m \u001b[1;36m9.25\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mpvalue\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0marray\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0.62338763\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.09949846\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8210\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8211\u001b[0m \"\"\" # noqa: E501\n\u001b[1;32m-> 8212\u001b[1;33m return power_divergence(f_obs, f_exp=f_exp, ddof=ddof, axis=axis,\n\u001b[0m\u001b[0;32m 8213\u001b[0m lambda_=\"pearson\")\n",
|
|||
|
"\u001b[1;32m~\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\scipy\\stats\\_stats_py.py\u001b[0m in \u001b[0;36m?\u001b[1;34m(f_obs, f_exp, ddof, axis, lambda_)\u001b[0m\n\u001b[0;32m 8005\u001b[0m \u001b[1;34mf\"frequencies must agree with the sum of the \"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8006\u001b[0m \u001b[1;34mf\"expected frequencies to a relative tolerance \"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8007\u001b[0m \u001b[1;34mf\"of {rtol}, but the percent differences are:\\n\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8008\u001b[0m f\"{relative_diff}\")\n\u001b[1;32m-> 8009\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mmsg\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 8010\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8011\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8012\u001b[0m \u001b[1;31m# Ignore 'invalid' errors so the edge case of a data set with length 0\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
|||
|
"\u001b[1;31mValueError\u001b[0m: For each axis slice, the sum of the observed frequencies must agree with the sum of the expected frequencies to a relative tolerance of 1e-08, but the percent differences are:\n0.0015721607138329905"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy.stats import chisquare\n",
|
|||
|
"from scipy.stats import poisson\n",
|
|||
|
"# Define the expected frequencies for Poisson distribution\n",
|
|||
|
"lambda_X = X.mean()\n",
|
|||
|
"expected_freqs = poisson.pmf(range(int(X.max())+1), lambda_X) * len(X)\n",
|
|||
|
"\n",
|
|||
|
"# Chi-square test\n",
|
|||
|
"obs_freqs, _ = np.histogram(X, bins=range(int(X.max())+2))\n",
|
|||
|
"chi2_stat_X, p_value_X = chisquare(obs_freqs, expected_freqs)\n",
|
|||
|
"\n",
|
|||
|
"print(f'Chi-square test for X (Poisson): statistic={chi2_stat_X}, p-value={p_value_X}')\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 15,
|
|||
|
"id": "4e2815a6-f3b9-4628-b551-e98b65f34e42",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"t-test for equality of means: statistic=30.6366470045653, p-value=9.554335422627212e-107\n",
|
|||
|
"Гипотеза о равенстве средних X и Y отвергается\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"t_statistic, t_pvalue = stats.ttest_ind(X, Y)\n",
|
|||
|
"print(f\"t-test for equality of means: statistic={t_statistic}, p-value={t_pvalue}\")\n",
|
|||
|
"\n",
|
|||
|
"if t_pvalue < alpha:\n",
|
|||
|
" print(\"Гипотеза о равенстве средних X и Y отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о равенстве средних X и Y не отвергается\")"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 16,
|
|||
|
"id": "1d895585-9c7e-4910-afdf-cd259132289e",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Выборки нельзя объединить\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"if t_pvalue >= alpha:\n",
|
|||
|
" combined = np.concatenate([X, Y])\n",
|
|||
|
" combined_mean = np.mean(combined)\n",
|
|||
|
" combined_std = np.std(combined)\n",
|
|||
|
" print(f\"Объединенная выборка: среднее={combined_mean}, стандартное отклонение={combined_std}\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Выборки нельзя объединить\")"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 23,
|
|||
|
"id": "1ab79d2d-c581-4ea0-80b0-2984ff12b5b5",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"T-test for equality of means X and Y: statistic=30.6366470045653, p-value=9.554335422627212e-107\n",
|
|||
|
"Гипотеза о равенстве распределений X и Y (критерий знаков) отвергается\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy.stats import ttest_ind\n",
|
|||
|
"\n",
|
|||
|
"t_stat, p_value_ttest = ttest_ind(X, Y)\n",
|
|||
|
"\n",
|
|||
|
"print(f'T-test for equality of means X and Y: statistic={t_stat}, p-value={p_value_ttest}')\n",
|
|||
|
"\n",
|
|||
|
"\n",
|
|||
|
"if p_value_ttest < alpha:\n",
|
|||
|
" print(\"Гипотеза о равенстве распределений X и Y (критерий знаков) отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о равенстве распределений X и Y (критерий знаков) не отвергается\")\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 27,
|
|||
|
"id": "3d683033-3432-42b0-b99d-5bc4602c1d28",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Mann-Whitney U test for X and Y: statistic=39604.0, p-value=1.4768098049370635e-64\n",
|
|||
|
"Гипотеза о равенстве распределений X и Y (mannwhitneyu) отвергается\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy.stats import mannwhitneyu\n",
|
|||
|
"\n",
|
|||
|
"u_stat, p_value_mannwhitney = mannwhitneyu(X, Y)\n",
|
|||
|
"\n",
|
|||
|
"print(f'Mann-Whitney U test for X and Y: statistic={u_stat}, p-value={p_value_mannwhitney}')\n",
|
|||
|
"if p_value_mannwhitney < alpha:\n",
|
|||
|
" print(\"Гипотеза о равенстве распределений X и Y (mannwhitneyu) отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о равенстве распределений X и Y (mannwhitneyu) не отвергается\")"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 26,
|
|||
|
"id": "393bd722-dee4-4692-86b2-94d3c926ef5c",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Sign test for X and Y: statistic=0.985, p-value=1.659679419208622e-54\n",
|
|||
|
"Гипотеза о равенстве распределений X и Y (критерий знаков) отвергается\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy.stats import binomtest\n",
|
|||
|
"\n",
|
|||
|
"diff = X - Y\n",
|
|||
|
"n_positive = sum(diff > 0)\n",
|
|||
|
"n_total = len(diff)\n",
|
|||
|
"\n",
|
|||
|
"# Binomial test for the sign test\n",
|
|||
|
"sign_test_result = binomtest(n_positive, n_total, p=0.5)\n",
|
|||
|
"\n",
|
|||
|
"print(f'Sign test for X and Y: statistic={sign_test_result.statistic}, p-value={sign_test_result.pvalue}')\n",
|
|||
|
"\n",
|
|||
|
"if sign_test_result.pvalue < alpha:\n",
|
|||
|
" print(\"Гипотеза о равенстве распределений X и Y (критерий знаков) отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о равенстве распределений X и Y (критерий знаков) не отвергается\")\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": null,
|
|||
|
"id": "9d15fbd5-61f7-4ce8-8c26-442f3fe7a5a9",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": null,
|
|||
|
"id": "69bb743a-0e18-475b-9c99-12fb4c878c1e",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 2,
|
|||
|
"id": "e9621a70-9dd7-49e9-a90a-da9051cc1e39",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Строка со значениями столбца D= 2.29106893237,2.26403892097,6.2446633167,4.93176295377,7.09973553507,5.84190076275,2.91330742621,2.57308785442,5.6869144632,3.93707283059,3.93264067442,1.23962711663,5.92816588081,0.581310339931,2.49878223168,4.42584857266,3.49898148888,6.21364616744,3.25898170282,1.94131808365,2.96677343358,0.659741263411,3.86031145306,9.3666796951,8.24459611291,4.09220004134,5.37452862445,3.13882468173,4.11122173603,0.821461514186,1.68323605285,4.19761005136,3.95725973395,2.8609219217,2.68274392059,2.4003848785,4.26325289,2.5649356191,3.43856907433,-0.538190802425,1.75420235677,7.71678561833,0.798787047917,2.4360008161,4.73973356807,6.82361363062,4.39184490587,4.3084153142,6.386130936,6.62243894369,6.45107547269,1.5908026934,4.21369497931,4.22386242803,2.04668932594,6.16359705613,3.00290165295,5.36868575955,5.45289249694,5.25748441637,0.854327294099,2.98104069695,-0.906781451662,6.01869463603,6.39252059987,5.32627669441,3.08171241758,1.55856342896,4.25735001619,4.58761357451,4.06579591448,5.16454770286,5.68891593981,3.57863598436,4.56023660632,3.25232371118,5.77108364008,2.03424375966,4.12033429679,5.30654271053,3.60168565262,4.00852550948,3.87609131575,4.92368031545,2.47706932781,4.12559834465,3.83740051376,6.19007173018,5.54866779539,3.85911984464,5.78379334795,2.6106290677,3.70107333278,4.4480199468,2.80946277543,3.91595268754,3.69526841579,5.08263234991,2.83853013513,4.56256981337,-0.0990200850857,5.49396138122,3.81375229905,6.02800623977,5.04723833063,5.19108977244,4.93166811013,3.94996447786,2.09122440706,5.58352321149,1.76235444754,0.687902390455,9.40034597862,3.90031851624,4.66853453111,3.95885204015,4.67091515234,2.65800659385,2.46596735383,6.01718943957,2.23501287594,4.34057052755,4.47605810844,3.6169140101,5.07961062785,3.9313569109,3.10307345473,3.14798092339,3.99360992117,3.15387309597,5.08153540746,4.93200276959,3.13595577552,4.7898447788,3.58858222531,0.849263712182,2.72882701337,5.25185003134,4.97964627689,1.82587131482,4.98551578131,0.291661479713,4.71002970446,3.6719721177,3.39311964905,2.44986199694,3.07573083838,2.81492940053,4.87307626853,3.9604570183,1.13029273173,4.82053698751,1.32654701727,7.84993225841,4.12777568255,3.40927235632,5.79027259845,0.802078248036,4.12200287544,2.44315413193,5.95786851881,2.24412800208,6.70453282764,2.86035816443,5.82231338817,4.2488210453,2.2595308785,5.09681669192,2.3652351624,4.42603453088,3.42992742979,4.91407089281,4.69591396749,3.31654416171,8.03286461231,6.06914894206,2.95791637169,2.91747025301,4.30917748622,3.2359712866,5.16293255691,6.20587331612,0.193329476264,3.47222227364,4.01633869097,4.4995946619,4.46669620218,-3.16290716318,5.92328009802,5.53693447068,2.82024823135,4.24260693696,3.15279329672,-0.575154108122,4.4948177318,2.6877013137,3.38441889758,1.29226692427,5.42852280974,4.86122623556\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"column_values = df[\"D\"].tolist()\n",
|
|||
|
"\n",
|
|||
|
"# Объедините значения в одну строку, разделяя их пробелами\n",
|
|||
|
"column_as_string = ','.join(map(str, column_values))\n",
|
|||
|
"print(\"Строка со значениями столбца\", \"D=\",column_as_string)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 3,
|
|||
|
"id": "f5d4c355-9485-4f89-8390-8f12cf45642a",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"max Z: 9.40034597862\n",
|
|||
|
"min Z: -3.16290716318\n",
|
|||
|
"12.5632531418\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"import numpy as np\n",
|
|||
|
"\n",
|
|||
|
"X = np.array([5,7,7,10,12,14,6,13,13,11,11,7,15,12,12,12,7,11,10,11,11,11,10,3,12,6,10,10,7,11,8,12,3,7,12,7,4,13,11,7,9,15,9,9,12,11,10,9,11,3,12,8,9,13,14,9,14,8,8,8,8,11,13,8,11,16,5,17,7,20,8,10,8,8,7,12,16,13,11,9,7,11,13,13,6,12,7,7,8,8,6,15,11,14,7,11,6,5,7,6,15,8,10,7,10,12,8,13,13,15,11,11,9,14,9,11,8,14,14,7,10,15,10,10,7,7,9,13,11,15,11,13,16,9,5,10,6,9,3,10,11,5,5,13,13,9,12,12,11,9,10,10,8,5,8,8,10,9,12,5,11,16,13,11,11,13,12,10,7,13,2,17,6,6,13,9,7,12,18,8,8,12,15,12,17,8,6,16,6,11,10,8,14,7,6,9,10,10,6,9])\n",
|
|||
|
"\n",
|
|||
|
"max_X = np.max(column_values)\n",
|
|||
|
"min_X = np.min(column_values)\n",
|
|||
|
"print(f\"max Z: {max_X}\")\n",
|
|||
|
"print(f\"min Z: {min_X}\")\n",
|
|||
|
"\n",
|
|||
|
"print(max_X - min_X)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 5,
|
|||
|
"id": "2a0963ac-bc8b-4067-9d73-e7763d9166bf",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAA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nRQdHU2RAQDAMH91WQgX+wIAAGNRZAAAgLEoMgAAwFgUGQAAYCyKDAAAMBZFBgAAGIsiAwAAjEWRAQAAxqLIAAAAY1FkAACAsWwtMitXrlTfvn2VkJAgh8OhxYsXn3LZESNGyOFwKCMjo9LyAQCA4GZrkSkoKFD79u01c+bMCpdbtGiRVq1apYSEhEpKBgAATGDrj0b27t1bvXv3rnCZPXv2aNSoUfr000/Vp0+fSkoGAABMENTXyJSWlmrIkCGaMGGCWrdubXccAAAQZGw9IvNXpk+frtDQUI0ePfq0x7jdbrndbs+0y+UKRDRUMqfT6fOfZXR0tGJjY/2cCAAQDIK2yKxdu1bPPfec1q1bJ4fDcdrj0tPTlZaWFsBkqGxOp1ODU4YrN6/Qp/ExURGamzmLMgMAZ6GgLTJffPGFDhw4oKSkJM+8kpISjRs3ThkZGdqxY8dJx02cOFGpqameaZfLpcTExEDHRQC5XC7l5hUqtutNioyJ82psQe5+Ob95Vy6XiyIDAGehoC0yQ4YMUc+ePcvM69Wrl4YMGaKUlJRTjgsPD1d4eHig48EGkTF
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjUAAAHHCAYAAABHp6kXAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAABdtElEQVR4nO3de3zO9f/H8ce12dFszGlkmEPlzEKo6KDIIZ2/FYUkOeScqL4OlSTHnEK+OYfKKZJDDjlETs1CzseYHIbZsNmuz++Pz88ytrmu7dquXdee99ttt1+f4/Xq6ve1p/fRYhiGgYiIiIiL83B2ASIiIiKOoFAjIiIibkGhRkRERNyCQo2IiIi4BYUaERERcQsKNSIiIuIWFGpERETELSjUiIiIiFtQqBERERG3oFAjIrlSmzZtKF26tLPLEBEHUqgRkSyxZ88eWrVqxT333IOPjw/FixenVatW7N2716HPOMNnn33GokWLnF2GiNxGoUZEHG7BggWEh4ezevVq2rZty4QJE2jXrh1r1qwhPDycxYsXO+QZZ1GoEcmZLNrQUkQc6fDhw1StWpWSJUuyfv16ChcunHzt/PnzPPLII/z9999ERkYSFhaW4Wcyq02bNqxbt45jx47Z/WxAQAAvvvgi06ZNc0gtIuIYaqkREYcaNmwYV69eZfLkySnCCUChQoWYNGkSsbGxDBs2LFPPpGbdunVYLBbmzZvHBx98QEhICHnz5uWZZ57h5MmTd609Li6OXr16ERoaio+PD/fddx/Dhw/n1r/7WSwW4uLimD59OhaLBYvFQps2bWz4ZkQkq6mlRkQc6p577sHb25ujR4+meU9YWBiJiYnJQSMjz6Rm3bp1PPbYY1SpUiU5bJw9e5bRo0dTsmRJIiIi8PPzA+5sqTEMg4YNG7J27VratWtH9erVWbFiBUuWLKF79+6MGjUKgFmzZvHWW29Ru3Zt3n77bQDKli1L3bp17fqeRCQLGCIiDnLp0iUDMFq0aJHufc8884wBGDExMRl6Ji1r1641AOOee+5Jcd93331nAMaXX36ZfK5169ZGqVKlko8XLVpkAMann36a4p0vvviiYbFYjEOHDiWfy5s3r9G6det06xWR7KfuJxFxmCtXrgCQL1++dO+7ef3KlSsZeuZu3njjjRTve/HFFylWrBjLli1L85lly5bh6elJ165dU5zv1asXhmHw888/3/VzRcS58ji7ABFxH7YGjytXrmCxWChUqBDXrl2z+5m7KV++fIpji8VCuXLl0h0UfPz4cYoXL35HuKpQoULydRHJ2RRqRMRhgoKCKF68OJGRkeneFxkZSYkSJfD29sbb29vuZ0REUqPuJxFxqObNm3P06FE2btyY6vUNGzZw7NgxXnrppUw9k56DBw+mODYMg0OHDqW7gnCpUqU4ffr0HS1G+/btS75+k8VisakOEcleCjUi4lC9e/fG39+fDh06cOHChRTXoqOjeeeddwgMDKRL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sXDhQubMmUPlypX55JNPGD16NC1btnR2aSIiIjlbZCTUqgWjR5vHnTrBzp0QHu7UshzNZQYKO4KtA41ERETcgtVqBpl+/cwdtosUgW++gaZNnV2ZXdxuoLCIiIjY4e+/oU0bc70ZgObNzVWCixRxallZyWW6n0RERMRG339vDgZevRr8/GDiRHMvJzcONKCWGhEREfcREwNdu5rrzwDUrAmzZpmDgnMBtdSIiIi4g02bzM0np08HDw/48EP47bdcE2hALTUiIiKu7cYNc9+mzz4zBwaXLm0upPfww86uLNsp1IiIiLiqAwfMXbW3bTOP33gDxoyBoCDn1uUk6n4SERFxNYYBkydDjRpmoClQAObNM7uecmmgAbXUiIiIuJa
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"import numpy as np\n",
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"import statsmodels.api as sm\n",
|
|||
|
"\n",
|
|||
|
"# Ваши данные\n",
|
|||
|
"Y = df[\"Y\"]\n",
|
|||
|
"\n",
|
|||
|
"# Построение гистограммы\n",
|
|||
|
"plt.hist(Y, bins=30, edgecolor='k', alpha=0.7)\n",
|
|||
|
"plt.title('Histogram of Y')\n",
|
|||
|
"plt.xlabel('Value')\n",
|
|||
|
"plt.ylabel('Frequency')\n",
|
|||
|
"plt.show()\n",
|
|||
|
"\n",
|
|||
|
"# Построение QQ-графика для нормального распределения\n",
|
|||
|
"sm.qqplot(np.array(Y), line ='s')\n",
|
|||
|
"plt.title('QQ plot')\n",
|
|||
|
"plt.show()"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 32,
|
|||
|
"id": "845241c8-3e21-4eea-b63a-9d3af2641a75",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Основные числовые характеристики:\n",
|
|||
|
" X Y Z D\n",
|
|||
|
"count 200.000000 200.000000 200.000000 200.000000\n",
|
|||
|
"mean 9.990000 1.973704 1.075743 3.886346\n",
|
|||
|
"std 3.242293 1.783375 3.886138 1.859615\n",
|
|||
|
"min 2.000000 -0.960908 -8.928492 -3.162907\n",
|
|||
|
"25% 8.000000 0.314313 -1.393858 2.813563\n",
|
|||
|
"50% 10.000000 1.942471 1.158932 3.959655\n",
|
|||
|
"75% 12.000000 3.583925 3.856398 5.080092\n",
|
|||
|
"max 20.000000 4.976185 11.438908 9.400346\n",
|
|||
|
"\n",
|
|||
|
"Мода:\n",
|
|||
|
" X Y Z D\n",
|
|||
|
"0 11.0 -0.960908 -8.928492 -3.162907\n",
|
|||
|
"1 NaN -0.922780 -8.137045 -0.906781\n",
|
|||
|
"2 NaN -0.915775 -6.631962 -0.575154\n",
|
|||
|
"3 NaN -0.905167 -6.595189 -0.538191\n",
|
|||
|
"4 NaN -0.878380 -6.265933 -0.099020\n",
|
|||
|
".. ... ... ... ...\n",
|
|||
|
"195 NaN 4.794342 8.613534 7.849932\n",
|
|||
|
"196 NaN 4.863656 8.757429 8.032865\n",
|
|||
|
"197 NaN 4.887727 9.249164 8.244596\n",
|
|||
|
"198 NaN 4.939905 10.436217 9.366680\n",
|
|||
|
"199 NaN 4.976185 11.438908 9.400346\n",
|
|||
|
"\n",
|
|||
|
"[200 rows x 4 columns]\n",
|
|||
|
"\n",
|
|||
|
"Коэффициенты асимметрии:\n",
|
|||
|
"X 0.169883\n",
|
|||
|
"Y 0.048440\n",
|
|||
|
"Z -0.057667\n",
|
|||
|
"D -0.218358\n",
|
|||
|
"dtype: float64\n",
|
|||
|
"\n",
|
|||
|
"Коэффициенты эксцесса:\n",
|
|||
|
"X -0.133848\n",
|
|||
|
"Y -1.278495\n",
|
|||
|
"Z -0.325102\n",
|
|||
|
"D 1.058480\n",
|
|||
|
"dtype: float64\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"\n",
|
|||
|
"# Основные числовые характеристики для каждой выборки\n",
|
|||
|
"stats = df.describe()\n",
|
|||
|
"\n",
|
|||
|
"# Мода для каждой выборки\n",
|
|||
|
"modes = df.mode(axis=0)\n",
|
|||
|
"\n",
|
|||
|
"# Коэффициенты асимметрии для каждой выборки\n",
|
|||
|
"skewness = df.skew()\n",
|
|||
|
"\n",
|
|||
|
"# Коэффициенты эксцесса для каждой выборки\n",
|
|||
|
"kurtosis = df.kurtosis()\n",
|
|||
|
"\n",
|
|||
|
"# Вывод результатов\n",
|
|||
|
"print(\"Основные числовые характеристики:\")\n",
|
|||
|
"print(stats)\n",
|
|||
|
"print(\"\\nМода:\")\n",
|
|||
|
"print(modes)\n",
|
|||
|
"print(\"\\nКоэффициенты асимметрии:\")\n",
|
|||
|
"print(skewness)\n",
|
|||
|
"print(\"\\nКоэффициенты эксцесса:\")\n",
|
|||
|
"print(kurtosis)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 33,
|
|||
|
"id": "ae5b504b-0ed0-4324-a9bf-c4d86e846c99",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Дисперсия:\n",
|
|||
|
"X 10.512462\n",
|
|||
|
"Y 3.180425\n",
|
|||
|
"Z 15.102067\n",
|
|||
|
"D 3.458169\n",
|
|||
|
"dtype: float64\n",
|
|||
|
"\n",
|
|||
|
"Медиана:\n",
|
|||
|
"X 10.000000\n",
|
|||
|
"Y 1.942471\n",
|
|||
|
"Z 1.158932\n",
|
|||
|
"D 3.959655\n",
|
|||
|
"dtype: float64\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# Используем describe() для получения основных статистических характеристик\n",
|
|||
|
"stats = df.describe()\n",
|
|||
|
"\n",
|
|||
|
"# Извлекаем значения дисперсии и медианы из результата describe()\n",
|
|||
|
"variance = df.var()\n",
|
|||
|
"median = df.median()\n",
|
|||
|
"\n",
|
|||
|
"print(\"Дисперсия:\")\n",
|
|||
|
"print(variance)\n",
|
|||
|
"print(\"\\nМедиана:\")\n",
|
|||
|
"print(median)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 38,
|
|||
|
"id": "6f33dfdc-1541-4257-bded-804fc7aa92d5",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Мода для массива X: ModeResult(mode=11, count=27)\n",
|
|||
|
"Мода для массива Y: ModeResult(mode=-0.960907783569, count=1)\n",
|
|||
|
"Мода для массива Z: ModeResult(mode=-8.92849226343, count=1)\n",
|
|||
|
"Мода для массива D: ModeResult(mode=-3.16290716318, count=1)\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy.stats import mode\n",
|
|||
|
"\n",
|
|||
|
"mode_X = mode(df[\"X\"])\n",
|
|||
|
"print(\"Мода для массива X:\", mode_X)\n",
|
|||
|
"mode_Y = mode(df[\"Y\"])\n",
|
|||
|
"print(\"Мода для массива Y:\", mode_Y)\n",
|
|||
|
"mode_Z = mode(df[\"Z\"])\n",
|
|||
|
"print(\"Мода для массива Z:\", mode_Z)\n",
|
|||
|
"mode_D = mode(df[\"D\"])\n",
|
|||
|
"print(\"Мода для массива D:\", mode_D)\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 40,
|
|||
|
"id": "a63946f5-ca2b-4f6e-a75c-ead8046719e9",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Размах для массива X: 18\n",
|
|||
|
"Размах для массива Y: 5.937092332969\n",
|
|||
|
"Размах для массива Z: 20.367399974130002\n",
|
|||
|
"Размах для массива D: 12.5632531418\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"range_x = df[\"X\"].max() - df[\"X\"].min()\n",
|
|||
|
"range_y = df[\"Y\"].max() - df[\"Y\"].min()\n",
|
|||
|
"range_z = df[\"Z\"].max() - df[\"Z\"].min()\n",
|
|||
|
"range_d = df[\"D\"].max() - df[\"D\"].min()\n",
|
|||
|
"\n",
|
|||
|
"print(\"Размах для массива X:\", range_x)\n",
|
|||
|
"print(\"Размах для массива Y:\", range_y)\n",
|
|||
|
"print(\"Размах для массива Z:\", range_z)\n",
|
|||
|
"print(\"Размах для массива D:\", range_d)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 18,
|
|||
|
"id": "65bab523-1fa1-4565-8175-c0377cdbb3de",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Доверительный интервал для параметра lambda: (0.0, 6.0)\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy.stats import poisson\n",
|
|||
|
"\n",
|
|||
|
"# Генерируем случайные данные из распределения Пуассона\n",
|
|||
|
"data = df[\"Y\"]\n",
|
|||
|
"\n",
|
|||
|
"# Вычисляем доверительный интервал для параметра lambda\n",
|
|||
|
"confidence_level = 0.97\n",
|
|||
|
"mu = np.mean(data)\n",
|
|||
|
"confidence_interval_lambda = poisson.interval(confidence_level, mu)\n",
|
|||
|
"\n",
|
|||
|
"print(\"Доверительный интервал для параметра lambda:\", confidence_interval_lambda)\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 20,
|
|||
|
"id": "f845203f-e203-469d-b691-605f2ad9157f",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Доверительный интервал для среднего: (0.4809137886503132, 1.670572952477344)\n",
|
|||
|
"Доверительный интервал для дисперсии: (1377.9540180739787, -1377.9540180739787)\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy.stats import norm\n",
|
|||
|
"import numpy as np\n",
|
|||
|
"\n",
|
|||
|
"# Генерируем случайные данные из нормального распределения\n",
|
|||
|
"data = df[\"Z\"]\n",
|
|||
|
"\n",
|
|||
|
"# Вычисляем доверительные интервалы для среднего и дисперсии\n",
|
|||
|
"confidence_level = 0.97\n",
|
|||
|
"mean, std_dev = np.mean(data), np.std(data)\n",
|
|||
|
"confidence_interval_mean = norm.interval(confidence_level, loc=mean, scale=std_dev/np.sqrt(len(data)))\n",
|
|||
|
"confidence_interval_variance = ((len(data) - 1) * std_dev ** 2 / norm.ppf((1 + confidence_level) / 2), (len(data) - 1) * std_dev ** 2 / norm.ppf((1 - confidence_level) / 2))\n",
|
|||
|
"\n",
|
|||
|
"print(\"Доверительный интервал для среднего:\", confidence_interval_mean)\n",
|
|||
|
"print(\"Доверительный интервал для дисперсии:\", confidence_interval_variance)\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 26,
|
|||
|
"id": "4e66b1b2-bb67-487b-aa5a-119e52372024",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Доверительный интервал для среднего (нормальное распределение): (3.8814008005067353, 3.891291378730957)\n",
|
|||
|
"Доверительный интервал для стандартного отклонения (нормальное распределение): (1.854670068863352, 1.8645606470875733)\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"import numpy as np\n",
|
|||
|
"from scipy import stats\n",
|
|||
|
"\n",
|
|||
|
"# Пример данных для нормального распределения\n",
|
|||
|
"data_normal = df[\"D\"]\n",
|
|||
|
"\n",
|
|||
|
"# Уровень доверия\n",
|
|||
|
"alpha_normal = 1 - 0.97\n",
|
|||
|
"\n",
|
|||
|
"# Доверительный интервал для среднего\n",
|
|||
|
"ci_mean_normal = stats.norm.interval(alpha_normal, loc=np.mean(data_normal), scale=stats.sem(data_normal))\n",
|
|||
|
"\n",
|
|||
|
"# Доверительный интервал для стандартного отклонения\n",
|
|||
|
"ci_std_normal = stats.norm.interval(alpha_normal, loc=np.std(data_normal, ddof=1), scale=stats.sem(data_normal))\n",
|
|||
|
"\n",
|
|||
|
"print(\"Доверительный интервал для среднего (нормальное распределение):\", ci_mean_normal)\n",
|
|||
|
"print(\"Доверительный интервал для стандартного отклонения (нормальное распределение):\", ci_std_normal)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 28,
|
|||
|
"id": "cff25e40-88e2-4c3d-a07c-3308d7b80e0a",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Доверительный интервал для λ (распределение Пуассона): (1.7000475201301464, 2.24736008127113)\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"import statsmodels.api as sm\n",
|
|||
|
"\n",
|
|||
|
"# Пример данных для распределения Пуассона\n",
|
|||
|
"data_poisson = df[\"Y\"]\n",
|
|||
|
"\n",
|
|||
|
"# Уровень доверия\n",
|
|||
|
"alpha_poisson = 1 - 0.97\n",
|
|||
|
"\n",
|
|||
|
"# Доверительный интервал для λ распределения Пуассона\n",
|
|||
|
"ci_low, ci_upp = sm.stats.DescrStatsW(data_poisson).zconfint_mean(alpha=alpha_poisson)\n",
|
|||
|
"\n",
|
|||
|
"print(\"Доверительный интервал для λ (распределение Пуассона):\", (ci_low, ci_upp))\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 40,
|
|||
|
"id": "0f465489-bda9-46fa-a992-98c8c9359c08",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Для нормального распределения:\n",
|
|||
|
"Критерий χ²:\n",
|
|||
|
"Статистика: 2793.7065606649576\n",
|
|||
|
"p-значение: 0.0\n",
|
|||
|
"Гипотеза о нормальном распределении отвергается\n",
|
|||
|
"\n",
|
|||
|
"Критерий Колмогорова-Смирнова:\n",
|
|||
|
"Статистика: 0.40797473115516536\n",
|
|||
|
"p-значение: 1.3210039910263899e-30\n",
|
|||
|
"Гипотеза о нормальном распределении отвергается\n",
|
|||
|
"\n",
|
|||
|
"Для распределения Пуассона:\n",
|
|||
|
"Критерий χ²:\n",
|
|||
|
"Статистика: 97.10526315789474\n",
|
|||
|
"p-значение: 0.5350796372889958\n",
|
|||
|
"Гипотеза о распределении Пуассона не отвергается\n",
|
|||
|
"\n",
|
|||
|
"Критерий Колмогорова-Смирнова:\n",
|
|||
|
"Статистика: 0.24762088352106568\n",
|
|||
|
"p-значение: 6.908752326169566e-06\n",
|
|||
|
"Гипотеза о распределении Пуассона отвергается\n",
|
|||
|
"\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy.stats import normaltest, kstest, chisquare\n",
|
|||
|
"import numpy as np\n",
|
|||
|
"\n",
|
|||
|
"# Генерация случайных данных из нормального распределения\n",
|
|||
|
"data_normal = df[\"Z\"]\n",
|
|||
|
"\n",
|
|||
|
"# Проверка гипотезы о нормальном распределении с помощью критерия χ²\n",
|
|||
|
"chi2_stat_normal, chi2_p_value_normal = chisquare(data_normal, f_exp=np.mean(data_normal))\n",
|
|||
|
"\n",
|
|||
|
"# Проверка гипотезы о нормальном распределении с помощью критерия Колмогорова-Смирнова\n",
|
|||
|
"ks_stat_normal, ks_p_value_normal = kstest(data_normal, 'norm')\n",
|
|||
|
"\n",
|
|||
|
"print(\"Для нормального распределения:\")\n",
|
|||
|
"print(\"Критерий χ²:\")\n",
|
|||
|
"print(\"Статистика:\", chi2_stat_normal)\n",
|
|||
|
"print(\"p-значение:\", chi2_p_value_normal)\n",
|
|||
|
"if chi2_p_value_normal < 0.05:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении не отвергается\")\n",
|
|||
|
"print()\n",
|
|||
|
"\n",
|
|||
|
"print(\"Критерий Колмогорова-Смирнова:\")\n",
|
|||
|
"print(\"Статистика:\", ks_stat_normal)\n",
|
|||
|
"print(\"p-значение:\", ks_p_value_normal)\n",
|
|||
|
"if ks_p_value_normal < 0.05:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о нормальном распределении не отвергается\")\n",
|
|||
|
"print()\n",
|
|||
|
"\n",
|
|||
|
"# Генерация случайных данных из распределения Пуассона\n",
|
|||
|
"data_poisson = np.random.poisson(lam=3, size=100)\n",
|
|||
|
"\n",
|
|||
|
"# Проверка гипотезы о распределении с помощью критерия χ²\n",
|
|||
|
"chi2_stat_poisson, chi2_p_value_poisson = chisquare(data_poisson, f_exp=np.mean(data_poisson))\n",
|
|||
|
"\n",
|
|||
|
"# Проверка гипотезы о распределении с помощью критерия Колмогорова-Смирнова\n",
|
|||
|
"ks_stat_poisson, ks_p_value_poisson = kstest(data_poisson, 'poisson', args=(np.mean(data_poisson),))\n",
|
|||
|
"\n",
|
|||
|
"print(\"Для распределения Пуассона:\")\n",
|
|||
|
"print(\"Критерий χ²:\")\n",
|
|||
|
"print(\"Статистика:\", chi2_stat_poisson)\n",
|
|||
|
"print(\"p-значение:\", chi2_p_value_poisson)\n",
|
|||
|
"if chi2_p_value_poisson < 0.05:\n",
|
|||
|
" print(\"Гипотеза о распределении Пуассона отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о распределении Пуассона не отвергается\")\n",
|
|||
|
"print()\n",
|
|||
|
"\n",
|
|||
|
"print(\"Критерий Колмогорова-Смирнова:\")\n",
|
|||
|
"print(\"Статистика:\", ks_stat_poisson)\n",
|
|||
|
"print(\"p-значение:\", ks_p_value_poisson)\n",
|
|||
|
"if ks_p_value_poisson < 0.05:\n",
|
|||
|
" print(\"Гипотеза о распределении Пуассона отвергается\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Гипотеза о распределении Пуассона не отвергается\")\n",
|
|||
|
"print()\n",
|
|||
|
"\n",
|
|||
|
"\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 24,
|
|||
|
"id": "039d794e-24dd-4021-af5f-ba8af18c126e",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Доверительный интервал для среднего значения нормального распределения (Z): (0.4737185524940215, 1.6662814475059786)\n",
|
|||
|
"Доверительный интервал для среднего значения нормального распределения (D): (3.1477413862442116, 3.7522586137557887)\n",
|
|||
|
"Доверительный интервал для дисперсии нормального распределения (Z): (12.278109551840211, 18.9936876420616)\n",
|
|||
|
"Доверительный интервал для дисперсии нормального распределения (D): (3.154904970936425, 4.88049722193371)\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"import numpy as np\n",
|
|||
|
"from scipy.stats import norm, chi2, poisson\n",
|
|||
|
"\n",
|
|||
|
"# Данные\n",
|
|||
|
"mean_X = 1.07\n",
|
|||
|
"variance_X = 15.1\n",
|
|||
|
"\n",
|
|||
|
"mean_Y = 3.45\n",
|
|||
|
"variance_Y = 3.88\n",
|
|||
|
"\n",
|
|||
|
"# Количество наблюдений\n",
|
|||
|
"n = 200\n",
|
|||
|
"\n",
|
|||
|
"# Уровень доверия\n",
|
|||
|
"gamma = 0.97\n",
|
|||
|
"\n",
|
|||
|
"# Доверительный интервал для среднего значения нормального распределения\n",
|
|||
|
"z_score = norm.ppf((1 + gamma) / 2)\n",
|
|||
|
"margin_of_error_X = z_score * np.sqrt(variance_X / n)\n",
|
|||
|
"confidence_interval_mean_X = (mean_X - margin_of_error_X, mean_X + margin_of_error_X)\n",
|
|||
|
"\n",
|
|||
|
"margin_of_error_Y = z_score * np.sqrt(variance_Y / n)\n",
|
|||
|
"confidence_interval_mean_Y = (mean_Y - margin_of_error_Y, mean_Y + margin_of_error_Y)\n",
|
|||
|
"\n",
|
|||
|
"# Доверительный интервал для дисперсии нормального распределения\n",
|
|||
|
"lower_chi2_X = chi2.ppf((1 - gamma) / 2, n - 1)\n",
|
|||
|
"upper_chi2_X = chi2.ppf((1 + gamma) / 2, n - 1)\n",
|
|||
|
"confidence_interval_variance_X = ((n - 1) * variance_X / upper_chi2_X, (n - 1) * variance_X / lower_chi2_X)\n",
|
|||
|
"confidence_interval_variance_Y = ((n - 1) * variance_Y / upper_chi2_X, (n - 1) * variance_Y / lower_chi2_X)\n",
|
|||
|
"# Оценка параметра λ (лямбда) распределения Пуассона\n",
|
|||
|
"lambda_estimate_Y = mean_Y\n",
|
|||
|
"\n",
|
|||
|
"# Доверительный интервал для параметра λ (лямбда) распределения Пуассона\n",
|
|||
|
"margin_of_error_lambda_Y = z_score * np.sqrt(variance_Y / n)\n",
|
|||
|
"confidence_interval_lambda_Y = (lambda_estimate_Y - margin_of_error_lambda_Y, lambda_estimate_Y + margin_of_error_lambda_Y)\n",
|
|||
|
"\n",
|
|||
|
"print(\"Доверительный интервал для среднего значения нормального распределения (Z):\", confidence_interval_mean_X)\n",
|
|||
|
"print(\"Доверительный интервал для среднего значения нормального распределения (D):\", confidence_interval_mean_Y)\n",
|
|||
|
"print(\"Доверительный интервал для дисперсии нормального распределения (Z):\", confidence_interval_variance_X)\n",
|
|||
|
"print(\"Доверительный интервал для дисперсии нормального распределения (D):\", confidence_interval_variance_Y)\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 43,
|
|||
|
"id": "56b72908-81f9-4d91-bd23-baae0acb67b1",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Доверительный интервал для параметра λ (лямбда) распределения Пуассона (D): (3.600990708651492, 4.1717012913485085)\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"import numpy as np\n",
|
|||
|
"from scipy.stats import norm\n",
|
|||
|
"\n",
|
|||
|
"# Данные\n",
|
|||
|
"mean_D = 3.886346\n",
|
|||
|
"variance_D = 3.458169\n",
|
|||
|
"\n",
|
|||
|
"# Количество наблюдений\n",
|
|||
|
"n = 200\n",
|
|||
|
"\n",
|
|||
|
"# Уровень доверия\n",
|
|||
|
"gamma = 0.97\n",
|
|||
|
"\n",
|
|||
|
"# Оценка параметра λ (лямбда) распределения Пуассона\n",
|
|||
|
"lambda_estimate_D = mean_D\n",
|
|||
|
"\n",
|
|||
|
"# Доверительный интервал для параметра λ (лямбда) распределения Пуассона\n",
|
|||
|
"margin_of_error_lambda_D = norm.ppf((1 + gamma) / 2) * np.sqrt(variance_D / n)\n",
|
|||
|
"confidence_interval_lambda_D = (lambda_estimate_D - margin_of_error_lambda_D, lambda_estimate_D + margin_of_error_lambda_D)\n",
|
|||
|
"\n",
|
|||
|
"print(\"Доверительный интервал для параметра λ (лямбда) распределения Пуассона (D):\", confidence_interval_lambda_D)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 43,
|
|||
|
"id": "544987ab-1968-4756-b841-d0bc53cf371d",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Результаты теста на нормальность (Хи-квадрат):\n",
|
|||
|
"Хи-квадрат статистика: 7.227123057931748\n",
|
|||
|
"p-значение: 0.026955672296074838\n",
|
|||
|
"Отвергаем нулевую гипотезу (случайная величина не имеет нормальное распределение)\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy import stats\n",
|
|||
|
"\n",
|
|||
|
"# Загрузим данные\n",
|
|||
|
"data_X = df['D']\n",
|
|||
|
"\n",
|
|||
|
"# Проведем тест на нормальность с помощью критерия хи-квадрат\n",
|
|||
|
"chi_square, p_chi = stats.normaltest(data_X)\n",
|
|||
|
"\n",
|
|||
|
"# Определим уровень значимости\n",
|
|||
|
"alpha = 0.05\n",
|
|||
|
"\n",
|
|||
|
"# Выведем результаты теста\n",
|
|||
|
"print(\"Результаты теста на нормальность (Хи-квадрат):\")\n",
|
|||
|
"print(\"Хи-квадрат статистика:\", chi_square)\n",
|
|||
|
"print(\"p-значение:\", p_chi)\n",
|
|||
|
"\n",
|
|||
|
"# Сравним p-значение с уровнем значимости\n",
|
|||
|
"if p_chi < alpha:\n",
|
|||
|
" print(\"Отвергаем нулевую гипотезу (случайная величина не имеет нормальное распределение)\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Не отвергаем нулевую гипотезу (случайная величина имеет нормальное распределение)\")\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 44,
|
|||
|
"id": "c5c37f26-076a-4bdd-8cbd-d230c74cb494",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Результаты теста Колмогорова-Смирнова:\n",
|
|||
|
"Статистика Колмогорова-Смирнова: 0.04950094422191759\n",
|
|||
|
"p-значение: 0.6921286443105663\n",
|
|||
|
"Не отвергаем нулевую гипотезу (случайная величина имеет нормальное распределение)\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy import stats\n",
|
|||
|
"\n",
|
|||
|
"# Загрузим данные\n",
|
|||
|
"data_X = df['D']\n",
|
|||
|
"\n",
|
|||
|
"# Проведем тест Колмогорова-Смирнова на нормальность\n",
|
|||
|
"ks_statistic, p_ks = stats.kstest(data_X, 'norm', args=(data_X.mean(), data_X.std()))\n",
|
|||
|
"\n",
|
|||
|
"# Определим уровень значимости\n",
|
|||
|
"alpha = 0.05\n",
|
|||
|
"\n",
|
|||
|
"# Выведем результаты теста\n",
|
|||
|
"print(\"Результаты теста Колмогорова-Смирнова:\")\n",
|
|||
|
"print(\"Статистика Колмогорова-Смирнова:\", ks_statistic)\n",
|
|||
|
"print(\"p-значение:\", p_ks)\n",
|
|||
|
"\n",
|
|||
|
"# Сравним p-значение с уровнем значимости\n",
|
|||
|
"if p_ks < alpha:\n",
|
|||
|
" print(\"Отвергаем нулевую гипотезу (случайная величина не имеет нормальное распределение)\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Не отвергаем нулевую гипотезу (случайная величина имеет нормальное распределение)\")\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 61,
|
|||
|
"id": "04e8c235-5a08-407b-9606-d97583e8426b",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Результаты t-теста:\n",
|
|||
|
"t-статистика: 30.6366470045653\n",
|
|||
|
"p-значение: 9.554335422627212e-107\n",
|
|||
|
"\n",
|
|||
|
"Результаты U-теста Манна-Уитни:\n",
|
|||
|
"U-статистика: 39604.0\n",
|
|||
|
"p-значение: 1.4768098049370635e-64\n",
|
|||
|
"\n",
|
|||
|
"Отвергаем нулевую гипотезу (параметры идентичны)\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy import stats\n",
|
|||
|
"\n",
|
|||
|
"# Загрузим данные\n",
|
|||
|
"data_X = df['X']\n",
|
|||
|
"data_Y = df['Y']\n",
|
|||
|
"\n",
|
|||
|
"# Проведем тесты\n",
|
|||
|
"t_statistic, p_t = stats.ttest_ind(data_X, data_Y)\n",
|
|||
|
"u_statistic, p_u = stats.mannwhitneyu(data_X, data_Y)\n",
|
|||
|
"\n",
|
|||
|
"# Определим уровень значимости\n",
|
|||
|
"alpha = 0.05\n",
|
|||
|
"\n",
|
|||
|
"# Выведем результаты тестов\n",
|
|||
|
"print(\"Результаты t-теста:\")\n",
|
|||
|
"print(\"t-статистика:\", t_statistic)\n",
|
|||
|
"print(\"p-значение:\", p_t)\n",
|
|||
|
"\n",
|
|||
|
"print(\"\\nРезультаты U-теста Манна-Уитни:\")\n",
|
|||
|
"print(\"U-статистика:\", u_statistic)\n",
|
|||
|
"print(\"p-значение:\", p_u)\n",
|
|||
|
"\n",
|
|||
|
"# Сравним p-значения с уровнем значимости\n",
|
|||
|
"if p_t < alpha:\n",
|
|||
|
" print(\"\\nОтвергаем нулевую гипотезу (параметры идентичны)\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"\\nНе отвергаем нулевую гипотезу (параметры различны)\")\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 62,
|
|||
|
"id": "d64c7870-21a7-4854-bc1b-c2e6b12b00c9",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Тест Фишера (для равенства дисперсий):\n",
|
|||
|
"Статистика теста: 50.53439589307273\n",
|
|||
|
"p-value: 5.4580629443683286e-12\n",
|
|||
|
"Отвергаем гипотезу о равенстве дисперсий (p-value < alpha)\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy.stats import levene\n",
|
|||
|
"\n",
|
|||
|
"def check_equal_variances(data1, data2, alpha=0.05):\n",
|
|||
|
" # Проверяем гипотезу о равенстве дисперсий с помощью теста Фишера\n",
|
|||
|
" stat, p_value = levene(data1, data2)\n",
|
|||
|
" \n",
|
|||
|
" # Выводим результаты теста\n",
|
|||
|
" print(\"Тест Фишера (для равенства дисперсий):\")\n",
|
|||
|
" print(\"Статистика теста:\", stat)\n",
|
|||
|
" print(\"p-value:\", p_value)\n",
|
|||
|
" \n",
|
|||
|
" # Сравниваем p-value с уровнем значимости\n",
|
|||
|
" if p_value < alpha:\n",
|
|||
|
" print(\"Отвергаем гипотезу о равенстве дисперсий (p-value < alpha)\")\n",
|
|||
|
" else:\n",
|
|||
|
" print(\"Не отвергаем гипотезу о равенстве дисперсий (p-value >= alpha)\")\n",
|
|||
|
"\n",
|
|||
|
"# Пример использования\n",
|
|||
|
"data1 = df['X']\n",
|
|||
|
"data2 = df['Y']\n",
|
|||
|
"check_equal_variances(data1, data2)\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": null,
|
|||
|
"id": "6744264b-5b63-4d8b-a937-66847504c323",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": null,
|
|||
|
"id": "b96eddf5-38cb-49e8-a20c-555407030c43",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 14,
|
|||
|
"id": "e576602a-0ce3-4ffd-a8e1-c63058e9f05f",
|
|||
|
"metadata": {},
|
|||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1bJlS91///2qqKhwbmOz2ZSVlaWysjLnsZo7d+4p1T/Wfffdp759+2rx4sXatm2bWzWAuogzOoDFFBcXq6io6LjxysrKv3zvI488ovT0dN12223q0qWLSkpKtH79em3cuFFXXnml7rjjDu3du1fZ2dn697//7fJewzD097//XR999JGSk5N1wQUXaMWKFbr77ru1Z88ePfvss85tR44cqUWLFunmm2/WJZdcotWrV+vqq68+aV/XXXed4uPj9cQTTzhDU3Z2tn744QeNGjVKUVFR+vbbbzVnzhx9++23Wrt2rUsAk6Trr79eCQkJmj59ut577z1NmzZN4eHheumll3TFFVfoySef1BtvvKHJkyfroosuUo8ePao9VrfddpvmzZuna6+9VpMmTdIXX3yh9PR05ebmasmSJZKkf//735ozZ47WrVvnvBx16aWX/uW/h5O5+eabtXLlSmVnZ+vcc891uw5QpxgALCErK8uQVO1y/vnnu7ynRYsWxogRI5zrHTp0MK6++upq95OSkmKc6KNj6dKlhiRj2rRpLuPXXnutYbPZjLy8PMMwDGPDhg2GJGPChAku240cOdKQZEyZMsU5NmXKFEOSceONNx63v/Ly8uPG3nzzTUOSsWbNmuNqjB492jn2+++/G82bNzdsNpsxffp05/hvv/1mBAYGuhyTE9m8ebMhybjttttcxidPnmxIMj788EPn2IgRI4yGDRtWW+9Ut920aZMhyZg4ceIp1QNgGFy6AiwmIyND2dnZxy2JiYl/+d5GjRrp22+/1fbt2097v++//778/f01btw4l/FJkybJMAwtW7ZMkrR8+XJJ0j/+8Q+X7caOHXvS2mPGjDluLDAw0Pnnw4cPq6ioSJdccokkaePGjcdtf9tttzn/7O/vr86dO8swDCUnJzvHGzVqpPPOO08//PDDSXuR/vhZJSk1NdVlfNKkSZKk9957r9r3uys4OFiSdPDgwVqpD1gRl64Ai+nSpYs6d+583PhZZ511wktaf/boo49q4MCBOvfcc9WuXTv169dPN9988ymFpF27dik6OlohISEu4wkJCc7Xj/7Tz89PcXFxLtudc845J6197LaS9Ouvv2rq1KlasGCBCgsLXV4rLi4+bvvY2FiX9bCwMD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8vPz+8snEgPA6eDSFYAzbsaMGdqwYYN69eqlevXqadmyZVq2bJlGjx6tmJgYs9sDYCFcugJwxmVnZ2vq1Kn67rvvVFpaqtjYWN1888164IEHVK8ef/8C4DkEHQAAYFnM0QEAAJZF0AEAAJZl+YvhDodDe/fuVUhIyBn/XhoAAOAewzB08OBBRUdH1+j5UZYPOnv37uUuDgAAfNTu3bvVvHlzt99v+aATEhIi6Y8DFRoaanI3AADgVJSUlCgmJsb5e9xdlg86Ry9XhYaGEnQAAPAxNZ12Yupk5MzMTCUmJjpDSNeuXbVs2TLn6z179pTNZnNZxowZY2LHAADAl5h6Rqd58+aaPn264uPjZRiG5s2bp4EDB2rTpk06//zzJUm33367Hn30Ued7goKCzGoXAAD4GFODzoABA1zWH3/8cWVmZmrt2rXOoBMUFKSoqCgz2gMAAD7Oa56jU1VVpQULFqisrExdu3Z1jr/xxhuKiIhQu3btlJaWpvLy8mrrVFRUqKSkxGUBAAB1k+mTkb/++mt17dpVhw8fVnBwsJYsWaK2bdtKkoYNG6YWLVooOjpaW7Zs0b333qutW7fqrbfeOmm99PR0TZ069Uy1DwAAvJjp33V15MgR5efnq7i4WP/5z3/08ssva/Xq1c6w82cffvihevfurby8PLVu3fqE9SoqKlRRUeFcP3p7WnFxMXddAQDgI0pKShQWFlbj39+mB51j9enTR61bt9ZLL7103GtlZWU
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"\n",
|
|||
|
"# Ваши данные\n",
|
|||
|
"Z = [-0.446584790913,6.86355998091,-1.76549845667,5.03261621241,2.83657823695,6.06844310176,6.13086503711,4.17390545601,9.24916448539,-0.668637990896,-0.869061479559,1.2073522402,-2.59905331132,-3.15066996361,4.02603956288,-0.665513707286,-0.377684709386,-2.93039363693,4.72056537216,1.54982053201,5.98095784994,2.9929446293,0.612329479455,-6.0333756427,5.3457555361,-2.07350827026,2.39601300347,-1.87484187283,3.62588309108,-2.36085162266,1.73519617398,6.20173937204,4.15508334629,4.87722785335,-1.32340512765,3.8812159451,-3.10211663662,-5.19518153501,-0.754185890619,1.33735774207,-3.03086014735,-6.59518865247,-0.0254148054433,4.71219967908,-1.36632919482,-3.42555874305,2.17886985096,0.999733463673,3.55042506167,1.46306069171,3.89874897496,3.10189036997,2.51554468804,-6.23670951284,-0.245339464639,2.76444728454,6.20781237816,-1.47644507541,-0.326347021775,5.24313328217,2.11947271,2.37226182866,-3.46526085438,-5.52929531389,1.97220243579,3.46245202858,4.84235670059,-1.23933963676,2.52057481149,-3.00212447839,1.01018142082,-8.92849226343,-1.20749752954,2.78835380984,-6.10788648726,4.96482421185,1.39783588053,1.43471543386,0.108448798888,2.41109062292,1.86552796086,2.70011301324,-1.26749119379,5.48339911606,-6.63196208972,-3.65267252051,1.23120361376,-0.812317415883,5.35009949318,-0.206368872157,0.0621515314538,-4.43688663449,-0.484832607861,-0.21889229213,-1.07761966901,0.999879814614,0.934924542726,3.88878652167,5.13533831695,3.51653737604,7.07288832585,-2.91857230865,2.75097807206,-4.22942642976,7.06802251868,4.42472519565,-2.12882388479,3.02644722611,0.276600891445,8.61353400882,-2.38378393337,-0.301650838815,-3.12053854458,6.70014649829,3.20443817138,-8.13704475284,2.29492465761,-5.77033086202,6.70240591701,1.27619637614,0.121054514359,0.476461293517,5.77845530964,-0.00886636038868,-2.57060370512,-0.946499440958,-0.260366692556,-5.28553951728,3.45387946052,-5.60934099704,-6.2113232549,-6.26593335795,2.84569941765,1.1621565758,2.58092233426,1.15570798649,4.97641233382,4.67773082083,-0.175952263047,3.92783781409,-4.42600849076,0.798322329752,-3.25618449742,-0.21042582753,8.52487591151,3.15413018799,-2.90445422243,11.4389077107,3.84812593057,2.74841304152,3.28887366301,0.413641831907,5.84333440683,1.81270008983,-3.27684147132,-5.55995520912,-2.8902012445,0.127438016975,-2.68727936377,1.60533019764,-2.84242889149,-3.40727990249,5.48637822522,5.67721879508,2.28348393701,4.82906495104,0.865144277335,-4.11226219478,0.816534973486,5.98258079178,3.00456216818,6.96201245375,5.38320423149,3.64206813965,-3.25667030846,2.28922188272,10.4362170536,-0.00846385757209,1.44867516102,-5.02054399297,-0.679656172104,0.313740873016,-2.46767358101,8.4406691847,5.81084876898,2.5584796121,-0.61910348737,-1.60200738241,0.711265765542,0.062322878034,5.35252488596,-1.32395121384,4.43881843719,3.0418197787,3.69401512845,8.33910525837,8.75742938344,0.266181712928,0.179777088018,-4.24193710422]\n",
|
|||
|
"X = [5,7,7,10,12,14,6,13,13,11,11,7,15,12,12,12,7,11,10,11,11,11,10,3,12,6,10,10,7,11,8,12,3,7,12,7,4,13,11,7,9,15,9,9,12,11,10,9,11,3,12,8,9,13,14,9,14,8,8,8,8,11,13,8,11,16,5,17,7,20,8,10,8,8,7,12,16,13,11,9,7,11,13,13,6,12,7,7,8,8,6,15,11,14,7,11,6,5,7,6,15,8,10,7,10,12,8,13,13,15,11,11,9,14,9,11,8,14,14,7,10,15,10,10,7,7,9,13,11,15,11,13,16,9,5,10,6,9,3,10,11,5,5,13,13,9,12,12,11,9,10,10,8,5,8,8,10,9,12,5,11,16,13,11,11,13,12,10,7,13,2,17,6,6,13,9,7,12,18,8,8,12,15,12,17,8,6,16,6,11,10,8,14,7,6,9,10,10,6,9]\n",
|
|||
|
"Y = [4.41093280453,4.76071247375,-0.393406324096,0.710337606411,2.94606113427,3.70952523734,-0.486096917133,3.77529027862,-0.589344166252,3.11478162602,0.24661990083,-0.915774529541,0.399703831113,2.91793978566,-0.69544654109,3.27267215749,4.47216168913,4.65865652207,0.247328807254,3.51624463673,1.69539925023,4.29129601289,-0.905167045048,3.66880449721,2.66826478729,1.72408658984,-0.474366150145,4.30017803344,0.723794246009,2.17190233136,4.02755895643,0.286811556882,4.18262938414,-0.220165994296,3.352863608,4.9761845494,4.59798194177,1.15493570586,4.64232315781,2.21887426496,-0.689892280671,-0.633472220449,3.29695650974,3.19299683095,3.22126149067,1.05417370797,4.8877269806,4.17488377742,3.79297334692,0.915615946838,3.68066085636,4.86365613995,4.05814383861,-0.215404184641,0.327884892456,3.04987972974,1.43842296028,4.60185394116,2.85330341951,-0.635336415703,1.59737359502,-0.167871526532,-0.0497738748602,1.14150547377,0.785188184305,1.35533529388,-0.922779683276,2.09561901957,4.29288768076,-0.151515060316,0.825609684893,2.99285074846,4.2611558854,-0.59464253544,1.54872087441,4.93990509012,4.79434164053,2.83087395818,2.53291065201,0.732676975238,1.73556553328,-0.713525006439,4.73682716786,4.18726205307,2.17803334454,4.71912436028,2.45093367292,2.1558538494,0.458287929479,4.71724401256,-0.878379838021,0.074387093037,4.68066009183,2.49795497609,1.02438203961,2.94726228088,1.68902213695,4.46007425031,1.93315589528,1.73326355448,2.23665281743,1.9517866833,3.47314680793,4.3177191615,0.20553857212,0.925922986957,2.99658172896,2.22553897893,0.380133519451,4.15676544423,4.18811755188,1.33351877297,4.77177697621,-0.768488835042,1.62410297311,3.81314513178,0.519835192383,3.87721432052,0.106483747667,0.532779693303,0.276857852209,2.08602624583,-0.742484487326,-0.819921224123,2.78360002012,4.38803114419,0.289857551121,1.470156411,2.92259484645,2.98859348375,3.46937648281,1.32120634383,1.34329769078,0.291254178334,-0.206497437231,0.204807702742,3.88345342089,0.245187883964,2.9095507131,0.371257415716,0.87264115291,1.04479290003,-0.0373568247459,0.0375370978293,3.12442127277,3.25161886846,0.581664284246,2.57768736997,4.67163737726,2.85890831369,1.88587397739,0.321999440891,-0.560951533272,0.0617857884422,-0.0466454210008,2.56269508285,3.80097691441,3.17453655958,4.7658451795,3.70753202886,-0.960907783569,2.08376568345,1.77041943087,-0.284687765208,1.34331018195,4.43162773046,1.32704280133,0.773023056715,-0.611673082162,3.57393195051,-0.223048153453,3.77743206482,1.40714290351,1.60962559327,-0.164117394868,4.03214654483,2.0065413409,2.98261145275,1.3603013495,-0.281928262179,-0.0251685620926,0.0971406083006,-0.871778773962,1.34066293226,1.96239295378,0.778269017198,1.67100071132,-0.119244135182,3.61390351274,2.06318939885,2.06748559444,0.41777138974,4.26936239329,1.22065940708,4.2935752377,4.67286242059,3.36957711741,0.240759403929,2.49367238667,2.20328875046]\n",
|
|||
|
"D = [2.29106893237,2.26403892097,6.2446633167,4.93176295377,7.09973553507,5.84190076275,2.91330742621,2.57308785442,5.6869144632,3.93707283059,3.93264067442,1.23962711663,5.92816588081,0.581310339931,2.49878223168,4.42584857266,3.49898148888,6.21364616744,3.25898170282,1.94131808365,2.96677343358,0.659741263411,3.86031145306,9.3666796951,8.24459611291,4.09220004134,5.37452862445,3.13882468173,4.11122173603,0.821461514186,1.68323605285,4.19761005136,3.95725973395,2.8609219217,2.68274392059,2.4003848785,4.26325289,2.5649356191,3.43856907433,-0.538190802425,1.75420235677,7.71678561833,0.798787047917,2.4360008161,4.73973356807,6.82361363062,4.39184490587,4.3084153142,6.386130936,6.62243894369,6.45107547269,1.5908026934,4.21369497931,4.22386242803,2.04668932594,6.16359705613,3.00290165295,5.36868575955,5.45289249694,5.25748441637,0.854327294099,2.98104069695,-0.906781451662,6.01869463603,6.39252059987,5.32627669441,3.08171241758,1.55856342896,4.25735001619,4.58761357451,4.06579591448,5.16454770286,5.68891593981,3.57863598436,4.56023660632,3.25232371118,5.77108364008,2.03424375966,4.12033429679,5.30654271053,3.60168565262,4.00852550948,3.87609131575,4.92368031545,2.47706932781,4.12559834465,3.83740051376,6.19007173018,5.54866779539,3.85911984464,5.78379334795,2.6106290677,3.70107333278,4.4480199468,2.80946277543,3.91595268754,3.69526841579,5.08263234991,2.83853013513,4.56256981337,-0.0990200850857,5.49396138122,3.81375229905,6.02800623977,5.04723833063,5.19108977244,4.93166811013,3.94996447786,2.09122440706,5.58352321149,1.76235444754,0.687902390455,9.40034597862,3.90031851624,4.66853453111,3.95885204015,4.67091515234,2.65800659385,2.46596735383,6.01718943957,2.23501287594,4.34057052755,4.47605810844,3.6169140101,5.07961062785,3.9313569109,3.10307345473,3.14798092339,3.99360992117,3.15387309597,5.08153540746,4.93200276959,3.13595577552,4.7898447788,3.58858222531,0.849263712182,2.72882701337,5.25185003134,4.97964627689,1.82587131482,4.98551578131,0.291661479713,4.71002970446,3.6719721177,3.39311964905,2.44986199694,3.07573083838,2.81492940053,4.87307626853,3.9604570183,1.13029273173,4.82053698751,1.32654701727,7.84993225841,4.12777568255,3.40927235632,5.79027259845,0.802078248036,4.12200287544,2.44315413193,5.95786851881,2.24412800208,6.70453282764,2.86035816443,5.82231338817,4.2488210453,2.2595308785,5.09681669192,2.3652351624,4.42603453088,3.42992742979,4.91407089281,4.69591396749,3.31654416171,8.03286461231,6.06914894206,2.95791637169,2.91747025301,4.30917748622,3.2359712866,5.16293255691,6.20587331612,0.193329476264,3.47222227364,4.01633869097,4.4995946619,4.46669620218,-3.16290716318,5.92328009802,5.53693447068,2.82024823135,4.24260693696,3.15279329672,-0.575154108122,4.4948177318,2.6877013137,3.38441889758,1.29226692427,5.42852280974,4.86122623556]\n",
|
|||
|
"\n",
|
|||
|
"# Построение гистограммы\n",
|
|||
|
"plt.hist(D, bins=20, color='skyblue', edgecolor='black')\n",
|
|||
|
"plt.title('Histogram of D')\n",
|
|||
|
"plt.xlabel('Value')\n",
|
|||
|
"plt.ylabel('Frequency')\n",
|
|||
|
"plt.show()\n",
|
|||
|
"\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 8,
|
|||
|
"id": "3aca64d7-8567-4041-a15c-b3b9ae2194bc",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<function matplotlib.pyplot.show(close=None, block=None)>"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 8,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
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HyhBAejTTz/F29s7x66y/2rVqhXz5s0jMjKSmTNnEh0dza233sq5c+dyvWbSpEmYzeasV3BwsL3LFxERKV0MAz7+2Dqh4XffgasrjBkD27dDx46Oru6aTIZhXMea9fZjMplYuHAhPXv2zPF4vXr16Ny5M9OmTbPpvgkJCVSvXp0pU6bk2nqUlpZGWlpa1nZSUhLBwcEkJibi4+Nj0/uJiIiUevv3w8CBsGKFdbt5c2uLT5MmDi0rKSkJs9mcr+/vEjE6+M8//2Tv3r188803Nl/r6+vLjTfeyP79+3M9x8PDAw8Pj+spUUREpPTLyLAuWjphAqSmQtmy1ie9nn0WStgDRyWiC+yjjz6iefPmNG7c2OZrk5OTOXDgAEFBQYVQmYiIiJPYvBlatrR2c6WmQqdOsGMHPP98iQs/4OAAlJyczNatW9m6dSsA0dHRbN26Ndug5aSkJL777jv69++f4z3uuOMOPvjgg6ztUaNGsWrVKg4dOsTatWu59957cXV1pVevXoX6u4iIiDhCpsVg3YEzLNp6jHUHzpBpMWw6fs1zz5+HF16whp+tW60Dm+fNgyVL4BpPZRdnDo1smzZtouN/BkqNHDkSgD59+jBv3jwAvv76awzDyDXAHDhwgNOnT2dtHz16lF69enHmzBkqV67MLbfcwvr166lcuXLh/SIiIiIOELkjlojFu4hNvLziepDZk/AeoYQ1DLrm8Wvd6+5TO5m8ZAZeRw9bdzzyCEydap3fp4QrNoOgixNbBlGJiIg
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjUAAAGwCAYAAABRgJRuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAABYmklEQVR4nO3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DQo1IiIi9vnnH+jQAVasMNtt2pib6hUvnuOl2BtUsjLU48rgcfpixs/NyvtupOEnERGRm/n+e/PcphUrICgIJk82z3JyU6CxZ2goq0M9rgwexQsGOvV9N1KoERERyUhcnLmy6emn4fx5qFsXtm+HV14xjz3IhszmuWT0miNBxZEel+u5MnjUjwijVGggGX1zFswep/oRYQ4/GzT8JCIikr5168ydgY8eBR8feOstGDQI/PzSfXt6c1yAdOe9ZDZ8BGT4Wmh+f7uDSlZ7XK4Fj1OxV9INTxagZBaDh6+PhcFtqtJ15jYskOr514LO4DZVs7xsXKFGRETkOtbEJKL7DOSWSWOw2GwY5cuze8QEDt1ai+LH4tINK+cTknj/l9RBpFCQGX4uXLqacq1UaCAP1yrFF2uOpDvP5dWZ29Kt6drQUqe7y9v1Z7hWlz1ufJ+rg0fL6qX4vF1kmuBW0gnLxS2GYWRt3ZQHiouLIzQ0lNjYWEJCQtxdjoiI5DJrFq6j6KsvUfXEfgDmVm/G0PtfJc4/KOU96YWVnGABChfwIybh5p87u3MD6keE0WjEypv2uKx7s5lTVk0
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkIAAAGwCAYAAABFFQqPAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAABoeElEQVR4nO3dd1hW9f/H8efNBhUUF5ioOHLvbeU2ydGyZZojszI3NrQsV0ZljnK3tDSzZfp1hDP3zI0rB44UXCgIyrrv8/vj/nEnsZXN63FdXJfnnM8591ssefk5n2EyDMNAREREpACyy+kCRERERHKKgpCIiIgUWApCIiIiUmApCImIiEiBpSAkIiIiBZaC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k9Qen9+a9aYiIhIPpAouBR2punGZdgNHwaRkUQ5uTK+7Sv8VOdR27pAYJ0Ob8K6NlCHGl6Jgo69nSnfTJFPjYKQiIhIHpFSL01gUAjjlh8lJDya4lE3+ThwOnandgEQ0agZnRu+woWiXsk+Mz+uDZQRCkIiIiK5THKBZ+3RUFvYSeDt4cLjdb35cnMwBtDh5E4CAqdT4nY4sXYOTGnZk/ihw7mw80Kan5mf1gbKCAUhERGRXOTu3p0ERd0cuXk7LknbkPBo5m4OpnDMbT5Y/yXPHV4HwLGSFRjeZQQnSvlS7HBouj43P60NlBEKQiIiIjnkvz0/N6JiGbhoH/+dxZRcCErQ9PxhJq+cStmIK1gw8WXTp5nycE9iHRwBCIuKw7OQEzeiYpM8F6xjhLzy2dpAGaEgJCIikgOS6/m
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjUAAAG1CAYAAAABTQXdAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAABaWUlEQVR4nO3deZzNdd/H8deZfYyZYTAzZDDW7Pu+DEWklBZthOoqtxRSWVoslUSSK4TqyhLRoohKUfadsWRfZkTMNDTMmGG2c373H+eacxlmOGfMds68n4+Hx+38zu/3PR/HfTVv39VkGIaBiIiIiJNzK+wCRERERPKCQo2IiIi4BIUaERERcQkKNSIiIuISFGpERETEJSjUiIiIiEtQqBERERGXoFAjIiIiLkGhRkRERFyCQo2IiIi4hCITatavX0+PHj2oUKECJpOJpUuXZnnfMAxGjx5N+fLl8fX1pXPnzhw7dqxwihUREZEip8iEmuTkZBo2bMiMGTOyfX/SpEl89NFHz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SdZjDK5csd7Qo4d1EnC9enlftBNRqBERESkg9m6eN+OJJrj9dwdh2yTgtFSYPNkaXi5csN7Ypg1MnAjt2uVj1c5DoUZERKSAZJ6cHZuQku2hlJnzZlpVK/O/YSazGebNhdGj4a+/rNfq1IEJE6w9NC66PDs3nGZHYREREWfn0MnZhgHLlkGDBvD009ZAExYGc+bAvn1w330KNNdQqBERESlANz05u1552LDBOqTUsyccPAilS1u
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from statsmodels.graphics.gofplots import qqplot\n",
|
|||
|
"from matplotlib import pyplot\n",
|
|||
|
"qqplot(df[\"X\"], line='s')\n",
|
|||
|
"qqplot(df[\"Y\"], line='s')\n",
|
|||
|
"qqplot(df[\"Z\"], line='s')\n",
|
|||
|
"qqplot(df[\"D\"], line='s')\n",
|
|||
|
"pyplot.show"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 16,
|
|||
|
"id": "0edc209a-7eff-4b7f-8b72-7388dd8e9a68",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkAAAAHHCAYAAABXx+fLAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAABFUUlEQVR4nO3dfVwVdd7/8fcBBAQUbxDwDsGbvEkDRWGxNqzYsGyTLDQvSyS1m5VSSXfTNWzXWtLSC0uTda9V8ypXs9JtzSyW0kotE7SyzLtUXF1ArlQSFAzm94c/TnvkoHC4OcC8no/HedT5zndmPjOHA29n5jtjMQzDEAAAgIm4OLsAAACAhkYAAgAApkMAAgAApkMAAgAApkMAAgAApkMAAgAApkMAAgAApkMAAgAApkMAAgAApkMAApxo2LBhGjZsmLPLaBbs7cu8vDzdd999at++vSwWi9LS0pxSW305duyYLBaLVq1aVe/rWrVqlSwWi44dO2ZtCw4O1l133VXv65akrVu3ymKxaOvWrQ2yPjR/BCCYxpEjR/TII4+oe/fu8vT0VOvWrXXjjTdq8eLFunDhQr2t99tvv9Uzzzxj84fDrCZMmCAfH58qp/v4+GjChAl1tr7p06fr/fff16xZs/S///u/Gj58eJ0tuz5YLBbry83NTe3atVN4eLimTp2qb7/9ts7W88orrzRIaHJEY64NzYuFZ4HBDN59913Fx8fLw8ND48ePV//+/VVaWqpPP/1Ub731liZMmKDly5fXy7rffPNNxcfH66OPPqp0hKK0tFSS5O7uXi/rbmwmTJigN998U+fPn7c73cfHR/fdd59DfwDt7cvAwEDFxMTotddec6jehmaxWPSrX/1K48ePl2EYOnfunL788kutX79eRUVFmj9/vpKTk639DcNQSUmJWrRoIVdX12qvp3///vLz86vR0ZSysjJdunRJHh4eslgski4fAerfv782bdpU7eU4Wlt5eblKS0vl7u4uFxf+7Y7ac3N2AUB9O3r0qO6//35169ZNH374oTp27GidNmXKFB0+fFjvvvuuU2ozS/BpCPb2ZX5+vtq0aVNn67h48WK9/wG+7rrr9MADD9i0Pf/88/r1r3+tJ598Un369NGdd94p6XJg8vT0rLdaJKmoqEje3t5ydXWtUciqay4uLvW+rTAXYjSavQULFuj8+fP661//ahN+KvTs2VNTp061vv/pp580b9489ejRQx4eHgoODtbs2bNVUlJiM1/F9Q+ffvqpIiIi5Onpqe7du2v16tXWPqtWrVJ8fLwk6ZZbbrGe3qj41+2V161UXOfwxhtv6LnnnlOXLl3k6emp2267TYcPH660fnuni+xdC5Ofn6+JEycqICBAnp6eCg0N1auvvmrTp6prLOxdZ5Kbm6vExER16dJFHh4e6tixo0aOHFnnp/kqrjvZvn27kpOT1aFDB3l7e+uee+7R6dOnbfr+53ZXzGcYhpYuXWrd7xW+//57xcfHq127dvLy8tIvfvGLSiG4Yn+sXbtWc+bMUefOneXl5aXCwkLrqbycnBzddddd8vHxUefOnbV06VJJ0tdff61bb71V3t7e6tatm9asWVOr/dC+fXutXbtWbm5ueu6556ztjnw2wcHB+uabb7Rt2zbrfrlyv23btk2/+c1v5O/vry5duthMs/cZf/DBBwoLC5Onp6f69eunt99+22b6M888Y7P/K1y5zKvVVtXP5/r16xUeHq6WLVvKz89PDzzwgE6ePGnTp+LzOnnypOLi4uTj46MOHTpoxowZKisru8beR3PFESA0e//4xz/UvXt3DR06tFr9J02apFdffVX33XefnnzySX3++edKTU3V/v37tWHDBpu+hw8f1n333aeJEycqISFBK1as0IQJExQeHq7rr79eN998s5544gm99NJLmj17tvr27StJ1v9W5fnnn5eLi4tmzJihc+fOacGCBRo3bpw+//zzGm//hQsXNGzYMB0+fFhJSUkKCQnR+vXrNWHCBJ09e9Ym/FXXvffeq2+++UaPP/64goODlZ+fr4yMDOXk5Cg4OLjGy7uWxx9/XG3bttXcuXN17NgxpaWlKSkpSevWrbPb/+abb9b//u//6sEHH7SeUqqQl5enoUOHqri4WE888YTat2+vV199VXfffbfefPNN3XPPPTbLmjdvntzd3TVjxgyVlJRYjzSVlZXpjjvu0M0336wFCxbo9ddfV1JSkry9vfX73/9e48aN06hRo5Senq7x48crKipKISEhDu+DoKAgRUdH66OPPlJhYaFat25tt9+1Ppu0tDQ9/vjj8vHx0e9//3tJUkBAgM0yfvOb36hDhw5KSUlRUVHRVes6dOiQxowZo0cffVQJCQlauXKl4uPjtWXLFv3qV7+q0TZWp7b/tGrVKiUmJmrIkCFKTU1VXl6eFi9erO3bt2vPnj02R//KysoUGxuryMhIvfjii/rnP/+phQsXqkePHnrsscdqVCeaCQNoxs6dO2dIMkaOHFmt/nv37jUkGZMmTbJpnzFjhiHJ+PDDD61t3bp1MyQZH3/8sbUtPz/f8PDwMJ588klr2/r16w1JxkcffVRpfdHR0UZ0dLT1/UcffWRIMvr27Wu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3R9ieqv6VbNTy7hLVWW5VNTp6UWdNljdt2jQdPHhQqamp8vT01NNPP62+fftqz549V12Hp6enSkpK7O4fwzB08eJFuyN96ms/V0dVR3+qqqk+a923b59cXV2vGlAc/Wz+U1Xb7Ki6/ll1hDNHsKFxIgCh2bvrrrt05MgR7dy585p9u3XrpvLych06dMimPS8vT2fPnlW3bt1qvP7qhqmaatu2rc6ePVup/cp/+Xbr1k2HDh1SeXm5Tft3331nnV6xPEmVllnVEaIePXroySef1AcffKB9+/aptLRUCxcuvGrN3bp1008//aQjR45Umnb48GGVlZU5tI9rolu
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"import numpy as np\n",
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"\n",
|
|||
|
"# Параметры равномерного распределения\n",
|
|||
|
"a = 0 # Нижний предел интервала\n",
|
|||
|
"b = 10 # Верхний предел интервала\n",
|
|||
|
"\n",
|
|||
|
"# Генерируем 1000 случайных чисел из равномерного распределения\n",
|
|||
|
"data = np.random.uniform(a, b, 1000)\n",
|
|||
|
"\n",
|
|||
|
"# Построение гистограммы\n",
|
|||
|
"plt.hist(data, bins=30, density=True, color='skyblue', edgecolor='black')\n",
|
|||
|
"\n",
|
|||
|
"# Построение графика плотности вероятности\n",
|
|||
|
"x = np.linspace(a, b, 1000)\n",
|
|||
|
"plt.plot(x, np.ones_like(x) / (b - a), color='red', lw=2, label='PDF')\n",
|
|||
|
"\n",
|
|||
|
"plt.title('Continuous Uniform Distribution')\n",
|
|||
|
"plt.xlabel('Value')\n",
|
|||
|
"plt.ylabel('Density')\n",
|
|||
|
"plt.legend()\n",
|
|||
|
"plt.show()\n",
|
|||
|
"\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 17,
|
|||
|
"id": "9e27516d-3e0c-4140-8a64-1ac251308050",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/H5lhTAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA3f0lEQVR4nO3deVxVdeL/8fdFBVFwQTYtUFJKzC01y6VccrK0RtPRFilQynJcU2uyLNNM0tJozK3J0KbFtFxmpnFhyKwxc18qCZfM65LYzQUFBeSe3x99vb+5AiqXC4eDr+fjcR/TPfd8zn3fIyNvz/2cc2yGYRgCAACwIB+zAwAAAHiKIgMAACyLIgMAACyLIgMAACyLIgMAACyLIgMAACyLIgMAACyLIgMAACyLIgMAACyLIgN4QYMGDRQfH292jArv9ddf1w033KBKlSqpZcuWZscxjc1m08svv2x2DKBcoMgAl1iwYIFsNpu2bNlS6OudO3dW06ZNS/w+//73v/llVAxr1qzRs88+qw4dOig5OVlTpkwpct34+HjZbDY1b95chd2FxWazadiwYaUZ13Q///yzbDab61GlShUFBwerffv2ev7552W32z3e9tGjR/Xyyy9rx44d3gsMeKiy2QGAiiA9PV0+PsX7d8G///1vzZo1izJzlb744gv5+Pho/vz58vX1vaox3333nZYuXaq+ffuWcrry6+GHH1aPHj3kdDp18uRJbd68WUlJSXrrrbc0f/58PfTQQ8Xe5tGjRzVx4kQ1aNDgmj4yhvKBIgN4gZ+fn9kRii0rK0vVq1c3O8ZVO378uPz9/a+6xPj7+ysiIkKTJk1Snz59ZLPZSiXXhQsX5HQ6rzpXWWvVqpViY2Pdlh08eFB333234uLiFBMToxYtWpiUDig5vloCvODSOTJ5eXmaOHGioqOjVbVqVdWpU0cdO3ZUSkqKpN+/+pg1a5YkuR3+vygrK0tjxoxRRESE/Pz8dNNNN+mN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JzREdHFzjz7NJ9flFh+/GikuyfhQsXqnnz5q55VSEhIfr8888L/XPwhrNnz0qS62fN6XTqzTffVHR0tPz8/BQcHKyQkBDt2rXrqjPY7XbFx8crKChIAQEBCgkJUadOnSQV/vMElBRFBigFd955p/bv36/33ntPTZs21bvvvqtWrVq55neY5X//tXxR//799be//U1PPfWUli5dqjVr1riO9jidzgLrV6pU6aqWSSryCMilSuuMoosGDBigRo0aXfaoTHEUth8v8nT/fPDBB4qPj1fDhg01f/58rVq1SikpKeratWuhfw7e8P333ys0NFQ1atSQJE2ZMkWjR4/WnXfeqQ8++ECrV69WSkqKbr755qvKkJ+frz/84Q/6/PPP9Ze//EXLly9XSkqKayJwaX0OXNuY7AuUkqCgIA0cOFADBw7U2bNndeedd+rll192ffVQ1C/v+vXr6z//+Y/OnDnjdlTmxx9/dL1+8X+dTqcOHDig6Oho13r79u276ownT55UamqqJk6cqJdeesm13JOvxDxx8TPs3bvXdfRDkjIyMnTq1CnXZy2pi0dl4uPjtWLFikJz7Nq1S06n0+2ozKX7vDR9+umnuuGGG7R06VK3n40JEyaUyvtt2LBB+/fvdzs1+9NPP1WXLl00f/58t3VPnTrldkSpqJ/d7777Tnv27NHChQv12GOPuZb/74RiwNs4IgOUgktPXQ4ICFCjRo3cTim+eA2XU6dOua3bo0cP5efn6+2333Zb/uabb8pms+nee++VJHXv3l2SNHv2bLf1Zs6cedU5Lx4puPQoRVJS0lVvoyR69OhR6PvNmDFDki57BlZxxcbGqlGjRpo4cWK
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 640x480 with 1 Axes>"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"import numpy as np\n",
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"\n",
|
|||
|
"# Смоделируем данные с нормальным распределением\n",
|
|||
|
"mean = 0 # Среднее значение\n",
|
|||
|
"std_dev = 1 # Стандартное отклонение\n",
|
|||
|
"data = np.random.normal(loc=mean, scale=std_dev, size=1000)\n",
|
|||
|
"\n",
|
|||
|
"# Построим гистограмму\n",
|
|||
|
"plt.hist(data, bins=30, color='skyblue', edgecolor='black')\n",
|
|||
|
"plt.title('Histogram of Normal Data')\n",
|
|||
|
"plt.xlabel('Value')\n",
|
|||
|
"plt.ylabel('Frequency')\n",
|
|||
|
"plt.show()\n",
|
|||
|
"\n",
|
|||
|
"\n",
|
|||
|
"\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": null,
|
|||
|
"id": "65f4eeea-c2fd-49dd-892e-cdeb0692c898",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": null,
|
|||
|
"id": "ca2d8c11-a9ad-490c-b9d8-891eac98e625",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 45,
|
|||
|
"id": "428a63c3-b1ab-49a5-aafd-4d0a7ded8f59",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Критерий Уилкоксона:\n",
|
|||
|
"Статистика: 15.0\n",
|
|||
|
"p-значение: 1.7998606112922388e-34\n",
|
|||
|
"Отвергаем гипотезу о равенстве медиан\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy.stats import wilcoxon\n",
|
|||
|
"\n",
|
|||
|
"X = df[\"X\"]\n",
|
|||
|
"Y = df[\"Y\"]\n",
|
|||
|
"# Проверка однородности массивов X и Y с помощью критерия Уилкоксона\n",
|
|||
|
"statistic, p_value = wilcoxon(X, Y)\n",
|
|||
|
"\n",
|
|||
|
"print(\"Критерий Уилкоксона:\")\n",
|
|||
|
"print(\"Статистика:\", statistic)\n",
|
|||
|
"print(\"p-значение:\", p_value)\n",
|
|||
|
"if p_value < 0.05:\n",
|
|||
|
" print(\"Отвергаем гипотезу о равенстве медиан\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Не можем отвергнуть гипотезу о равенстве медиан\")\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 46,
|
|||
|
"id": "0045955c-ba0e-4d97-93a0-9d1ee2a2427c",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Критерий Манна-Уитни:\n",
|
|||
|
"Статистика: 39604.0\n",
|
|||
|
"p-значение: 1.4768098049370635e-64\n",
|
|||
|
"Отвергаем гипотезу о равенстве распределений\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy.stats import mannwhitneyu\n",
|
|||
|
"\n",
|
|||
|
"# Проверка однородности массивов X и Y с помощью критерия Манна-Уитни\n",
|
|||
|
"statistic, p_value = mannwhitneyu(X, Y)\n",
|
|||
|
"\n",
|
|||
|
"print(\"Критерий Манна-Уитни:\")\n",
|
|||
|
"print(\"Статистика:\", statistic)\n",
|
|||
|
"print(\"p-значение:\", p_value)\n",
|
|||
|
"if p_value < 0.05:\n",
|
|||
|
" print(\"Отвергаем гипотезу о равенстве распределений\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Не можем отвергнуть гипотезу о равенстве распределений\")\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 47,
|
|||
|
"id": "d7b1e5f2-5a84-4e29-808a-ade7baf3e498",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Критерий Уилкоксона:\n",
|
|||
|
"Статистика: 16.95637977171405\n",
|
|||
|
"p-значение: 1.7266008845117972e-64\n",
|
|||
|
"Отвергаем гипотезу о равенстве распределений\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"from scipy.stats import ranksums\n",
|
|||
|
"\n",
|
|||
|
"# Проверка однородности массивов X и Y с помощью критерия Уилкоксона\n",
|
|||
|
"statistic, p_value = ranksums(X, Y)\n",
|
|||
|
"\n",
|
|||
|
"print(\"Критерий Уилкоксона:\")\n",
|
|||
|
"print(\"Статистика:\", statistic)\n",
|
|||
|
"print(\"p-значение:\", p_value)\n",
|
|||
|
"if p_value < 0.05:\n",
|
|||
|
" print(\"Отвергаем гипотезу о равенстве распределений\")\n",
|
|||
|
"else:\n",
|
|||
|
" print(\"Не можем отвергнуть гипотезу о равенстве распределений\")\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": null,
|
|||
|
"id": "d5777af6-31d9-4f90-a955-e0c14f85eb7b",
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": []
|
|||
|
}
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"kernelspec": {
|
|||
|
"display_name": "Python 3",
|
|||
|
"language": "python",
|
|||
|
"name": "python3"
|
|||
|
},
|
|||
|
"language_info": {
|
|||
|
"codemirror_mode": {
|
|||
|
"name": "ipython",
|
|||
|
"version": 3
|
|||
|
},
|
|||
|
"file_extension": ".py",
|
|||
|
"mimetype": "text/x-python",
|
|||
|
"name": "python",
|
|||
|
"nbconvert_exporter": "python",
|
|||
|
"pygments_lexer": "ipython3",
|
|||
|
"version": "3.9.13"
|
|||
|
}
|
|||
|
},
|
|||
|
"nbformat": 4,
|
|||
|
"nbformat_minor": 5
|
|||
|
}
|