{"id":437759,"date":"2024-11-07T21:22:11","date_gmt":"2024-11-07T21:22:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=437759"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=437759","title":{"rendered":"<span>\u041a\u043d\u0438\u0433\u0430: \u00abCausal Inference \u043d\u0430 Python. \u041f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0441\u0432\u044f\u0437\u0438 \u0432 IT-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435\u00bb<\/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-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/companies\/piter\/articles\/852440\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/0h\/ai\/bs\/0haibsbudnccp2lhbdx5o8frubw.jpeg\" align=\"left\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/0h\/ai\/bs\/0haibsbudnccp2lhbdx5o8frubw.jpeg\" data-blurred=\"true\"\/><\/a> \u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440\u043e\u0436\u0438\u0442\u0435\u043b\u0438!<\/p>\n<p> \u041f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0432\u0430\u0436\u043d\u0435\u0439\u0448\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0439 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u0443\u043a\u0438 \u043e \u0434\u0430\u043d\u043d\u044b\u0445 (data science), \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043e\u0440\u0438\u0435\u0439 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0431\u0435\u043b. \u041c\u0430\u0442\u0435\u0443\u0448 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043b\u0443\u0447\u0448\u0443\u044e \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u043a\u043d\u0438\u0433\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0447\u0438\u0442, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043e\u0442 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043a \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u043c \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u043c \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u0411\u043e\u043b\u044c\u0448\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0443\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044e, \u0430 \u043d\u0435 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430\u043c \u0438 \u0442\u0435\u043e\u0440\u0435\u043c\u0430\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430.<\/p>\n<p> \u0414\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0449\u0435\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043e\u0442\u043a\u0440\u044b\u043b\u0438 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u0442\u0440\u0430\u0441\u043b\u044f\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0435\u0449\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u0441\u0440\u0435\u0434\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0437\u0430 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0439.<a name=\"habracut\"><\/a><\/p>\n<h3>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u043a\u043d\u0438\u0433\u0438 \u0432\u044b:<\/h3>\n<p> <\/p>\n<ul>\n<li>\u0423\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 causal inference;<\/li>\n<li>\u0421\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445\/\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u0445 causal inference;<\/li>\n<li>\u041f\u043e\u0439\u043c\u0435\u0442\u0435, \u043a\u0430\u043a \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434\u044b \u043e causal inference;<\/li>\n<li>\u0423\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b causal inference \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f;<\/li>\n<li>\u0421\u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0437\u0430 \u043e\u0434\u043d\u0438\u043c\u0438 \u0438 \u0442\u0435\u043c\u0438 \u0436\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0439;<\/li>\n<li>\u0423\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445<\/li>\n<li>\u0418\u0437\u0443\u0447\u0438\u0442\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0438 \u0440\u0430\u0437\u043c\u044b\u0432\u0430\u043d\u0438\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0430.<\/li>\n<\/ul>\n<p> <\/p>\n<h3>\u0414\u043b\u044f \u043a\u043e\u0433\u043e \u044d\u0442\u0430 \u043a\u043d\u0438\u0433\u0430<\/h3>\n<p> \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440\u044b, \u043e\u0442\u0440\u0430\u0441\u043b\u0435\u0432\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u044b \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. <br \/> \u041a\u043d\u0438\u0433\u0430 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u0432\u043b\u0430\u0434\u0435\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u0439 \u043f\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c\u0443 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435 \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043d\u0430 Python.<\/p>\n<p> \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0432\u044b\u0445\u043e\u0434\u043e\u043c \u00abCausal Inference \u043d\u0430 Python\u00bb, \u043c\u044b \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043a\u043d\u0438\u0433\u0438 \u041c\u0430\u0442\u0435\u0443\u0448\u0430 \u0424\u0430\u043a\u0443\u0440\u0430 \u2013 \u00abCausal Inference for the Brave and True\u00bb. <\/p>\n<h2>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441 \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u043e\u043c: \u043c\u0435\u0442\u043e\u0434 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 Python<\/h2>\n<p> <\/p>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c?<\/h3>\n<p> \u041c\u0435\u0442\u043e\u0434 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u043a\u0430\u043a \u00ab\u0432\u0430\u0436\u043d\u0435\u0439\u0448\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u0438 \u043e\u0446\u0435\u043d\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0451\u043d\u043d\u0443\u044e \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u0435\u00bb (Atheyand Imbens 2016). \u0421\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u2014 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u0432 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435 \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0432 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u0435\u0439\u0441-\u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e \u0433\u0440\u0443\u043f\u043f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0437\u0430\u0442\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Treatment_group\">\u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430<\/a>. \u0422\u0430\u043a\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0446\u0435\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0431\u044b \u0441 \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u043e\u0439, \u0435\u0441\u043b\u0438 \u0431\u044b \u043a \u043d\u0435\u0439 \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b\u0438\u0441\u044c \u043c\u0435\u0440\u044b, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u0441\u0435\u0439\u0447\u0430\u0441. \u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u043b\u0435\u0436\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u043d\u043e \u043c\u043e\u0449\u043d\u0430\u044f \u0438\u0434\u0435\u044f, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u0430\u0442\u044c \u0432 \u043d\u0435\u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0431\u044b \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0442\u0435\u0445, \u043a\u0442\u043e \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443, \u0441\u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0432 \u0432 \u043d\u0435\u0439 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u00ab\u043d\u0435\u0442\u0440\u043e\u043d\u0443\u0442\u044b\u0445\u00bb \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0434\u043b\u044f \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f.<\/p>\n<p> \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0445 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Difference_in_differences\">\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0435\u0439<\/a>, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0447\u0435\u0441\u0442\u044c \u0438 \u0442\u0430\u043a\u043e\u0439 \u0444\u0430\u043a\u0442\u043e\u0440, \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0430 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Confounder\">\u0441\u043f\u0443\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u0432<\/a>, \u2014 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0442\u0451\u043c \u0432\u0437\u0432\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0435\u0449\u0451 \u0434\u043e \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0430 \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435. \u0415\u0449\u0451 \u043e\u0434\u043d\u043e \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u043e \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u044b \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f. \u041c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0432 \u043f\u043e\u043b\u0438\u0442\u043e\u043b\u043e\u0433\u0438\u0438, \u0437\u0434\u0440\u0430\u0432\u043e\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438, \u043a\u0440\u0438\u043c\u0438\u043d\u0430\u043b\u0438\u0441\u0442\u0438\u043a\u0435 \u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0435.<\/p>\n<p> \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0443 \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u043e\u043d \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 Python. \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0445\u043e\u0447\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u0438\u0437 \u043a\u043d\u0438\u0433\u0438 <a href=\"https:\/\/matheusfacure.github.io\/python-causality-handbook\/landing-page.html\">Causal Inference for The Brave and True<\/a>. \u042d\u0442\u0430 \u043a\u043d\u0438\u0433\u0430, \u0432\u044b\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u043e\u0431\u0449\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043f\u043e\u043c\u043e\u0433\u043b\u0430 \u043c\u043d\u0435 \u0433\u043b\u0443\u0431\u0436\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u0438\u0437 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430.<\/p>\n<p> \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443: \u043a\u0430\u043a \u043e\u0431\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u0430\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438 \u043d\u0430\u043b\u043e\u0433\u0430\u043c\u0438 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043a\u0443\u0440\u0435\u043d\u0438\u0435. \u0427\u0442\u043e\u0431\u044b \u0434\u0430\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0448\u0438\u0440\u043e\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0434\u0430\u0432\u043d\u043e \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u0440\u0443\u0433\u0430\u0445. \u041e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0430\u0440\u0442\u0438\u0439 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u0434 \u0432\u043b\u0438\u044f\u043d\u0438\u0435\u043c \u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u0438\u0433\u0430\u0440\u0435\u0442 \u0432\u044b\u0440\u0430\u0441\u0442\u0435\u0442, \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0438\u0433\u0430\u0440\u0435\u0442\u044b \u0441\u043d\u0438\u0437\u0438\u0442\u0441\u044f. \u041f\u043e \u043c\u043d\u0435\u043d\u0438\u044e \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043a\u0443\u0440\u044f\u0449\u0438\u0445 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0438\u043a\u043e\u0442\u0438\u043d\u043e\u0432\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0446\u0435\u043d\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043d\u0435 \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u043f\u0440\u043e\u0441\u0435. \u0412 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0438\u0433\u0430\u0440\u0435\u0442\u044b \u043d\u0435\u044d\u043b\u0430\u0441\u0442\u0438\u0447\u0435\u043d \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0446\u0435\u043d\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u043f\u043e\u0432\u044b\u0448\u0430\u044f \u043d\u0430\u043b\u043e\u0433\u0438 \u043d\u0430 \u0442\u0430\u0431\u0430\u043a, \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0431\u044e\u0434\u0436\u0435\u0442 \u0437\u0430 \u0441\u0447\u0451\u0442 \u043a\u0443\u0440\u0438\u043b\u044c\u0449\u0438\u043a\u043e\u0432. \u0427\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0442\u043e \u043f\u0440\u0430\u0432, \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u044e\u0449\u0438\u043c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432 \u0421\u0428\u0410.  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0447\u0442\u0435\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<h3>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p> \u0412 1988 \u0433\u043e\u0434\u0443 \u0432 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u0438 \u0431\u044b\u043b \u043f\u0440\u0438\u043d\u044f\u0442 \u0437\u043d\u0430\u043c\u0435\u043d\u0438\u0442\u044b\u0439 \u00ab\u0417\u0430\u043a\u043e\u043d \u043e \u043d\u0430\u043b\u043e\u0433\u043e\u043e\u0431\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0442\u0430\u0431\u0430\u043a\u0430 \u0438 \u0437\u0434\u0440\u0430\u0432\u043e\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/en.wikipedia.org\/wiki\/1988_California_Proposition_99\">\u00ab\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 99\u00bb<\/a>. \u00ab\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043a\u043e\u043d\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0441\u044f \u0432\u043e \u0432\u0437\u0438\u043c\u0430\u043d\u0438\u0438 \u0430\u043a\u0446\u0438\u0437\u043d\u043e\u0433\u043e \u043d\u0430\u043b\u043e\u0433\u0430 \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 25 \u0446\u0435\u043d\u0442\u043e\u0432 \u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0440\u043e\u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u0447\u043a\u0438 \u0441\u0438\u0433\u0430\u0440\u0435\u0442 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0448\u0442\u0430\u0442\u0430 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u044f, \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u043c\u0438 \u0430\u043a\u0446\u0438\u0437\u043d\u044b\u043c\u0438 \u043d\u0430\u043b\u043e\u0433\u0430\u043c\u0438 \u043d\u0430 \u0440\u043e\u0437\u043d\u0438\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0434\u0430\u0436\u0443 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0430\u0431\u0430\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0441\u0438\u0433\u0430\u0440 \u0438 \u0436\u0435\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0430\u0431\u0430\u043a\u0430. \u0421\u0440\u0435\u0434\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439, \u043d\u0430\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u0436\u0443 \u0442\u0430\u0431\u0430\u043a\u0430 \u2014 \u0437\u0430\u043f\u0440\u0435\u0442 \u043d\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0432\u0435\u043d\u0434\u0438\u043d\u0433\u043e\u0432\u044b\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432 \u0441 \u0442\u0430\u0431\u0430\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0435\u0439 \u0432 \u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445, \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0434\u043b\u044f \u0434\u0435\u0442\u0435\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u043f\u0440\u0435\u0442 \u043d\u0430 \u043f\u043e\u0448\u0442\u0443\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0434\u0430\u0436\u0443 \u0441\u0438\u0433\u0430\u0440\u0435\u0442\u00bb.<\/p>\n<p> \u0414\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u0445 \u0441\u0438\u0433\u0430\u0440\u0435\u0442 \u0432\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u0448\u0442\u0430\u0442\u043e\u0432 \u0438 \u0437\u0430 \u043c\u043d\u043e\u0433\u043e\u043b\u0435\u0442\u043d\u0438\u0439 \u043f\u0435\u0440\u0438\u043e\u0434. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u0430 \u043f\u0435\u0440\u0438\u043e\u0434 \u0441 1970 \u043f\u043e 2000 \u0433\u043e\u0434, \u0432\u0437\u044f\u0442\u044b\u043c\u0438 \u0438\u0437 39 \u0448\u0442\u0430\u0442\u043e\u0432. \u0412 \u0434\u0440\u0443\u0433\u0438\u0445 \u0448\u0442\u0430\u0442\u0430\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0441\u0445\u043e\u0436\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0442\u0430\u0431\u0430\u0447\u043d\u043e\u0433\u043e \u0440\u044b\u043d\u043a\u0430, \u0438 \u0438\u0445 \u043c\u044b \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u043b\u0438. \u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043d\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"python\">import pandas as pd import numpy as np from matplotlib import pyplot as plt import seaborn as sns import statsmodels.formula.api as smf from sklearn import linear_model  %matplotlib inline  cig = (pd.read_csv(\"\/content\/drive\/MyDrive\/smoking.csv\")          .drop(columns=[\"lnincome\",\"beer\", \"age15to24\"]))  style.use('fivethirtyeight') # You can change this to your preference  cig.query(\"california\").head() <\/code><\/pre>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/py\/3a\/5a\/py3a5aipd2sxwovgbzjxaabnp4c.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/py\/3a\/5a\/py3a5aipd2sxwovgbzjxaabnp4c.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> <\/p>\n<blockquote><p>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430<\/p><\/blockquote>\n<p> \u0417\u0434\u0435\u0441\u044c <code>state <\/code>\u2014 \u0438\u043d\u0434\u0435\u043a\u0441\/\u043d\u043e\u043c\u0435\u0440 \u0448\u0442\u0430\u0442\u0430, \u0443 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u0438 \u043d\u043e\u043c\u0435\u0440 3. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u0442 \u0431\u0435\u0440\u0451\u043c \u0440\u043e\u0437\u043d\u0438\u0447\u043d\u0443\u044e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u0438\u0433\u0430\u0440\u0435\u0442 \u0438 \u043f\u043e\u0434\u0443\u0448\u0435\u0432\u044b\u0435 \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u0441\u0438\u0433\u0430\u0440\u0435\u0442 \u0432 \u043f\u0435\u0440\u0435\u0441\u0447\u0451\u0442\u0435 \u043d\u0430 \u043f\u0430\u0447\u043a\u0438. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0430\u044f \u043d\u0430\u0441 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435, \u2014 <code>cigsale<\/code>. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u0443\u043b\u0435\u0432\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0443\u0434\u0438\u0442\u044c \u043e \u0448\u0442\u0430\u0442\u0435 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0438\u043e\u0434\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430. \u0412\u043e\u0442 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u0440\u043e\u0434\u0430\u0436 \u0441\u0438\u0433\u0430\u0440\u0435\u0442 \u0432 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u0438 \u0438 \u0433\u0440\u0430\u0444\u0438\u043a \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u043f\u0440\u043e\u0434\u0430\u0436 \u0441\u0438\u0433\u0430\u0440\u0435\u0442 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0448\u0442\u0430\u0442\u0430\u0445 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/tb\/k3\/y4\/tbk3y4dxsqbheyfkmkdrd7rtnrq.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/tb\/k3\/y4\/tbk3y4dxsqbheyfkmkdrd7rtnrq.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430, \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u043a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u0439\u0446\u044b \u044f\u0432\u043d\u043e \u043f\u043e\u043a\u0443\u043f\u0430\u043b\u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u0438\u0433\u0430\u0440\u0435\u0442, \u0447\u0435\u043c \u0432 \u0446\u0435\u043b\u043e\u043c \u043f\u043e \u0441\u0442\u0440\u0430\u043d\u0435. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0440\u0435\u043d\u0434 \u043d\u0430 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u0430\u043a\u0430 \u043f\u043e\u0441\u043b\u0435 80-\u0445. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u00ab\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f 99\u00bb \u044d\u0442\u043e\u0442 \u0442\u0440\u0435\u043d\u0434 \u043d\u0430 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u0432 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u0438 \u0443\u0441\u0438\u043b\u0438\u043b\u0441\u044f (\u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0448\u0442\u0430\u0442\u0430\u043c\u0438), \u043d\u043e \u0441 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u043e \u0433\u0440\u0430\u0444\u0438\u043a\u0443.<\/p>\n<p> \u0427\u0442\u043e\u0431\u044b \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u0442\u043e\u043c, \u043f\u043e\u0432\u043b\u0438\u044f\u043b\u043e \u043b\u0438 \u00ab\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 99\u00bb \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0441\u0438\u0433\u0430\u0440\u0435\u0442, \u0438\u0437\u0443\u0447\u0438\u043c \u043f\u0435\u0440\u0438\u043e\u0434 \u0434\u043e \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0438 \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c. \u041c\u044b \u0441\u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u0448\u0442\u0430\u0442\u0430\u043c, \u0447\u0442\u043e\u0431\u044b <b>\u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043d\u0430 \u0438\u0445 \u043e\u0441\u043d\u043e\u0432\u0435 \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0448\u0442\u0430\u0442, \u0442\u0440\u0435\u043d\u0434\u044b \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0447\u0435\u043d\u044c \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442 \u043a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u0439\u0441\u043a\u0438\u0435<\/b>. \u0417\u0430\u0442\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u0432 \u044d\u0442\u043e\u043c \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u043c \u0448\u0442\u0430\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430.<\/p>\n<h3>\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043d\u043e\u0442\u0430\u0446\u0438\u044f<\/h3>\n<p> \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 <i>J+1<\/i> \u0435\u0434\u0438\u043d\u0438\u0446. \u0414\u0430\u043b\u0435\u0435, \u0431\u0435\u0437 \u0443\u0449\u0435\u0440\u0431\u0430 \u043d\u0430\u0448\u0438\u043c \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u0443 1 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e, \u0442\u043e \u0435\u0441\u0442\u044c \u00ab\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 99\u00bb. \u0415\u0434\u0438\u043d\u0438\u0446\u044b <i>j=2,\u2026, J+1<\/i> \u2014 \u044d\u0442\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u043d\u0435\u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044b\u0445 \u0435\u0434\u0438\u043d\u0438\u0446 (\u0448\u0442\u0430\u0442\u043e\u0432), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0432 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u00ab\u043f\u0443\u043b\u043e\u043c \u0434\u043e\u043d\u043e\u0440\u043e\u0432\u00bb. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u0443 \u043d\u0430\u0441 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0442 T \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u0432 \u0441 <i>T0<\/i> \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u0432 \u0434\u043e \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u044b j \u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 t \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 <i>Yjt<\/i>. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u044b j \u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430 t \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c <i>YNjt <\/i>\u043a\u0430\u043a \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430, \u0438 <i>YIjt<\/i> \u2014 \u043a\u0430\u043a \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0439 \u043f\u043e\u0441\u043b\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/-j\/vr\/2w\/-jvr2wjgq_rmm88oywykuxs6bry.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/-j\/vr\/2w\/-jvr2wjgq_rmm88oywykuxs6bry.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u0422\u043e\u0433\u0434\u0430 \u044d\u0444\u0444\u0435\u043a\u0442 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u044b <i>j<\/i>=1 \u0432\u043e \u0432\u0440\u0435\u043c\u044f t \u0434\u043b\u044f <i>t&gt;T0<\/i> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/0d\/zp\/x7\/0dzpx7l8dccn-teetjsisnu_uta.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/0d\/zp\/x7\/0dzpx7l8dccn-teetjsisnu_uta.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <i>j=1<\/i> \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u0430 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u043c, <i>YIjt <\/i>\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0430 <i>YNjt <\/i>\u2014 \u043d\u0435\u0442. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441: \u043a\u0430\u043a \u043d\u0430\u043c \u043e\u0446\u0435\u043d\u0438\u0442\u044c <i>YNjt<\/i>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f. \u041e\u043d \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e, \u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u0440\u0430\u0441\u0441\u0435\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435, \u0443\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u0446\u0435\u043d\u043a\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0430 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443: <b>\u043e\u0446\u0435\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0431\u044b, \u0435\u0441\u043b\u0438 \u0431\u044b \u0432\u044b\u0445\u043e\u0434 \u043e\u0442 \u0435\u0434\u0438\u043d\u0438\u0446\u044b <i>j=1<\/i> \u0431\u044b\u043b \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0431\u0435\u0437 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430.<\/b> <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/h9\/6u\/wr\/h96uwr5iqerov7wxmiujrie5vay.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/h9\/6u\/wr\/h96uwr5iqerov7wxmiujrie5vay.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u0414\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 <i>YNjt <\/i>\u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c, \u0447\u0442\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f \u0435\u0434\u0438\u043d\u0438\u0446 \u0432 \u043f\u0443\u043b\u0435 \u0434\u043e\u043d\u043e\u0440\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043b\u044e\u0431\u0430\u044f \u043d\u0435\u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u0430\u044f \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u043c \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u0430\u044f. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043e\u0442 \u0432\u0441\u0435\u0445 \u0435\u0434\u0438\u043d\u0438\u0446 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u043c \u043f\u0443\u043b\u0435. \u0418\u043c\u0435\u044f \u0432\u0435\u0441\u0430 <i>W=(w2,\u2026,wJ+1)<\/i>, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043e\u0446\u0435\u043d\u043a\u0443 <i>YNjt <\/i>\u0440\u0430\u0432\u043d\u043e\u0439 <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/qt\/do\/i8\/qtdoi85c5e_bi0iyaj_kq7iuiuy.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/qt\/do\/i8\/qtdoi85c5e_bi0iyaj_kq7iuiuy.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> <\/p>\n<h3>\u041d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435<\/h3>\n<p> \u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u043d\u043e\u0437 \u043a\u0430\u043a \u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0441\u0435\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446. <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/1o\/qr\/fe\/1oqrfetadqbnb7jlpxosxetsycg.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/1o\/qr\/fe\/1oqrfetadqbnb7jlpxosxetsycg.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u041f\u0440\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0435\u0434\u0438\u043d\u0438\u0446, \u0437\u0430\u0442\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u0442\u0440\u0435\u0437\u043a\u043e\u0432. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443. \u0422\u043e\u0433\u0434\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u00ab\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438\u00bb, \u0438 \u043c\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0442\u043e\u0433 \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u043d\u0435\u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442 \u0435\u0434\u0438\u043d\u0438\u0446 \u2014 \u0441\u043c. \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446. <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/av\/c3\/ra\/avc3rasoefqgh_fm6tyzo0fxit8.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/av\/c3\/ra\/avc3rasoefqgh_fm6tyzo0fxit8.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0438\u043e\u0434 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0417\u0434\u0435\u0441\u044c \u0441\u0430\u043c\u043e\u0435 \u0432\u0430\u0436\u043d\u043e\u0435 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u00ab\u043f\u044b\u0442\u0430\u043b\u0430\u0441\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c\u00bb \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u0443\u044e \u0435\u0434\u0438\u043d\u0438\u0446\u0443 1, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0435\u0441\u0430 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u043d\u0443\u0436\u043d\u043e\u0439 \u043d\u0430\u043c \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0430\u0436\u0435 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u043e\u0442\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438, \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0432 \u0438\u043c \u0440\u0430\u0437\u043d\u0443\u044e \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438. <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/x7\/is\/ju\/x7isjuha8vaq8rh2kn3b-bzuc2e.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/x7\/is\/ju\/x7isjuha8vaq8rh2kn3b-bzuc2e.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> <\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p> \u0427\u0442\u043e\u0431\u044b \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f, \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u00ab\u0444\u0438\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0435\u0434\u0438\u043d\u0438\u0446\u0443\u00bb, \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0449\u0443\u044e \u043f\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u0442\u0443, \u0447\u0442\u043e \u043c\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c, \u043d\u043e \u0434\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0430 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c, \u043a\u0430\u043a \u00ab\u0444\u0438\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u00bb \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0431\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u0435\u0439 \u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u0435\u0439 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u0438\u043c\u0438\u043a\u0440\u0438\u044e \u043f\u043e\u0434 \u044d\u0444\u0444\u0435\u043a\u0442 \u043e\u0442 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430.<\/p>\n<p> \u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438, \u043d\u0430\u0439\u0434\u0451\u043c \u0432\u0435\u0441 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432 (OLS). \u041c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0441\u0440\u0435\u0434\u043d\u0435\u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0435\u0434\u0438\u043d\u0438\u0446 \u0432 \u043f\u0443\u043b\u0435 \u0434\u043e\u043d\u043e\u0440\u043e\u0432 \u0438 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u0435\u0439 \u0432 \u0442\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0430 \u0431\u044b\u043b\u0430 \u0434\u043e \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430.<\/p>\n<p> \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u0438\u0446\u044b (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u0448\u0442\u0430\u0442\u044b) \u0432 \u0441\u0442\u043e\u043b\u0431\u0446\u044b, \u0430 \u0432\u0440\u0435\u043c\u044f \u2014 \u0432 \u0441\u0442\u0440\u043e\u043a\u0438. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043d\u0430\u0441 2 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430, <code>cigsale <\/code>\u0438 <code>retprice<\/code>, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0438\u0445 \u0434\u0440\u0443\u0433 \u043d\u0430\u0434 \u0434\u0440\u0443\u0433\u043e\u043c, \u043a\u0430\u043a \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435. \u0421\u043e\u0431\u0435\u0440\u0451\u043c \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0439 \u0448\u0442\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043a\u0430\u043a \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u044f, \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0441 \u043d\u0438\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0432 \u043f\u0435\u0440\u0438\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043b\u0438\u0448\u044c \u043f\u0435\u0440\u0438\u043e\u0434 \u0434\u043e \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u043e\u0445\u043e\u0436\u0435\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0438\u0445 \u043d\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u0435\u043c. \u0415\u0441\u043b\u0438 \u0431\u044b \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u044b \u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043e\u0442\u043b\u0438\u0447\u0430\u043b\u0438\u0441\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0434\u0438\u043d \u0438\u0441\u0447\u0438\u0441\u043b\u044f\u043b\u0441\u044f \u0442\u044b\u0441\u044f\u0447\u0430\u043c\u0438, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u0435\u0441\u044f\u0442\u043a\u0430\u043c\u0438, \u0442\u043e \u043f\u0440\u0438 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043d\u0430\u043c \u0431\u044b\u043b \u0431\u044b \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u0435\u043d \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u0432\u0430\u0436\u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438. <\/p>\n<pre><code class=\"python\">features = [\"cigsale\", \"retprice\"]  inverted = (cig.query(\"~after_treatment\") # \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0438\u043e\u0434 \u0434\u043e \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430             .pivot(index='state', columns=\"year\")[features] # \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0443 \u043d\u0430 \u0433\u043e\u0434 \u0438 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0430 \u0448\u0442\u0430\u0442              .T) # \u043f\u0435\u0440\u0435\u0432\u0435\u0440\u043d\u0451\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0443 \u043d\u0430 \u0448\u0442\u0430\u0442   inverted.head() <\/code><\/pre>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/gk\/4y\/f1\/gk4yf14058obez20cqatkzsoebw.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/gk\/4y\/f1\/gk4yf14058obez20cqatkzsoebw.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e Y \u043a\u0430\u043a \u0448\u0442\u0430\u0442 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u044f, \u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e X \u043a\u0430\u043a \u0434\u0440\u0443\u0433\u0438\u0435 \u0448\u0442\u0430\u0442\u044b.<\/p>\n<pre><code class=\"python\">y = inverted[3].values # \u0448\u0442\u0430\u0442 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u044f X = inverted.drop(columns=3).values  # \u0434\u0440\u0443\u0433\u0438\u0435 \u0448\u0442\u0430\u0442\u044b <\/code><\/pre>\n<p> \u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043b\u0430\u0441\u0441\u043e-\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044e. \u041b\u0430\u0441\u0441\u043e-\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f, \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u043d\u0443\u0435\u043c\u0430\u044f L1, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0448\u0442\u0430\u0442\u0430\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0438\u0434\u0436-\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0435\u0439. \u0420\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u0432\u0435\u0440\u043d\u0451\u0442 \u043d\u0430\u0431\u043e\u0440 \u0432\u0435\u0441\u043e\u0432, \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u0443\u044e \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u0435\u0439 \u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 \u0438\u0437 \u043f\u0443\u043b\u0430 \u0434\u043e\u043d\u043e\u0440\u043e\u0432.<\/p>\n<pre><code class=\"python\">from sklearn.linear_model import Lasso weights_lr = Lasso(fit_intercept=False).fit(X, y).coef_ weights_lr.round(3) <\/code><\/pre>\n<p> <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/og\/ob\/g-\/ogobg-_dl6gxujxq189mknt9n3k.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/og\/ob\/g-\/ogobg-_dl6gxujxq189mknt9n3k.png\"\/><\/div>\n<p> \u041f\u043e \u044d\u0442\u0438\u043c \u0432\u0435\u0441\u0430\u043c \u0432\u0438\u0434\u043d\u043e, \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c. \u0423\u043c\u043d\u043e\u0436\u0438\u043c \u0438\u0442\u043e\u0433 \u0448\u0442\u0430\u0442\u0430 1 \u043d\u0430 0,566, \u0448\u0442\u0430\u0442\u0430 3 \u043d\u0430 0,317, \u0448\u0442\u0430\u0442\u0430 4 \u043d\u0430 0,158 \u0438 \u0442. \u0434. \u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u044b\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043c\u0435\u0436\u0434\u0443 \u043c\u0430\u0442\u0440\u0438\u0446\u0435\u0439 \u0448\u0442\u0430\u0442\u043e\u0432 \u0432 \u043f\u0443\u043b\u0435 \u0438 \u0432\u0435\u0441\u0430\u043c\u0438.<\/p>\n<pre><code class=\"python\">calif_synth_lr = (cig.query(\"~california\")                   .pivot(index='year', columns=\"state\")[\"cigsale\"]                   .values.dot(weights_lr)) <\/code><\/pre>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0433\u043e\u0442\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043d\u0435\u0441\u0442\u0438 \u0435\u0433\u043e \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u044f \u0448\u0442\u0430\u0442\u0430 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u044f.<\/p>\n<pre><code class=\"python\">plt.figure(figsize=(10,6)) plt.plot(cig.query(\"california\")[\"year\"], cig.query(\"california\")[\"cigsale\"], label=\"California\") plt.plot(cig.query(\"california\")[\"year\"], calif_synth_lr, label=\"Synthetic Control\") plt.vlines(x=1988, ymin=40, ymax=140, linestyle=\":\", lw=2, label=\"Proposition 99\") plt.ylabel(\"Gap in per-capita cigarette sales (in packs)\") plt.legend(); <\/code><\/pre>\n<p> <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/ak\/dr\/xb\/akdrxbtba8oz3eozxrjisiivb7u.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/ak\/dr\/xb\/akdrxbtba8oz3eozxrjisiivb7u.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u0418\u043c\u0435\u044f \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c, \u043c\u043e\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u044b\u0432 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 \u0434\u043b\u044f \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u043e\u0433\u043e \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/ta\/l3\/as\/tal3asilfxlqcwgesapohhfnhnc.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/ta\/l3\/as\/tal3asilfxlqcwgesapohhfnhnc.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> <\/p>\n<pre><code class=\"python\">plt.figure(figsize=(10,6)) plt.plot(cig.query(\"california\")[\"year\"], cig.query(\"california\")[\"cigsale\"] - calif_synth_lr,          label=\"California Effect\") plt.vlines(x=1988, ymin=-30, ymax=7, linestyle=\":\", lw=2, label=\"Proposition 99\") plt.hlines(y=0, xmin=1970, xmax=2000, lw=2) plt.title(\"State - Synthetic Across Time\") plt.ylabel(\"Gap in per-capita cigarette sales (in packs)\") plt.legend(); <\/code><\/pre>\n<p> <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/8g\/uf\/ch\/8gufchxbtsc_rorxrsc_pqexipi.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/8g\/uf\/ch\/8gufchxbtsc_rorxrsc_pqexipi.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043a 2000 \u0433\u043e\u0434\u0443 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u00ab\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044e 99\u00bb \u043f\u043e\u0434\u0443\u0448\u0435\u0432\u044b\u0435 \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u0441\u0438\u0433\u0430\u0440\u0435\u0442 \u0441\u043d\u0438\u0437\u0438\u043b\u0438\u0441\u044c \u043d\u0430 25 \u043f\u0430\u0447\u0435\u043a. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u044d\u0442\u043e\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c.<\/p>\n<h3>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u044b\u0432\u043e\u0434<\/h3>\n<p> \u0417\u0434\u0435\u0441\u044c \u0432\u043e\u043e\u0440\u0443\u0436\u0438\u043c\u0441\u044f \u0442\u043e\u0447\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u043e\u043c \u0424\u0438\u0448\u0435\u0440\u0430. \u0418\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043e\u043d \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u0435\u043d. \u041c\u044b \u043e\u0441\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0432 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u043e\u0439 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0430, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0443\u044e \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0439, \u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u2014 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u043c\u0438. <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/5e\/rv\/wk\/5ervwk5lak80flsu9pqtp9_owkq.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/5e\/rv\/wk\/5ervwk5lak80flsu9pqtp9_owkq.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u0412 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0448\u0442\u0430\u0442 \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f, \u0438 \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0435. \u0422\u043e \u0435\u0441\u0442\u044c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043c\u0435\u0440\u044b \u0431\u044b\u043b\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044b \u043d\u0435 \u0432 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u0438, \u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0448\u0442\u0430\u0442\u0435, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a\u043e\u0432 \u0431\u044b\u043b \u0431\u044b \u044d\u0444\u0444\u0435\u043a\u0442, \u0435\u0441\u043b\u0438 \u0431\u044b \u044d\u0442\u0438 \u043c\u0435\u0440\u044b \u043d\u0435 \u0431\u044b\u043b\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044b. \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u044d\u0444\u0444\u0435\u043a\u0442 \u043e\u0442 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u044b\u0448\u0435 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c, \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044b\u043c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c, \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0448\u0442\u0430\u0442\u0435. \u0418\u0434\u0435\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043c\u0435\u0440 \u0432 \u0448\u0442\u0430\u0442\u0430\u0445 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u043e\u0441\u044c (\u0430 \u043c\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435), \u0442\u043e \u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0430 \u043e\u0442 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u044b \u043d\u0435 \u0432\u044b\u044f\u0432\u0438\u043c.<\/p>\n<p> \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0444\u0440\u0435\u0439\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u0433\u0434\u0435 \u043e\u0434\u0438\u043d \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0448\u0442\u0430\u0442\u0443, \u043e\u0434\u0438\u043d \u2013 \u0433\u043e\u0434\u0443, \u043e\u0434\u0438\u043d \u2014 \u0438\u0442\u043e\u0433\u0443 <code>cigsale <\/code>\u0438 \u043e\u0434\u0438\u043d \u2014 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0438\u0442\u043e\u0433\u0443 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0448\u0442\u0430\u0442\u0430. <\/p>\n<p> \u0412\u043e\u0442 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u0448\u0442\u0430\u0442\u0443:<\/p>\n<pre><code class=\"python\">def synthetic_control(state, pool, data) -&gt; np.array:          features = [\"cigsale\", \"retprice\"]          inverted = (data.query(\"~after_treatment\")                 .pivot(index='state', columns=\"year\")[features]                 .T)          y = inverted[state].values # treated     X = inverted.drop(columns=state).values # donor pool      weights = Lasso(fit_intercept=False).fit(X, y).coef_.round(3)     synthetic = (data.query(f\"~(state=={state})\")                  .pivot(index='year', columns=\"state\")[\"cigsale\"]                  .values.dot(weights))      return (data             .query(f\"state=={state}\")[[\"state\", \"year\", \"cigsale\", \"after_treatment\"]]             .assign(synthetic=synthetic)) <\/code><\/pre>\n<p> <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/du\/qf\/ir\/duqfirardp78nwao2mforbiecjs.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/du\/qf\/ir\/duqfirardp78nwao2mforbiecjs.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u0418\u043c\u0435\u044f \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0448\u0442\u0430\u0442\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u044b\u0432 \u043c\u0435\u0436\u0434\u0443 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0438 \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0448\u0442\u0430\u0442\u043e\u0432. \u0412 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u0438 \u044d\u0442\u043e \u044d\u0444\u0444\u0435\u043a\u0442, \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044b\u0439 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430. \u0414\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0448\u0442\u0430\u0442\u043e\u0432 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442 \u043f\u043e\u0434\u043e\u0431\u0435\u043d \u043f\u043b\u0430\u0446\u0435\u0431\u043e \u2013 \u043c\u044b \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u043c, \u043a\u0430\u043a \u043f\u043e\u0432\u043b\u0438\u044f\u043b\u043e \u0431\u044b \u043d\u0430 \u0448\u0442\u0430\u0442 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043f\u043b\u0430\u0446\u0435\u0431\u043e \u043d\u0430\u0440\u044f\u0434\u0443 \u0441 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0435\u0440, \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0445 \u0432 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u0438, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430:<\/p>\n<pre><code class=\"python\">sinthetic_states = [synthetic_control(state, control_pool, cig) for state in control_pool] plt.figure(figsize=(12,7)) for state in sinthetic_states:     plt.plot(state[\"year\"], state[\"cigsale\"] - state[\"synthetic\"], color=\"C5\",alpha=0.4)  plt.plot(cigar.query(\"california\")[\"year\"], cigar.query(\"california\")[\"cigsale\"] - calif_synth_lr,         label=\"California\");  plt.vlines(x=1988, ymin=-50, ymax=120, linestyle=\":\", lw=2, label=\"Proposition 99\") plt.hlines(y=0, xmin=1970, xmax=2000, lw=3) plt.ylabel(\"Gap in per-capita cigarette sales (in packs)\") plt.title(\"State - Synthetic Across Time\") plt.legend();  ------  control_pool = cig[\"state\"].unique()  sinthetic_states = [synthetic_control(state, control_pool, cig) for state in control_pool]  plt.figure(figsize=(12,7)) for state in sinthetic_states:     plt.plot(state[\"year\"], state[\"cigsale\"] - state[\"synthetic\"], color=\"C5\",alpha=0.4)  plt.plot(cig.query(\"california\")[\"year\"], cig.query(\"california\")[\"cigsale\"] - calif_synth_lr,         label=\"California\");  plt.vlines(x=1988, ymin=-50, ymax=120, linestyle=\":\", lw=2, label=\"Proposition 99\") plt.hlines(y=0, xmin=1970, xmax=2000, lw=3) plt.ylabel(\"Gap in per-capita cigarette sales (in packs)\") plt.title(\"State - Synthetic Across Time\") plt.legend(); <\/code><\/pre>\n<p> <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/j6\/6l\/5s\/j66l5su4g0ardv7kdqh7xh1fgku.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/j6\/6l\/5s\/j66l5su4g0ardv7kdqh7xh1fgku.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u041d\u0430 \u044d\u0442\u043e\u043c \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u0441\u0440\u0430\u0437\u0443 \u0431\u0440\u043e\u0441\u0430\u044e\u0442\u0441\u044f \u0432 \u0433\u043b\u0430\u0437\u0430 \u0434\u0432\u0435 \u0434\u0435\u0442\u0430\u043b\u0438. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0440\u0430\u0437\u0431\u0440\u043e\u0441 \u043f\u043e\u0441\u043b\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u0434\u043e \u043d\u0435\u0433\u043e. \u042d\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u043c \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0441 \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u043c \u0434\u043e \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430. \u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0430\u0441\u043f\u0435\u043a\u0442 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u0436\u0435 \u0432 \u043f\u0435\u0440\u0438\u043e\u0434 \u0434\u043e \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430. \u042d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e.<\/p>\n<p> \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0442\u0430\u043a \u043f\u043b\u043e\u0445\u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0433\u0440\u0430\u0444\u0438\u043a, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0445 \u0438\u0437 \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u0440\u043e\u0433 \u0434\u043b\u044f \u043e\u0448\u0438\u0431\u043a\u0438, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0439 \u0434\u043e \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/-h\/aj\/rk\/-hajrkqwsezb4vn-yegf1hq4gvs.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/-h\/aj\/rk\/-hajrkqwsezb4vn-yegf1hq4gvs.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0441\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0434\u0430\u043b\u0435\u0435 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0433\u0440\u0430\u0444\u0438\u043a, \u043a\u0430\u043a \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0438\u0441\u0443\u043d\u043a\u0435, \u0442\u043e \u0432\u043e\u0442 \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<pre><code class=\"python\">def pre_treatment_error(state):     pre_treat_error = (state.query(\"~after_treatment\")[\"cigsale\"]                         - state.query(\"~after_treatment\")[\"synthetic\"]) ** 2     return pre_treat_error.mean()  plt.figure(figsize=(12,7)) for state in sinthetic_states:          # \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0432\u044b\u0448\u0435 5.     if pre_treatment_error(state) &lt; 5:         plt.plot(state[\"year\"], state[\"cigsale\"] - state[\"synthetic\"], color=\"C5\",alpha=0.4)  plt.plot(cig.query(\"california\")[\"year\"], cig.query(\"california\")[\"cigsale\"] - calif_synth_lr,         label=\"California\");  plt.vlines(x=1988, ymin=-50, ymax=120, linestyle=\":\", lw=2, label=\"Proposition 99\") plt.hlines(y=0, xmin=1970, xmax=2000, lw=3) plt.ylabel(\"Gap in per-capita cigarette sales (in packs)\") plt.title(\"Distribution of Effects\") plt.title(\"State - Synthetic Across Time (Large Pre-Treatment Errors Removed)\") plt.legend(); <\/code><\/pre>\n<p> <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/tz\/ht\/fa\/tzhtfalpfketnscepqsqwsza788.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/tz\/ht\/fa\/tzhtfalpfketnscepqsqwsza788.png\"\/><\/div>\n<p> \u0423\u0434\u0430\u043b\u0438\u0432 \u0448\u0443\u043c, \u0432\u0438\u0434\u0438\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0436\u0435 \u044d\u043a\u0441\u0442\u0440\u0435\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442 \u0432 \u0448\u0442\u0430\u0442\u0435 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u044f. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0440\u0438\u0441\u0443\u043d\u043a\u0430, \u0435\u0441\u043b\u0438 \u0431\u044b \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0440\u044b \u0431\u044b\u043b\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044b \u0432 \u043b\u044e\u0431\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u0448\u0442\u0430\u0442\u0435, \u043a\u0440\u043e\u043c\u0435 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u0438, \u043c\u044b \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0434\u043e\u0431\u0438\u043b\u0438\u0441\u044c \u0431\u044b \u0442\u0430\u043a\u0438\u0445 \u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043a\u0430\u043a \u0432 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u0438.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/-e\/gj\/oo\/-egjoonvjl6v0o96xobbltrecm0.jpeg\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/-e\/gj\/oo\/-egjoonvjl6v0o96xobbltrecm0.jpeg\" data-blurred=\"true\"\/><\/div>\n<p> \u042d\u0444\u0444\u0435\u043a\u0442 \u043e\u0442 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0432 \u0448\u0442\u0430\u0442\u0435 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u044f \u0432 2000 \u0433\u043e\u0434\u0443 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 -31.419, \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u0443\u0448\u0435\u0432\u043e\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0441\u0438\u0433\u0430\u0440\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u0447\u0442\u0438 \u043d\u0430 31 \u043f\u0430\u0447\u043a\u0443.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p> \u041f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u0448\u0442\u0430\u0442\u0430\u043c, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u043c\u0438 \u043f\u0435\u0440\u0438\u043e\u0434 \u0434\u043e \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430, \u043c\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043b\u0430\u0441\u0441\u043e-\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043b\u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u0435\u0441\u0430 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u043c\u0443 \u0448\u0442\u0430\u0442\u0443 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0443 \u043a\u0443\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0448\u0442\u0430\u0442\u0430 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u044f \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u00ab\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 99\u00bb.<\/p>\n<p> \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043b\u0430\u0441\u0441\u043e-\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0438 \u0441\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0448\u0442\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0431\u044b \u043a\u0430\u043a \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u044f \u0432 \u043f\u043e\u0441\u0442-\u043f\u0435\u0440\u0438\u043e\u0434 \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0431\u044b \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u043c\u0438 \u0441\u0438\u0433\u0430\u0440\u0435\u0442 \u0438 \u0442\u0435\u043c \u0438\u0442\u043e\u0433\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u0441\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438, \u2014 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442 \u043e\u0442 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430.<\/p>\n<p> \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u043a\u0430\u043a \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0424\u0438\u0448\u0435\u0440\u0430 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u0430\u043c. \u041c\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0438 \u0431\u044b \u043d\u0435\u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044b\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043f\u043e\u0441\u043b\u0435 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0438 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043b\u0438 \u044d\u0444\u0444\u0435\u043a\u0442. \u042d\u0442\u043e\u0442 \u044d\u0444\u0444\u0435\u043a\u0442 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043f\u043b\u0430\u0446\u0435\u0431\u043e: \u0435\u0433\u043e \u043c\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u043b\u0438 \u0431\u044b \u0438 \u0431\u0435\u0437 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430. \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u0438\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432 \u043c\u044b \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430, \u043a\u0430\u043a \u043e\u043d\u043e \u043f\u043e\u0432\u043b\u0438\u044f\u043b\u043e \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u0441\u0438\u0433\u0430\u0440\u0435\u0442 \u0432 \u041a\u0430\u043b\u0438\u0444\u043e\u0440\u043d\u0438\u0438. <\/p>\n<h3>\u041a\u043d\u0438\u0433\u0430<\/h3>\n<p> <a href=\"https:\/\/matheusfacure.github.io\/python-causality-handbook\/landing-page.html\">Causal Inference for The Brave and True<\/a> by Matheus Facure<\/div>\n<\/p><\/div>\n<p> <b>\u041e\u0431 \u0430\u0432\u0442\u043e\u0440\u0435<\/b><\/p>\n<p> \u041c\u0430\u0442\u0435\u0443\u0448 \u0424\u0430\u043a\u0443\u0440 \u2014 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0441\u0442 \u0438 \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 Nubank, \u043a\u0440\u0443\u043f\u043d\u0435\u0439\u0448\u0435\u0439 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e-\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0410\u0437\u0438\u0438. \u041e\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0432 \u0448\u0438\u0440\u043e\u043a\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432, \u043e\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0435 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043d\u044b\u0445 \u0441\u0442\u0430\u0432\u043e\u043a \u0438 \u0432\u044b\u0434\u0430\u0447\u0435 \u043a\u0440\u0435\u0434\u0438\u0442\u043e\u0432 \u0434\u043e \u043f\u0440\u043e\u0434\u0430\u044e\u0449\u0438\u0445 \u0440\u0430\u0441\u0441\u044b\u043b\u043e\u043a \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u043e\u0432\u044b\u0445 \u0431\u044e\u0434\u0436\u0435\u0442\u043e\u0432. \u041c\u0430\u0442\u0435\u0443\u0448 \u2014 \u0430\u0432\u0442\u043e\u0440 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0438 \u00abCausal Inference for the Brave and True\u00bb, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u043d\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c, \u043d\u043e \u0442\u043e\u0447\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c.<\/p>\n<p> \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0441 \u043a\u043d\u0438\u0433\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043d\u0430 <a href=\"https:\/\/www.piter.com\/collection\/all\/product\/causal-inference-na-python-prichinno-sledstvennye-svyazi-v-it-razrabotke?utm_source=habr&amp;utm_medium=post&amp;utm_campaign=oreilly&amp;utm_content=causal-inference-na-python&amp;utm_term=book\">\u0441\u0430\u0439\u0442\u0435 \u0438\u0437\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430<\/a>:<\/p>\n<p> \u00bb <a href=\"https:\/\/www.piter.com\/collection\/all\/product\/causal-inference-na-python-prichinno-sledstvennye-svyazi-v-it-razrabotke?utm_source=habr&amp;utm_medium=post&amp;utm_campaign=oreilly&amp;utm_content=causal-inference-na-python&amp;utm_term=oglavlenie#Oglavlenie-1\">\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/a><br \/> \u00bb <a href=\"https:\/\/www.piter.com\/collection\/all\/product\/causal-inference-na-python-prichinno-sledstvennye-svyazi-v-it-razrabotke?utm_source=habr&amp;utm_medium=post&amp;utm_campaign=oreilly&amp;utm_content=causal-inference-na-python&amp;utm_term=otrivok#Otryvok-1\">\u041e\u0442\u0440\u044b\u0432\u043e\u043a<\/a><\/p>\n<p> \u041f\u043e \u0444\u0430\u043a\u0442\u0443 \u043e\u043f\u043b\u0430\u0442\u044b \u0431\u0443\u043c\u0430\u0436\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043a\u043d\u0438\u0433\u0438 \u043d\u0430 e-mail \u0432\u044b\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0430\u044f \u043a\u043d\u0438\u0433\u0430.<br \/> \u0414\u043b\u044f \u0425\u0430\u0431\u0440\u043e\u0436\u0438\u0442\u0435\u043b\u0435\u0439 \u0441\u043a\u0438\u0434\u043a\u0430 25% \u043f\u043e \u043a\u0443\u043f\u043e\u043d\u0443 \u2014 <b>Python<\/b><\/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\/852440\/\"> https:\/\/habr.com\/ru\/articles\/852440\/<\/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-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/companies\/piter\/articles\/852440\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/0h\/ai\/bs\/0haibsbudnccp2lhbdx5o8frubw.jpeg\" align=\"left\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/0h\/ai\/bs\/0haibsbudnccp2lhbdx5o8frubw.jpeg\" data-blurred=\"true\"\/><\/a> \u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440\u043e\u0436\u0438\u0442\u0435\u043b\u0438!<\/p>\n<p> \u041f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0432\u0430\u0436\u043d\u0435\u0439\u0448\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0439 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u0443\u043a\u0438 \u043e \u0434\u0430\u043d\u043d\u044b\u0445 (data science), \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043e\u0440\u0438\u0435\u0439 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0431\u0435\u043b. \u041c\u0430\u0442\u0435\u0443\u0448 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043b\u0443\u0447\u0448\u0443\u044e \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u043a\u043d\u0438\u0433\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0447\u0438\u0442, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043e\u0442 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043a \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u043c \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u043c \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u0411\u043e\u043b\u044c\u0448\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0443\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044e, \u0430 \u043d\u0435 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430\u043c \u0438 \u0442\u0435\u043e\u0440\u0435\u043c\u0430\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430.<\/p>\n<p> \u0414\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0449\u0435\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043e\u0442\u043a\u0440\u044b\u043b\u0438 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u0442\u0440\u0430\u0441\u043b\u044f\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0435\u0449\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u0441\u0440\u0435\u0434\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0437\u0430 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0439.<\/p>\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-437759","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/437759","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=437759"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/437759\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=437759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=437759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=437759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}