{"id":355524,"date":"2024-05-20T23:10:30","date_gmt":"2024-05-20T23:10:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=355524"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=355524","title":{"rendered":"<span>\u0411\u0443\u0442\u0441\u0442\u0440\u0430\u043f: \u0448\u0432\u0435\u0439\u0446\u0430\u0440\u0441\u043a\u0438\u0439 \u043d\u043e\u0436 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u0432 A\/B-\u0442\u0435\u0441\u0442\u0430\u0445<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0430\u043c \u043d\u0430\u0434\u043e\u0435\u043b\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u0443\u044e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443, \u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043a \u0438\u043c\u0435\u044e\u0449\u0438\u043c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0431\u0435\u0441\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432?<br \/>\u0422\u043e\u0433\u0434\u0430 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u2014 \u044d\u0442\u043e \u0432\u0430\u0448 \u0432\u044b\u0431\u043e\u0440. \u041e\u043d \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u0438, \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0442\u0435\u043c, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u043a \u0448\u0438\u0440\u043e\u043a\u043e\u043c\u0443 \u0441\u043f\u0435\u043a\u0442\u0440\u0443 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0446\u0435\u043d\u043e\u043a.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9d7\/8fb\/b89\/9d78fbb8993163ca07db61a270ffb415.png\" width=\"404\" height=\"571\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9d7\/8fb\/b89\/9d78fbb8993163ca07db61a270ffb415.png\"\/><\/figure>\n<h2>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0411\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437 \u0432\u044b\u0431\u043e\u0440\u043e\u043a, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 A\/B-\u0442\u0435\u0441\u0442\u0430, \u043f\u0443\u0442\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043e\u0442\u0431\u043e\u0440\u0430 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0441\u0442\u0440\u043e\u0438\u0442\u044c <strong><em>\u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435<\/em> \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043b\u044e\u0431\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438\u00a0<\/strong>(\u043c\u0435\u0442\u0440\u0438\u043a\u0438)<strong>\u00a0<\/strong>\u0431\u0435\u0437 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445<strong> <\/strong>\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u0434\u0430\u043d\u043d\u044b\u043c. \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c\u00a0<em>\u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b<\/em>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f 60-\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f, \u0441\u0443\u043c\u043c\u044b \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c\u00a0<em>\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430<\/em> \u0434\u043b\u044f \u043c\u0435\u0434\u0438\u0430\u043d\u044b;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0439\u0442\u0438 p-value \u0434\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u043e\u0447\u043d\u043e\u0439\u00a0<em>ratio-\u043c\u0435\u0442\u0440\u0438\u043a\u0438\u00a0<\/em>\u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u043c\u0438, \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a CTR \u0438\u043b\u0438 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0447\u0435\u043a;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0441\u0442\u0438\u00a0<em>\u0430\u043d\u0430\u043b\u0438\u0437 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438\u00a0<\/em>\u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432 \u0432 A\/B-\u0442\u0435\u0441\u0442\u0435;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0432 \u043a\u0430\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u00a0<em>\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u043b \u044d\u0444\u0444\u0435\u043a<\/em>\u0442 \u043e\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<h4>\u2757\ufe0f\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f\u2757\ufe0f<\/h4>\n<p>\u0411\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f\u00a0<em>\u043f\u0440\u0438\u0442\u0432\u043e\u0440\u044f\u0442\u044c\u0441\u044f<\/em>\u00a0\u0433\u0435\u043d\u0435\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c\u044e. \u0418\u0434\u0435\u0439\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043a \u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a: \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u00ab\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432\u00bb \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0434\u043d\u043e\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b, \u0433\u0434\u0435 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e \u0432\u0441\u0435\u0439\u00a0<strong>\u00ab<\/strong>\u0433\u0435\u043d\u0435\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438<strong>\u00bb<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430. \u0414\u0430\u043d\u043d\u0430\u044f \u0438\u043b\u043b\u044e\u0437\u0438\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0435\u043c\u043f\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0442 \u043d\u043e\u0432\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0435 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442, \u0440\u0435\u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<br \/>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438\u00a0<em>\u0441\u0435\u043c\u043f\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u044a\u0435\u043c\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439.\u00a0<\/em>\u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0447\u043d\u0443\u044e \u043e\u0446\u0435\u043d\u043a\u0443 \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 (\u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0438) \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438, \u043a\u0430\u043a <em>standard error<\/em> \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0432 <strong>t-\u0442\u0435\u0441\u0442\u0435<\/strong>.<\/p>\n<p>\u041e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<ol>\n<li>\n<p>\u0412\u0437\u044f\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0443;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u00ab\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u00bb, \u043e\u0442\u0431\u0438\u0440\u0430\u044f \u0432 \u0431\u0443\u0442-\u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435\u043c;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0439\u0441\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0435\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043f\u0443\u043d\u043a\u0442\u044b 2 \u0438 3 \u043c\u043d\u043e\u0433\u043e-\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">import numpy as np import pandas as pd from scipy import stats import seaborn as sns import matplotlib.pyplot as plt   def bootstrap(sample, n_trials=5_000, statistic=np.median):     rng = np.random.default_rng()     stat_distrib = []      # get booted samples and count stat     for _ in range(n_trials):         boot_sample = rng.choice(sample, size=len(sample), replace=True)         stat_distrib.append(statistic(boot_sample))      result = do_some_math(stat_distrib)     do_some_viz(result, stat_distrib)     return result  def do_some_math(data):     pass  def do_some_viz(data):     pass<\/code><\/pre>\n<h2>\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430<\/h2>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043d\u0430\u0431\u043e\u0440 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0440\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0414\u0430\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1dc\/49f\/c85\/1dc49fc85665d0a6aabb11ba3671b46a.png\" alt=\"\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439\" title=\"\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439\" width=\"1484\" height=\"592\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1dc\/49f\/c85\/1dc49fc85665d0a6aabb11ba3671b46a.png\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/figcaption><\/div>\n<\/figure>\n<h3>1. \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 60-\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u043e\u0439 \u0441 \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0434\u043e\u0432\u0435\u0440\u0438\u044f 95%.<\/p>\n<pre><code class=\"python\">CONF_LVL = 0.95  def bootstrap_ci(sample, n_trials=5_000, statistic=np.median):     rng = np.random.default_rng()     stat_distrib = []      # get booted samples and count stat     for _ in range(n_trials):         boot_sample = rng.choice(sample, len(sample), replace=True)         stat_distrib.append(statistic(boot_sample))          result = do_some_math(stat_distrib)     do_some_viz(result, stat_distrib)     return result  def do_some_math(data):     # confidence interval counting     left_q = (1 - CONF_LVL) \/ 2     right_q = 1 - left_q     ci = np.quantile(data, [left_q, right_q])     return ci      def do_some_viz(res, data):     hist = plt.hist(data, bins=32, color='lightsalmon')     ymax = hist[0][np.argmax(hist[0])]     plt.vlines(np.mean(data), ymin=0, ymax=ymax, colors='black',                  label=f'Statistic mean: {np.mean(data).round(3)}')     plt.vlines(res, ymin=0, ymax=ymax\/\/2.5, linestyle='--', colors='black',                  label=f'CI: {res[0].round(3)} and {res[1].round(3)}')     plt.xlabel('statistic value', fontsize=14)     plt.ylabel('frequency', fontsize=14)     plt.legend(loc=0)     return None  def quant_60(data):     return np.quantile(data, 0.6)  ci = bootstrap_ci(spendings, statistic=quant_60)<\/code><\/pre>\n<p>\u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438. \u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0438\u0437\u043a\u043e \u043a \u043e\u0446\u0435\u043d\u043a\u0435 60-\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f \u0432 \u043d\u0430\u0448\u0435\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2fc\/742\/8a8\/2fc7428a8867591494834752a6245bf8.png\" alt=\"\u042d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 60-\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f \u0442\u0440\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439\" title=\"\u042d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 60-\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f \u0442\u0440\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439\" width=\"1334\" height=\"570\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2fc\/742\/8a8\/2fc7428a8867591494834752a6245bf8.png\"\/><\/p>\n<div><figcaption>\u042d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 60-\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f \u0442\u0440\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0442\u0430\u043a\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043d\u0435\u0432\u043d\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0445 \u043c\u0435\u0442\u0440\u0438\u043a \u0441 \u0438\u0445 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 \u0414\u0418 \u0438\u043b\u0438 \u0434\u043b\u044f \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432\u0430\u0436\u043d\u043e\u0439 \u0431\u0438\u0437\u043d\u0435\u0441\u043e\u0432\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430, \u043e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u043d\u0435\u0433.<\/p>\n<h3>2. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435<\/h3>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u0430\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u0434\u043b\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0430 \u0434\u043b\u044f \u043c\u0435\u0434\u0438\u0430\u043d\u044b. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<pre><code class=\"python\">CONF_LVL = 0.95  def bootstrap_ab(s1, s2, n_trials=5_000, statistic=np.median):     rng = np.random.default_rng()     stat_distrib = []      for _ in range(n_trials):         boot_s1 = rng.choice(s1, len(s1))         boot_s2 = rng.choice(s2, len(s2))         stat_distrib.append(statistic(boot_s1) - statistic(boot_s2))          result = do_some_math(stat_distrib)     do_some_viz(result[1], stat_distrib)     return result  def do_some_math(data):     # confidence interval counting     left_q = (1 - CONF_LVL) \/ 2     right_q = 1 - left_q     ci = np.quantile(data, [left_q, right_q])          # p_value     quant = stats.norm.cdf(x=0, loc=np.mean(data), scale=np.std(data, ddof=1))     p_value = quant * 2 if 0 &lt; np.mean(data) else (1 - quant) * 2     return p_value, ci  p_value, ci = bootstrap_ab(spendings_t, spendings_c)<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0443\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0443\u0442-\u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0438\u0437 \u0434\u0432\u0443\u0445 \u00ab\u0433\u0435\u043d\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0435\u0439\u00bb, \u0442\u0435\u0441\u0442\u0430 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f. \u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043d\u043e\u0437\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a, \u043a \u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u00ab\u0426\u041f\u0422\u00bb.<br \/>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438\u00a0<em>p-value<\/em>\u00a0\u0434\u043b\u044f \u0434\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0434\u043e\u043b\u044e \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0431\u044b\u043b\u0430 \u0440\u0430\u0432\u043d\u0430\u00a0<strong>0<\/strong> \u0438 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u043c, \u0432 \u043a\u0430\u043a\u043e\u043c \u043a\u0432\u0430\u043d\u0442\u0438\u043b\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u00a0<strong>0,<\/strong>\u00a0\u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0445\u0432\u043e\u0441\u0442\u044b.<br \/>\u0422\u0430\u043a\u0436\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0414\u0418. \u0415\u0441\u043b\u0438\u00a0<strong>0\u00a0<\/strong>\u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0433\u0440\u0430\u043d\u0438\u0446 \u0414\u0418, \u0442\u043e \u043e\u0442\u0432\u0435\u0440\u0433\u0430\u0435\u043c \u043d\u0443\u043b\u0435\u0432\u0443\u044e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443\u00a0<em>H0<\/em>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2a8\/737\/503\/2a873750351f7e4324700b0020801381.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u043c\u0435\u0434\u0438\u0430\u043d\u044b\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u043c\u0435\u0434\u0438\u0430\u043d\u044b\" width=\"1476\" height=\"592\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2a8\/737\/503\/2a873750351f7e4324700b0020801381.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u043c\u0435\u0434\u0438\u0430\u043d\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u043e \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0430\u043f\u043f\u0430\u0440\u0430\u0442, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0441\u0435\u043c\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u0439\u00a0<strong>t-\u0442\u0435\u0441\u0442<\/strong>. \u0412 \u043d\u0435\u043c, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0426\u041f\u0422, \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0438\u043c\u0435\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043c\u0435\u0440\u0430 \u0448\u0443\u043c\u0430 (<em>standard error<\/em>) \u0438 \u043e\u0446\u0435\u043d\u043a\u0438 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/075\/bd5\/375\/075bd537505e4d078645b3cb337ce038.png\" alt=\"\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438 \u0433\u0440\u0430\u043d\u0438\u0446\u044b 95% \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0432 t-\u0442\u0435\u0441\u0442\u0435\" title=\"\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438 \u0433\u0440\u0430\u043d\u0438\u0446\u044b 95% \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0432 t-\u0442\u0435\u0441\u0442\u0435\" width=\"1214\" height=\"230\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/075\/bd5\/375\/075bd537505e4d078645b3cb337ce038.png\"\/><\/p>\n<div><figcaption>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438 \u0433\u0440\u0430\u043d\u0438\u0446\u044b 95% \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0432 t-\u0442\u0435\u0441\u0442\u0435<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a \u0432\u043e\u0442, \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0435 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 \u0447\u0442\u043e \u0438\u00a0<strong>t-\u0442\u0435\u0441\u0442<\/strong>. \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0442\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u043e\u0441\u0442\u043e\u043c \u043e\u0431\u044a\u0435\u043c\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u043d\u0430 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<em>\u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0442\u0440\u0430\u0442\u043d\u043e\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0435\u0439<\/em>\u00a0<strong>t-\u0442\u0435\u0441\u0442\u0430.\u00a0<\/strong>\u041e\u043d\u0438 \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e\u00a0<em>\u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c<\/em>, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435.<\/p>\n<p>\u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0438\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u0443\u0442-\u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u044a\u0435\u043c\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0435\u043c\u043f\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0431\u0443\u0442-\u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0432 25 \u0440\u0430\u0437, \u0442\u043e \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043d\u0438\u0446 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0441\u0443\u0437\u0438\u0442\u0441\u044f, \u0430 <em>standard deviation<\/em> \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 5 \u0440\u0430\u0437 \u043c\u0435\u043d\u044c\u0448\u0435 (\u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0433\u0440\u0443\u043f\u043f \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435) \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>standard error<\/em> \u0434\u043b\u044f <strong>t-\u0442\u0435\u0441\u0442\u0430<\/strong>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9da\/41e\/4b0\/9da41e4b0d135cb07f401ddc1f9fa2fc.png\" alt=\"\u0420\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043e\u0446\u0435\u043d\u043e\u043a \u0448\u0443\u043c\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043c\u0430 \u0431\u0443\u0442-\u0432\u044b\u0431\u043e\u0440\u043e\u043a\" title=\"\u0420\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043e\u0446\u0435\u043d\u043e\u043a \u0448\u0443\u043c\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043c\u0430 \u0431\u0443\u0442-\u0432\u044b\u0431\u043e\u0440\u043e\u043a\" width=\"1338\" height=\"368\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9da\/41e\/4b0\/9da41e4b0d135cb07f401ddc1f9fa2fc.png\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043e\u0446\u0435\u043d\u043e\u043a \u0448\u0443\u043c\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043c\u0430 \u0431\u0443\u0442-\u0432\u044b\u0431\u043e\u0440\u043e\u043a<\/figcaption><\/div>\n<\/figure>\n<h3>3. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 ratio-\u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0434\u0435\u043b\u0438\u043c \u0435\u0433\u043e \u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u0447\u0438\u0441\u043b\u043e \u0437\u0430\u043a\u0430\u0437\u043e\u0432, \u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0431\u0443\u0434\u0435\u0442\u00a0<em>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0447\u0435\u043a \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/em>, \u0442.\u0435. \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<br \/>\u041e\u0431\u044b\u0447\u043d\u043e \u0436\u0435\u00a0<em>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0447\u0435\u043a<\/em>\u00a0\u0432 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0443\u043c\u043c\u0430 \u0432\u0441\u0435\u0445 \u0442\u0440\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043d\u0430 \u0441\u0443\u043c\u043c\u0443 \u0432\u0441\u0435\u0445 \u0437\u0430\u043a\u0430\u0437\u043e\u0432. \u0422\u0430\u043a\u0438\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f ratio-\u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438, \u043a \u043d\u0438\u043c \u0435\u0449\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f <em>CTR<\/em>.<br \/>\u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0432\u043d\u0438\u0437\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0447\u0435\u043a\u0430 \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0447\u0435\u043a\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b5c\/9fc\/874\/b5c9fc8749bdda59036bc258d1fd901f.png\" alt=\"\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u044e\u0437\u0435\u0440\u043d\u043e\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0447\u0435\u043a\u0430 \u0432 \u0433\u0440\u0443\u043f\u043f\u0430\u0445\" title=\"\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u044e\u0437\u0435\u0440\u043d\u043e\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0447\u0435\u043a\u0430 \u0432 \u0433\u0440\u0443\u043f\u043f\u0430\u0445\" width=\"1398\" height=\"576\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b5c\/9fc\/874\/b5c9fc8749bdda59036bc258d1fd901f.png\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u044e\u0437\u0435\u0440\u043d\u043e\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0447\u0435\u043a\u0430 \u0432 \u0433\u0440\u0443\u043f\u043f\u0430\u0445<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u0443\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b ratio-\u043c\u0435\u0442\u0440\u0438\u043a \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0445 \u043e\u0446\u0435\u043d\u043a\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u00a0<strong>\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/strong>\u00a0\u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d. \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u0433\u0434\u0435 \u043e\u0434\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u044d\u0442\u043e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0447\u0435\u043a\u0430, \u0442\u043e \u0443\u0436\u0435 \u0432 \u043d\u0435\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442\u00a0<em>\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b<\/em>, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u043c\u043e\u0433 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043e\u0442\u0441\u044e\u0434\u0430 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c.<br \/>\u041d\u043e \u0438 \u0442\u0443\u0442 \u0434\u043b\u044f \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0430 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u0435\u0433\u0440\u0430\u0434.<\/p>\n<pre><code class=\"python\">def bootstrap_ratio(s1_num, s1_denom, s2_num, s2_denom, n_trials=5_000):     rng = np.random.default_rng()     stat_distrib = []      for _ in range(n_trials):         users_idx1 = rng.choice(np.arange(0, len(s1_num)), size=len(s1_num))         boot1_num = s1_num[users_idx1]         boot1_denom = s1_denom[users_idx1]         ratio1 = boot1_num.sum() \/ boot1_denom.sum()                  users_idx2 = rng.choice(np.arange(0, len(s2_num)), size=len(s2_num))         boot2_num = s2_num[users_idx2]         boot2_denom = s2_denom[users_idx2]         ratio2 = boot2_num.sum() \/ boot2_denom.sum()                  stat_distrib.append(ratio1 - ratio2)          result = do_some_math(stat_distrib)     do_some_viz(result[1], stat_distrib)     return result  p_value, ci = bootstrap_ratio(spending_t, n_check_t, spending_c, n_check_c)<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0434\u043e \u0441\u0435\u043c\u043f\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043e\u0442\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u0434\u043b\u044f \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044f (<em>numerator<\/em>) \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044f (<em>denominator<\/em>), \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438. \u041f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u044b \u2013 \u044d\u0442\u043e \u0443\u0436\u0435 \u044d\u0442\u0430\u043f \u0443\u0441\u0432\u043e\u0435\u043d\u043d\u044b\u0439.<br \/>\u0418\u0437 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0432\u043d\u0438\u0437\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0443\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u0443\u044e \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0447\u0435\u043a\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/433\/da7\/802\/433da78025f4e5213a61f8dedd50ecd9.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u0443\u0441\u0442\u0440\u0430\u043f\u0430 \u043d\u0430 ratio-\u043c\u0435\u0442\u0440\u0438\u043a\u0435\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u0443\u0441\u0442\u0440\u0430\u043f\u0430 \u043d\u0430 ratio-\u043c\u0435\u0442\u0440\u0438\u043a\u0435\" width=\"1462\" height=\"598\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/433\/da7\/802\/433da78025f4e5213a61f8dedd50ecd9.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u0443\u0441\u0442\u0440\u0430\u043f\u0430 \u043d\u0430 ratio-\u043c\u0435\u0442\u0440\u0438\u043a\u0435<\/figcaption><\/div>\n<\/figure>\n<h3>4. \u0410\u043d\u0430\u043b\u0438\u0437 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u041f\u043e\u0434 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u044e \u0442\u0435\u0441\u0442\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b\u00a0<em>H1<\/em>, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0435\u0440\u043d\u0430. \u041c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0433\u043e \u043e\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u0442\u0435\u0441\u0442\u0430 \u044d\u0442\u043e\u0442 \u044d\u0444\u0444\u0435\u043a\u0442 \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<br \/>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u00ab\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432\u00bb, \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0438 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043e\u043b\u044e \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u0438\u043d\u044f\u043b\u0438\u00a0<em>H1<\/em>\u00a0\u043f\u0440\u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u00a0<em>alpha<\/em>\u00a0\u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0442\u0435\u0441\u0442\u0430\u0445. \u0412\u043e\u0437\u044c\u043c\u0435\u043c\u00a0<strong>t-test<\/strong>,\u00a0<strong>mannwhitney<\/strong>\u00a0<strong>test<\/strong>\u00a0\u0438\u00a0<strong>bootstrap<\/strong>\u00a0<strong>\u043d\u0430 \u0441\u0440\u0435\u0434\u043d\u0438\u0445<\/strong>.<\/p>\n<pre><code class=\"python\">ALPHA = 0.05  def power_compute(s1, s2, n_trials=200):     rng = np.random.default_rng()     # dict for stattests' p_values     test = {'t': [], 'mw': [], 'btsp': []}          for _ in range(n_trials):         boot_s1 = rng.choice(s1, len(s1))         boot_s2 = rng.choice(s2, len(s2))                  test['t'].append(stats.ttest_ind(boot_s1, boot_s2)[1])         test['mw'].append(stats.mannwhitneyu(boot_s1, boot_s2)[1])         test['btsp'].append(bootstrap_ab(boot_s1, boot_s2,                                           n_trials=500, statistic=np.mean))          result = do_some_math(test)     do_some_viz(test)     return result  def do_some_math(test_dict):     power_dict = {}     for test in test_dict:         np_arr = np.array(test_dict[test])         power = len(np_arr[np_arr&lt;=ALPHA]) \/ len(np_arr)         power_dict[f'{test}_power'] = power     return power_dict   def do_some_viz(test_dict):     df = pd.DataFrame(test_dict)     df = df.melt(var_name='test', value_name='p_val')          sns.ecdfplot(data=df, x='p_val', hue='test')     plt.vlines(x=ALPHA, ymin=0, ymax=1, colors='black')     plt.xlabel('Alpha')     plt.ylabel('Power')     return None  power_dict = power_compute(spendings_c, spendings_t)<\/code><\/pre>\n<p>\u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f\u00a0<em>\u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u0443\u043c\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 (\u043d\u0430\u043a\u043e\u043f\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439) \u0433\u0440\u0430\u0444\u0438\u043a \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f<\/em>\u00a0(Empirical Cumulative Distribution Function). \u041a \u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043a \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0438\u043d\u044b \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e, \u0434\u0440\u0443\u0433 \u043d\u0430 \u0434\u0440\u0443\u0433\u0430. \u041e\u0434\u043d\u0430\u043a\u043e <em>ECDF<\/em> \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u0435\u043d, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u043d\u0435 \u0447\u0430\u0441\u0442\u043e\u0442\u044b, \u0430 \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u0430\u044f \u0434\u043e\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430\u00a0<em>p-value<\/em>\u00a0\u0431\u044b\u043b \u043d\u0438\u0436\u0435\u00a0<em>alpha. <\/em>\u0414\u043e\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0445 \u043d\u0430\u0441 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043b\u0438\u043d\u0438\u0438 \u0441 \u043b\u0438\u043d\u0438\u0435\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430.<br \/>\u0418\u0437 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u00a0<strong>t-\u0442\u0435\u0441\u0442\u0430<\/strong>\u00a0\u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u043a\u0430\u043a \u0434\u043b\u044f\u00a0<strong>\u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0430\u00a0\u043d\u0430 \u0441\u0440\u0435\u0434\u043d\u0438\u0445<\/strong> \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 80%.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9d8\/a43\/51b\/9d8a4351b582889333b42ba53074b2a6.png\" alt=\"ECDF \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439\" title=\"ECDF \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439\" width=\"2034\" height=\"526\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9d8\/a43\/51b\/9d8a4351b582889333b42ba53074b2a6.png\"\/><\/p>\n<div><figcaption>ECDF \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439<\/figcaption><\/div>\n<\/figure>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0434\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430.<br \/>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 A\/B-\u0442\u0435\u0441\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u043f\u0440\u043e\u043a\u0440\u0430\u0441\u0438\u043b\u0441\u044f \u0432 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443, \u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438, \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c\u00a0<em>H1\u00a0<\/em>\u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 50%, \u0447\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u043c\u043e c \u043f\u043e\u0434\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u043e\u043d\u0435\u0442\u043a\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ec2\/660\/46d\/ec266046ded6efeb6c61cf99e64dccd0.png\" width=\"1348\" height=\"586\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ec2\/660\/46d\/ec266046ded6efeb6c61cf99e64dccd0.png\"\/><\/p>\n<div><figcaption>\u041c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043f\u0440\u043e\u043a\u0440\u0430\u0441\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<h3>5. \u041f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044c \u0437\u0430 \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u0435\u043c<\/h3>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 A\/B-\u0442\u0435\u0441\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0441 \u043d\u0430\u0448\u0438\u043c\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c\u0438. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0431\u044b\u043b \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442, \u0438 \u0446\u0435\u043b\u0435\u0432\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u043a\u0430\u0445 \u0441\u0442\u0430\u0442\u0437\u043d\u0430\u0447\u0438\u043c\u043e \u0432\u044b\u0440\u043e\u0441\u043b\u0430, \u0430 \u043d\u0430 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u043d\u043e \u0441\u0435\u0440\u044b\u0439. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f\u00a0<strong>t-\u0442\u0435\u0441\u0442<\/strong>. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u0447\u0435\u043d\u044c \u0442\u0440\u0443\u0434\u043d\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u043c\u0438\u043c\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0438 \u0434\u043b\u044f \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0447\u0442\u043e \u043d\u0435\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0442\u0435\u0441\u0442 \u043a\u0440\u0430\u0441\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u044e 90%.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/50c\/6ab\/f42\/50c6abf42cc5c49f5900c472b09251b7.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\" width=\"1662\" height=\"584\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/50c\/6ab\/f42\/50c6abf42cc5c49f5900c472b09251b7.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0435\u0441\u0442 \u041c\u0430\u043d\u043d\u0430-\u0423\u0438\u0442\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0440\u0430\u043d\u0433\u0430\u043c\u0438, \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0430 \u00ab\u043f\u0440\u043e\u0431\u0435\u0436\u0430\u0442\u044c\u0441\u044f\u00bb \u043f\u043e \u0434\u0435\u0446\u0438\u043b\u044f\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f \u0438 \u043d\u0430\u0439\u0442\u0438, \u0433\u0434\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0440\u0430\u043d\u0433\u043e\u0432 (\u043f\u043e\u0437\u0438\u0446\u0438\u0439). \u0412 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u043d\u0438\u0436\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0432 \u043f\u0435\u0440\u0432\u044b\u0445 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0434\u0435\u0446\u0438\u043b\u044f\u0445.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dac\/b4a\/147\/dacb4a1476178632d0f66197e019f326.png\" width=\"1346\" height=\"592\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dac\/b4a\/147\/dacb4a1476178632d0f66197e019f326.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0434\u0435\u0446\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/figcaption><\/div>\n<\/figure>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>\u041f\u043e\u043d\u044f\u0442\u043e, \u0447\u0442\u043e \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u043f\u043b\u043e\u0445\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437-\u0437\u0430 \u0441\u0432\u043e\u0435\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 A\/B-\u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043d\u0430 \u043f\u043e\u0442\u043e\u043a, \u0438 \u0437\u0430 \u0440\u0430\u0437 \u043c\u043e\u0433\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0438 \u0441\u043e\u0442\u043d\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u044b\u0445 \u043c\u0435\u0442\u0440\u0438\u043a.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0438\u043b\u0438 \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0432 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u0445 \u0441\u0442\u0430\u0442\u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u00ab\u0441\u0442\u0443\u043a\u043d\u0443\u0442\u044c\u00bb \u043f\u043e \u0441\u0432\u043e\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u0433\u0440\u0443\u0431\u043e\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043b\u043a\u043e\u0439, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0434\u0430\u0442\u044c \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0443\u0441\u0432\u043e\u0438\u0442\u044c \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0438\u0434\u0435\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u043e\u0438\u0442 \u0437\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0431\u0443\u0441\u0442\u0440\u0430\u043f\u0430, \u0432\u0441\u0435 \u0437\u0430 \u044d\u0442\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0435\u0439 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0449\u0435\u0433\u043e \u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/762648\/\"> https:\/\/habr.com\/ru\/articles\/762648\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0430\u043c \u043d\u0430\u0434\u043e\u0435\u043b\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u0443\u044e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443, \u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043a \u0438\u043c\u0435\u044e\u0449\u0438\u043c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0431\u0435\u0441\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432?<br \/>\u0422\u043e\u0433\u0434\u0430 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u2014 \u044d\u0442\u043e \u0432\u0430\u0448 \u0432\u044b\u0431\u043e\u0440. \u041e\u043d \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u0438, \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0442\u0435\u043c, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u043a \u0448\u0438\u0440\u043e\u043a\u043e\u043c\u0443 \u0441\u043f\u0435\u043a\u0442\u0440\u0443 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0446\u0435\u043d\u043e\u043a.<\/p>\n<figure class=\"\"><\/figure>\n<h2>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0411\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437 \u0432\u044b\u0431\u043e\u0440\u043e\u043a, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 A\/B-\u0442\u0435\u0441\u0442\u0430, \u043f\u0443\u0442\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u043e\u0442\u0431\u043e\u0440\u0430 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0441\u0442\u0440\u043e\u0438\u0442\u044c <strong><em>\u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435<\/em> \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043b\u044e\u0431\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438\u00a0<\/strong>(\u043c\u0435\u0442\u0440\u0438\u043a\u0438)<strong>\u00a0<\/strong>\u0431\u0435\u0437 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445<strong> <\/strong>\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u0434\u0430\u043d\u043d\u044b\u043c. \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c\u00a0<em>\u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b<\/em>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f 60-\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f, \u0441\u0443\u043c\u043c\u044b \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c\u00a0<em>\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430<\/em> \u0434\u043b\u044f \u043c\u0435\u0434\u0438\u0430\u043d\u044b;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0439\u0442\u0438 p-value \u0434\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u043e\u0447\u043d\u043e\u0439\u00a0<em>ratio-\u043c\u0435\u0442\u0440\u0438\u043a\u0438\u00a0<\/em>\u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u043c\u0438, \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a CTR \u0438\u043b\u0438 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0447\u0435\u043a;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0441\u0442\u0438\u00a0<em>\u0430\u043d\u0430\u043b\u0438\u0437 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438\u00a0<\/em>\u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432 \u0432 A\/B-\u0442\u0435\u0441\u0442\u0435;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0432 \u043a\u0430\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u00a0<em>\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u043b \u044d\u0444\u0444\u0435\u043a<\/em>\u0442 \u043e\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<h4>\u2757\ufe0f\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f\u2757\ufe0f<\/h4>\n<p>\u0411\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f\u00a0<em>\u043f\u0440\u0438\u0442\u0432\u043e\u0440\u044f\u0442\u044c\u0441\u044f<\/em>\u00a0\u0433\u0435\u043d\u0435\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c\u044e. \u0418\u0434\u0435\u0439\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043a \u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a: \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u00ab\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432\u00bb \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0434\u043d\u043e\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b, \u0433\u0434\u0435 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e \u0432\u0441\u0435\u0439\u00a0<strong>\u00ab<\/strong>\u0433\u0435\u043d\u0435\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438<strong>\u00bb<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0430. \u0414\u0430\u043d\u043d\u0430\u044f \u0438\u043b\u043b\u044e\u0437\u0438\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0435\u043c\u043f\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0442 \u043d\u043e\u0432\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0435 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442, \u0440\u0435\u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<br \/>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438\u00a0<em>\u0441\u0435\u043c\u043f\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u044a\u0435\u043c\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439.\u00a0<\/em>\u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0447\u043d\u0443\u044e \u043e\u0446\u0435\u043d\u043a\u0443 \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 (\u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0438) \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438, \u043a\u0430\u043a <em>standard error<\/em> \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0432 <strong>t-\u0442\u0435\u0441\u0442\u0435<\/strong>.<\/p>\n<p>\u041e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<ol>\n<li>\n<p>\u0412\u0437\u044f\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0432\u044b\u0431\u043e\u0440\u043a\u0443;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u00ab\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u00bb, \u043e\u0442\u0431\u0438\u0440\u0430\u044f \u0432 \u0431\u0443\u0442-\u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435\u043c;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0439\u0441\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0435\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043f\u0443\u043d\u043a\u0442\u044b 2 \u0438 3 \u043c\u043d\u043e\u0433\u043e-\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e;<\/p>\n<\/li>\n<li>\n<p>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">import numpy as np import pandas as pd from scipy import stats import seaborn as sns import matplotlib.pyplot as plt   def bootstrap(sample, n_trials=5_000, statistic=np.median):     rng = np.random.default_rng()     stat_distrib = []      # get booted samples and count stat     for _ in range(n_trials):         boot_sample = rng.choice(sample, size=len(sample), replace=True)         stat_distrib.append(statistic(boot_sample))      result = do_some_math(stat_distrib)     do_some_viz(result, stat_distrib)     return result  def do_some_math(data):     pass  def do_some_viz(data):     pass<\/code><\/pre>\n<h2>\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430<\/h2>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043d\u0430\u0431\u043e\u0440 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0440\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0414\u0430\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/figcaption><\/div>\n<\/figure>\n<h3>1. \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 60-\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u043e\u0439 \u0441 \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0434\u043e\u0432\u0435\u0440\u0438\u044f 95%.<\/p>\n<pre><code class=\"python\">CONF_LVL = 0.95  def bootstrap_ci(sample, n_trials=5_000, statistic=np.median):     rng = np.random.default_rng()     stat_distrib = []      # get booted samples and count stat     for _ in range(n_trials):         boot_sample = rng.choice(sample, len(sample), replace=True)         stat_distrib.append(statistic(boot_sample))          result = do_some_math(stat_distrib)     do_some_viz(result, stat_distrib)     return result  def do_some_math(data):     # confidence interval counting     left_q = (1 - CONF_LVL) \/ 2     right_q = 1 - left_q     ci = np.quantile(data, [left_q, right_q])     return ci      def do_some_viz(res, data):     hist = plt.hist(data, bins=32, color='lightsalmon')     ymax = hist[0][np.argmax(hist[0])]     plt.vlines(np.mean(data), ymin=0, ymax=ymax, colors='black',                  label=f'Statistic mean: {np.mean(data).round(3)}')     plt.vlines(res, ymin=0, ymax=ymax\/\/2.5, linestyle='--', colors='black',                  label=f'CI: {res[0].round(3)} and {res[1].round(3)}')     plt.xlabel('statistic value', fontsize=14)     plt.ylabel('frequency', fontsize=14)     plt.legend(loc=0)     return None  def quant_60(data):     return np.quantile(data, 0.6)  ci = bootstrap_ci(spendings, statistic=quant_60)<\/code><\/pre>\n<p>\u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438. \u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0438\u0437\u043a\u043e \u043a \u043e\u0446\u0435\u043d\u043a\u0435 60-\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f \u0432 \u043d\u0430\u0448\u0435\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u042d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 60-\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f \u0442\u0440\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0442\u0430\u043a\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043d\u0435\u0432\u043d\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0445 \u043c\u0435\u0442\u0440\u0438\u043a \u0441 \u0438\u0445 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 \u0414\u0418 \u0438\u043b\u0438 \u0434\u043b\u044f \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432\u0430\u0436\u043d\u043e\u0439 \u0431\u0438\u0437\u043d\u0435\u0441\u043e\u0432\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430, \u043e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u043d\u0435\u0433.<\/p>\n<h3>2. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435<\/h3>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u0430\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u0434\u043b\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0430 \u0434\u043b\u044f \u043c\u0435\u0434\u0438\u0430\u043d\u044b. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<pre><code class=\"python\">CONF_LVL = 0.95  def bootstrap_ab(s1, s2, n_trials=5_000, statistic=np.median):     rng = np.random.default_rng()     stat_distrib = []      for _ in range(n_trials):         boot_s1 = rng.choice(s1, len(s1))         boot_s2 = rng.choice(s2, len(s2))         stat_distrib.append(statistic(boot_s1) - statistic(boot_s2))          result = do_some_math(stat_distrib)     do_some_viz(result[1], stat_distrib)     return result  def do_some_math(data):     # confidence interval counting     left_q = (1 - CONF_LVL) \/ 2     right_q = 1 - left_q     ci = np.quantile(data, [left_q, right_q])          # p_value     quant = stats.norm.cdf(x=0, loc=np.mean(data), scale=np.std(data, ddof=1))     p_value = quant * 2 if 0 &lt; np.mean(data) else (1 - quant) * 2     return p_value, ci  p_value, ci = bootstrap_ab(spendings_t, spendings_c)<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0443\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0443\u0442-\u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0438\u0437 \u0434\u0432\u0443\u0445 \u00ab\u0433\u0435\u043d\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0435\u0439\u00bb, \u0442\u0435\u0441\u0442\u0430 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f. \u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043d\u043e\u0437\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a, \u043a \u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u00ab\u0426\u041f\u0422\u00bb.<br \/>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438\u00a0<em>p-value<\/em>\u00a0\u0434\u043b\u044f \u0434\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0434\u043e\u043b\u044e \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0431\u044b\u043b\u0430 \u0440\u0430\u0432\u043d\u0430\u00a0<strong>0<\/strong> \u0438 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u043c, \u0432 \u043a\u0430\u043a\u043e\u043c \u043a\u0432\u0430\u043d\u0442\u0438\u043b\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u00a0<strong>0,<\/strong>\u00a0\u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0445\u0432\u043e\u0441\u0442\u044b.<br \/>\u0422\u0430\u043a\u0436\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0414\u0418. \u0415\u0441\u043b\u0438\u00a0<strong>0\u00a0<\/strong>\u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0433\u0440\u0430\u043d\u0438\u0446 \u0414\u0418, \u0442\u043e \u043e\u0442\u0432\u0435\u0440\u0433\u0430\u0435\u043c \u043d\u0443\u043b\u0435\u0432\u0443\u044e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443\u00a0<em>H0<\/em>.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u043c\u0435\u0434\u0438\u0430\u043d\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u043e \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0430\u043f\u043f\u0430\u0440\u0430\u0442, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0441\u0435\u043c\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u0439\u00a0<strong>t-\u0442\u0435\u0441\u0442<\/strong>. \u0412 \u043d\u0435\u043c, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0426\u041f\u0422, \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0438\u043c\u0435\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043c\u0435\u0440\u0430 \u0448\u0443\u043c\u0430 (<em>standard error<\/em>) \u0438 \u043e\u0446\u0435\u043d\u043a\u0438 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438 \u0433\u0440\u0430\u043d\u0438\u0446\u044b 95% \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u0432 t-\u0442\u0435\u0441\u0442\u0435<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a \u0432\u043e\u0442, \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0435 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 \u0447\u0442\u043e \u0438\u00a0<strong>t-\u0442\u0435\u0441\u0442<\/strong>. \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0442\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u043e\u0441\u0442\u043e\u043c \u043e\u0431\u044a\u0435\u043c\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f \u043d\u0430 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u00a0<em>\u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0442\u0440\u0430\u0442\u043d\u043e\u0439 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0435\u0439<\/em>\u00a0<strong>t-\u0442\u0435\u0441\u0442\u0430.\u00a0<\/strong>\u041e\u043d\u0438 \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0443\u044e\u00a0<em>\u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c<\/em>, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435.<\/p>\n<p>\u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0438\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u0443\u0442-\u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u044a\u0435\u043c\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0435\u043c\u043f\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0431\u0443\u0442-\u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0432 25 \u0440\u0430\u0437, \u0442\u043e \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043d\u0438\u0446 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0441\u0443\u0437\u0438\u0442\u0441\u044f, \u0430 <em>standard deviation<\/em> \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 5 \u0440\u0430\u0437 \u043c\u0435\u043d\u044c\u0448\u0435 (\u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0433\u0440\u0443\u043f\u043f \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435) \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>standard error<\/em> \u0434\u043b\u044f <strong>t-\u0442\u0435\u0441\u0442\u0430<\/strong>.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043e\u0446\u0435\u043d\u043e\u043a \u0448\u0443\u043c\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043c\u0430 \u0431\u0443\u0442-\u0432\u044b\u0431\u043e\u0440\u043e\u043a<\/figcaption><\/div>\n<\/figure>\n<h3>3. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 ratio-\u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0434\u0435\u043b\u0438\u043c \u0435\u0433\u043e \u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u0447\u0438\u0441\u043b\u043e \u0437\u0430\u043a\u0430\u0437\u043e\u0432, \u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0431\u0443\u0434\u0435\u0442\u00a0<em>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0447\u0435\u043a \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/em>, \u0442.\u0435. \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<br \/>\u041e\u0431\u044b\u0447\u043d\u043e \u0436\u0435\u00a0<em>\u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0447\u0435\u043a<\/em>\u00a0\u0432 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0443\u043c\u043c\u0430 \u0432\u0441\u0435\u0445 \u0442\u0440\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043d\u0430 \u0441\u0443\u043c\u043c\u0443 \u0432\u0441\u0435\u0445 \u0437\u0430\u043a\u0430\u0437\u043e\u0432. \u0422\u0430\u043a\u0438\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f ratio-\u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438, \u043a \u043d\u0438\u043c \u0435\u0449\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f <em>CTR<\/em>.<br \/>\u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0432\u043d\u0438\u0437\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0447\u0435\u043a\u0430 \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0447\u0435\u043a\u0430.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u044e\u0437\u0435\u0440\u043d\u043e\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0447\u0435\u043a\u0430 \u0432 \u0433\u0440\u0443\u043f\u043f\u0430\u0445<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u0443\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b ratio-\u043c\u0435\u0442\u0440\u0438\u043a \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0445 \u043e\u0446\u0435\u043d\u043a\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u00a0<strong>\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/strong>\u00a0\u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0432\u0435\u043b\u0438\u0447\u0438\u043d. \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u0433\u0434\u0435 \u043e\u0434\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u044d\u0442\u043e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0447\u0435\u043a\u0430, \u0442\u043e \u0443\u0436\u0435 \u0432 \u043d\u0435\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442\u00a0<em>\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b<\/em>, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u043c\u043e\u0433 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043e\u0442\u0441\u044e\u0434\u0430 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c.<br \/>\u041d\u043e \u0438 \u0442\u0443\u0442 \u0434\u043b\u044f \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0430 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u0435\u0433\u0440\u0430\u0434.<\/p>\n<pre><code class=\"python\">def bootstrap_ratio(s1_num, s1_denom, s2_num, s2_denom, n_trials=5_000):     rng = np.random.default_rng()     stat_distrib = []      for _ in range(n_trials):         users_idx1 = rng.choice(np.arange(0, len(s1_num)), size=len(s1_num))         boot1_num = s1_num[users_idx1]         boot1_denom = s1_denom[users_idx1]         ratio1 = boot1_num.sum() \/ boot1_denom.sum()                  users_idx2 = rng.choice(np.arange(0, len(s2_num)), size=len(s2_num))         boot2_num = s2_num[users_idx2]         boot2_denom = s2_denom[users_idx2]         ratio2 = boot2_num.sum() \/ boot2_denom.sum()                  stat_distrib.append(ratio1 - ratio2)          result = do_some_math(stat_distrib)     do_some_viz(result[1], stat_distrib)     return result  p_value, ci = bootstrap_ratio(spending_t, n_check_t, spending_c, n_check_c)<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0434\u043e \u0441\u0435\u043c\u043f\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043e\u0442\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u0434\u043b\u044f \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044f (<em>numerator<\/em>) \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044f (<em>denominator<\/em>), \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438. \u041f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u044b \u2013 \u044d\u0442\u043e \u0443\u0436\u0435 \u044d\u0442\u0430\u043f \u0443\u0441\u0432\u043e\u0435\u043d\u043d\u044b\u0439.<br \/>\u0418\u0437 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0432\u043d\u0438\u0437\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-355524","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/355524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=355524"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/355524\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=355524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=355524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=355524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}