{"id":453647,"date":"2025-03-28T15:01:39","date_gmt":"2025-03-28T15:01:39","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=453647"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=453647","title":{"rendered":"<span>\u0411\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u0430\u044f \u0441\u043e\u0431\u0430\u043a\u0430: \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0451\u0441\u044c\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u0430\u0441\u0430<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>tl;dr<\/h2>\n<p>\u041e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043b\u0438 \u0441\u043e\u0431\u0430\u043a\u0438 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u0441\u0443, \u043a\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u0430\u044e\u0442 \u0441\u0432\u043e\u0438 \u0433\u0440\u044f\u0437\u043d\u044b\u0435 \u0434\u0435\u043b\u0430? \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u2014 \u0434\u0430! \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0432 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043c\u043f\u0430\u0441, \u0411\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438 \u0441\u043e\u0431\u0430\u043a\u0443 (\u0441\u043e\u0431\u0430\u043a\u0430 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430), \u0442\u043e \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0442.\u00a0<\/p>\n<p>\u042f \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u043b\u044e \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0438\u0448\u0443 \u043e \u043d\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u0437\u0430\u043c\u0435\u0442\u043a\u0438 (\u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0439). \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0442\u0430\u043a\u043e\u0435 \u0442\u043e\u0436\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u2014 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043c\u043e\u0439 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b:\u00a0<a href=\"https:\/\/t.me\/data_wondering\" rel=\"noopener noreferrer nofollow\">Data Wondering<\/a>.\u00a0<\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u044f \u0441\u043e\u0431\u0430\u043a\u0430, \u0410\u0443\u0440\u0438. \u0415\u043c\u0443 \u043f\u044f\u0442\u044c \u043b\u0435\u0442 \u0438 \u043f\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c \u043e\u043d \u043f\u043e\u0440\u043e\u0434\u0438\u0441\u0442\u044b\u0439 \u041a\u0430\u0432\u0430\u043b\u0435\u0440-\u043a\u0438\u043d\u0433-\u0447\u0430\u0440\u043b\u044c\u0437-\u0441\u043f\u0430\u043d\u0438\u0435\u043b\u044c, \u0445\u043e\u0442\u044f \u043f\u043e \u043f\u043e\u0432\u0430\u0434\u043a\u0430\u043c \u0434\u043e \u043a\u0430\u0432\u0430\u043b\u0435\u0440\u0430 \u0431\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043b\u0435\u043a\u043e.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6be\/d02\/023\/6bed02023c0a6d62dcd7c881ff2ce918.png\" alt=\"\u0410\u0443\u0440\u0438 \u0432\u043e \u0432\u0441\u0435\u0439 \u043a\u0440\u0430\u0441\u0435 (\u0444\u043e\u0442\u043e \u0430\u0432\u0442\u043e\u0440\u0430)\" title=\"\u0410\u0443\u0440\u0438 \u0432\u043e \u0432\u0441\u0435\u0439 \u043a\u0440\u0430\u0441\u0435 (\u0444\u043e\u0442\u043e \u0430\u0432\u0442\u043e\u0440\u0430)\" width=\"1400\" height=\"1867\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6be\/d02\/023\/6bed02023c0a6d62dcd7c881ff2ce918.png\"\/><\/p>\n<div><figcaption>\u0410\u0443\u0440\u0438 \u0432\u043e \u0432\u0441\u0435\u0439 \u043a\u0440\u0430\u0441\u0435 (\u0444\u043e\u0442\u043e \u0430\u0432\u0442\u043e\u0440\u0430)<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u044b \u0441\u043e\u0431\u0430\u043a, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0448\u0438\u0445 \u0441 \u043d\u0438\u043c \u043f\u0440\u043e\u0433\u0443\u043b\u043e\u043a \u044f \u043d\u0430\u0447\u0430\u043b \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u0443 \u0410\u0443\u0440\u0438 \u0435\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0442\u0443\u0430\u043b\u0435\u0442\u043d\u044b\u0439 \u0440\u0438\u0442\u0443\u0430\u043b. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e, \u043e\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043a\u0440\u0443\u0436\u0438\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u0432\u043e\u0435\u0439 \u043e\u0441\u0438, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043f\u043e\u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u043f\u0440\u044f\u043c\u043e \u043a\u0430\u043a \u0441\u0442\u0440\u0435\u043b\u043a\u0430 \u043a\u043e\u043c\u043f\u0430\u0441\u0430.\u00a0<\/p>\n<p>\u041f\u043e\u043d\u0430\u0447\u0430\u043b\u0443, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u0437\u0430\u0431\u0430\u0432\u043d\u043e. \u0412 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432, \u043a\u0442\u043e \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0430\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043f\u0451\u0441\u044c\u0435\u0439 \u0433\u043e\u043b\u043e\u0432\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u043f\u0443\u0441\u0442\u044f \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u044f \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b, \u0447\u0442\u043e \u0432 \u0434\u0430\u043b\u0435\u043a\u043e\u043c 2013-\u043c \u0433\u043e\u0434\u0443 \u043c\u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u0433\u043b\u0430\u0437\u0430 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c &#171;\u0421\u043e\u0431\u0430\u043a\u0438 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b \u043a \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044f\u043c \u043c\u0430\u0433\u043d\u0438\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0417\u0435\u043c\u043b\u0438&#187; (\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b:\u00a0<a href=\"https:\/\/frontiersinzoology.biomedcentral.com\/counter\/pdf\/10.1186\/1742-9994-10-80.pdf\" rel=\"noopener noreferrer nofollow\">Dogs are sensitive to small variations of the Earth\u2019s magnetic field<\/a>). \u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043e \u043d\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u0441\u043e\u0431\u0430\u043a, \u0430 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u043b, \u0447\u0442\u043e &#171;\u0441\u043e\u0431\u0430\u043a\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0438\u0441\u043f\u0440\u0430\u0436\u043d\u044f\u0442\u044c\u0441\u044f, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443\u044f \u0441\u0432\u043e\u0451 \u0442\u0435\u043b\u043e \u0432\u0434\u043e\u043b\u044c \u043e\u0441\u0438 \u0421\u0435\u0432\u0435\u0440-\u042e\u0433&#187;.\u00a0<\/p>\n<p>&#171;\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043a \u0440\u0430\u0437 \u0432 \u043c\u043e\u0451\u043c \u0441\u0442\u0438\u043b\u0435, \u043d\u0430\u0434\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c!&#187;,\u00a0\u043f\u043e\u0434\u0443\u043c\u0430\u043b \u044f. \u0418, \u043a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0443 \u043c\u0435\u043d\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u044b\u0439. \u042f \u0440\u0435\u0448\u0438\u043b \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u0443 \u0440\u0430\u0431\u043e\u0442\u0443 \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c (\u043b\u0438\u0431\u043e \u043e\u043f\u0440\u043e\u0432\u0435\u0440\u0433\u043d\u0443\u0442\u044c!) \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443 \u043d\u0430 \u0410\u0443\u0440\u0438, \u043c\u043e\u0451\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e\u0449\u0435\u043c N=1 \u0438\u0441\u043f\u044b\u0442\u0443\u0435\u043c\u043e\u043c.<\/p>\n<p>\u0421 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0441\u044f \u043c\u043e\u0439 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438 \u043e\u0447\u0435\u043d\u044c \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f \u0437\u0430\u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0431\u043e\u043b\u0435\u0435 150 &#171;\u0441\u0435\u0430\u043d\u0441\u043e\u0432 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f&#187;, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u043e \u0447\u0435\u043c \u044f.\u00a0<\/p>\n<h2>\u0421\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0414\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f, \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u0441\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0410\u0443\u0440\u0438 \u0445\u043e\u0434\u0438\u043b \u0432 \u0442\u0443\u0430\u043b\u0435\u0442. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439, \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u0442\u044c\u00a0<a href=\"https:\/\/www.theverge.com\/2024\/6\/10\/24175487\/ipad-calculator-app-ipados18-pencil-apple-wwdc2024\" rel=\"noopener noreferrer nofollow\">\u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440 \u043d\u0430 iPad<\/a>, \u043d\u043e \u0438\u00a0<a href=\"https:\/\/www.simplymac.com\/apps\/how-accurate-is-the-iphone-compass\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u043e\u0447\u043d\u044b\u0439<\/a>\u00a0\u043a\u043e\u043c\u043f\u0430\u0441 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435. \u0415\u0433\u043e-\u0442\u043e \u044f \u0438 \u0441\u0442\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.\u00a0<\/p>\n<p>\u041c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f \u0431\u044b\u043b\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0439 \u043f\u0451\u0441 \u0443\u0441\u0430\u0436\u0438\u0432\u0430\u043b\u0441\u044f \u043f\u043e\u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u044f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043a\u043e\u043c\u043f\u0430\u0441\u043e\u043c, \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b \u0435\u0433\u043e \u0432\u0434\u043e\u043b\u044c \u0441\u043e\u0431\u0430\u0447\u044c\u0435\u0439 \u0442\u0443\u0448\u043a\u0438 \u0438 \u0434\u0435\u043b\u0430\u043b \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442. \u0412 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0430\u0432\u0442\u043e\u0440\u044b \u043e\u0447\u0435\u043d\u044c \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u043b\u0438 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 &#171;<em>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u0441\u0430 \u043f\u043e \u0433\u0440\u0443\u0434\u043d\u043e\u043c\u0443 \u043e\u0442\u0434\u0435\u043b\u0443 \u043f\u043e\u0437\u0432\u043e\u043d\u043e\u0447\u043d\u0438\u043a\u0430 (\u043c\u0435\u0436\u0434\u0443 \u043b\u043e\u043f\u0430\u0442\u043a\u0430\u043c\u0438) \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0433\u043e\u043b\u043e\u0432\u044b<\/em>&#171;. \u041e\u0447\u0435\u043d\u044c \u043d\u0430\u0443\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043a\u0430\u0437\u0430\u0442\u044c &#171;\u0441\u0442\u0440\u0435\u043b\u043a\u0430 \u043a\u043e\u043c\u043f\u0430\u0441\u0430 \u0438 \u0433\u043e\u043b\u043e\u0432\u0430 \u0441\u043e\u0431\u0430\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443&#187;.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/96e\/21c\/9e7\/96e21c9e785ac07b0d83fd00f61e6b88.png\" alt=\"\u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0430\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0438\u0437 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.\" title=\"\u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0430\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0438\u0437 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.\u00a0\" width=\"1400\" height=\"975\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/96e\/21c\/9e7\/96e21c9e785ac07b0d83fd00f61e6b88.png\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0430\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0438\u0437 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.\u00a0<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u044d\u0442\u0443 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u044f \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043b, \u0432 \u043e\u0431\u0449\u0435\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, 150 \u0441 \u043b\u0438\u0448\u043d\u0438\u043c \u0440\u0430\u0437 \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u044f\u0446\u0435\u0432. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u043e \u043b\u043e\u0432\u0438\u0442\u044c \u0432\u0437\u0433\u043b\u044f\u0434\u044b \u043f\u0440\u043e\u0445\u043e\u0436\u0438\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043d\u043e \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b\u0438, \u043f\u043e\u0447\u0435\u043c\u0443 \u044f \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0440\u0443\u044e \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0442\u0438\u043c\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0431\u0430\u0447\u044c\u0435\u0439 \u0436\u0438\u0437\u043d\u0438. \u0421\u0442\u043e\u0438\u043b\u043e \u043b\u0438 \u043e\u043d\u043e \u0442\u043e\u0433\u043e? \u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u0441\u0451 \u0443\u0437\u043d\u0430\u0435\u043c.\u00a0<\/p>\n<h2>\u0410\u043d\u0430\u043b\u0438\u0437<\/h2>\n<p>\u042f \u043a\u0440\u0430\u0442\u043a\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0433\u0438\u043f\u043e\u0442\u0435\u0437.\u00a0<\/p>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u043d\u0430 \u043c\u043e\u0439 \u0433\u0438\u0442\u0445\u0430\u0431:\u00a0<a href=\"https:\/\/github.com\/DmitrySerg\/data-wondering\/tree\/main\/bayesian-dog-poop\" rel=\"noopener noreferrer nofollow\">Data Wondering<\/a>.\u00a0<\/p>\n<h3>\u041a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f?\u00a0<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u0440\u0443\u043a\u0430\u0445 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0441\u0435\u0440\u0438\u044f \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u0441\u0430:\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d95\/b78\/5a8\/d95b785a8d8cf01e3ef2912067589b31.png\" alt=\"\u0421\u043a\u0440\u0438\u0448\u043d\u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u0441\u0430\" title=\"\u0421\u043a\u0440\u0438\u0448\u043d\u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u0441\u0430\" width=\"1400\" height=\"981\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d95\/b78\/5a8\/d95b785a8d8cf01e3ef2912067589b31.png\"\/><\/p>\n<div><figcaption>\u0421\u043a\u0440\u0438\u0448\u043d\u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u0441\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0411\u0443\u0434\u0443\u0447\u0438 \u0432 \u043c\u0435\u0440\u0443 \u043b\u0435\u043d\u0438\u0432\u044b\u043c, \u044f \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u0445\u043e\u0442\u0435\u043b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0431\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043e\u0432. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e, \u044f \u0440\u0435\u0448\u0438\u043b \u0431\u044b\u0441\u0442\u0440\u0435\u043d\u044c\u043a\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/93a\/7a8\/15a\/93a7a815a083b634b9ed9900fa5abc2d.png\" alt=\"\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438\" title=\"\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438\" width=\"1146\" height=\"536\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/93a\/7a8\/15a\/93a7a815a083b634b9ed9900fa5abc2d.png\"\/><\/p>\n<div><figcaption>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0431\u044b\u043b\u0430 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e\u0439:\u00a0\u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043d\u0435 \u0431\u044b\u043b\u0430 \u043d\u0443\u0436\u043d\u0430 \u2014 \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u0432\u043d\u0438\u0437\u0443 \u044d\u043a\u0440\u0430\u043d\u0430. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u0434\u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0435\u0433\u043a\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043e\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Optical_character_recognition\" rel=\"noopener noreferrer nofollow\">OCR<\/a>). \u042f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430\u00a0<a href=\"https:\/\/github.com\/JaidedAI\/EasyOCR\" rel=\"noopener noreferrer nofollow\"><code>easyocr<\/code><\/a>, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u043c\u043e\u0436\u0435\u0442, \u0438 \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u0448\u0443\u0441\u0442\u0440\u0430\u044f, \u043d\u043e \u0437\u0430\u0442\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0438 \u0441 \u043d\u0435\u0439 \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.\u00a0<\/p>\n<p>\u042f \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f\u00a0easyocr\u00a0\u0438 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438,\u00a0<a href=\"https:\/\/opencv.org\/\" rel=\"noopener noreferrer nofollow\"><code>opencv<\/code><\/a> \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u0430\u0441\u0430 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u0433\u043e:\u00a0<\/p>\n<pre><code class=\"python\">import cv2 import os  image_dir = '..\/data\/raw\/' img = cv2.imread(image_dir + 'IMG_6828.png')  plt.imshow(img) plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/80d\/4bf\/bc7\/80d4bfbc759efbe4484f589ca20431e0.png\" alt=\"\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\" title=\"\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\" width=\"1400\" height=\"1057\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/80d\/4bf\/bc7\/80d4bfbc759efbe4484f589ca20431e0.png\"\/><\/p>\n<div><figcaption>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u044e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0447\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u043c\u0435\u043d\u0435\u0435 \u0448\u0443\u043c\u043d\u044b\u043c:\u00a0<\/p>\n<pre><code class=\"python\">gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) plt.imshow(gray, cmap='gray') plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d38\/9a9\/a5a\/d389a9a5aa6d43cf6c8ed6afe7c2a9c8.png\" alt=\"\u0427\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430\" title=\"\u0427\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430\" width=\"1400\" height=\"1070\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d38\/9a9\/a5a\/d389a9a5aa6d43cf6c8ed6afe7c2a9c8.png\"\/><\/p>\n<div><figcaption>\u0427\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u044f \u043e\u0431\u0440\u0435\u0437\u0430\u044e \u0432\u0441\u0435 \u043b\u0438\u0448\u043d\u0435\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043d\u0443\u0436\u043d\u043e\u0439 \u043c\u043d\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/be7\/d40\/9a2\/be7d409a2eacb56505db720bdd98287e.png\" alt=\"\u041e\u0431\u0440\u0435\u0437\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\" title=\"\u041e\u0431\u0440\u0435\u0437\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\" width=\"1400\" height=\"476\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/be7\/d40\/9a2\/be7d409a2eacb56505db720bdd98287e.png\"\/><\/p>\n<div><figcaption>\u041e\u0431\u0440\u0435\u0437\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f\u00a0<code>easyocr<\/code>\u00a0\u044f \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e \u0447\u0438\u0441\u043b\u043e \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438. \u041f\u043e\u043c\u0438\u043c\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430, \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0435\u0449\u0435 \u0438 \u043e\u0446\u0435\u043d\u043a\u0443 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 (confidence score), \u043d\u043e \u0434\u043b\u044f \u043c\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e.\u00a0<\/p>\n<pre><code class=\"python\">import easyocr  reader = easyocr.Reader(['en']) result = reader.readtext(gray[1850:2100, 200:580]) for bbox, text, prob in result:     print(f\"Detected text: {text} with confidence {prob}\")<\/code><\/pre>\n<pre><code class=\"markdown\">&gt;&gt; Detected text: 340 with confidence 0.999995182215476<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0451! \u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0446\u0438\u043a\u043b, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430\u043c, \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 CSV \u0444\u0430\u0439\u043b.\u00a0<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u043b\u043d\u044b\u0439 \u043d\u043e\u0443\u0442\u0431\u0443\u043a \u0441 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433\u043e\u043c:\u00a0<a href=\"https:\/\/github.com\/DmitrySerg\/data-wondering\/blob\/main\/bayesian-dog-poop\/notebooks\/0-data-preprocessing.ipynb\" rel=\"noopener noreferrer nofollow\">Data Preprocessing<\/a>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c35\/1d9\/b80\/c351d9b8059da928967d7753cab397da.png\" alt=\"\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434 \u0434\u0430\u043d\u043d\u044b\u0445\" title=\"\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434 \u0434\u0430\u043d\u043d\u044b\u0445\" width=\"1400\" height=\"401\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c35\/1d9\/b80\/c351d9b8059da928967d7753cab397da.png\"\/><\/p>\n<div><figcaption>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434 \u0434\u0430\u043d\u043d\u044b\u0445<\/figcaption><\/div>\n<\/figure>\n<h3>\u041a\u0440\u0443\u0442\u0438\u043c \u043a\u043e\u043b\u0435\u0441\u043e: \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f<\/h3>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e, \u044f \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0441 \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u043f\u043e\u0438\u0437\u0443\u0447\u0430\u0442\u044c. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0445 \u043d\u0430\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439, \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e: &#171;\u043a\u043e\u043d\u0446\u044b&#187; \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c.\u00a0<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u043e\u0432 \u0432 \u0434\u043d\u0435, \u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 23:00 \u0438 00:00 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0436\u0435, \u043a\u0430\u043a \u043c\u0435\u0436\u0434\u0443 00:00 \u0438 01:00. \u0418\u043b\u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043a\u043e\u043c\u043f\u0430\u0441\u043e\u043c, \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 359\u00b0\u00a0\u0438 0\u00b0\u00a0\u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u0438 \u043c\u0435\u0436\u0434\u0443 0\u00b0\u00a0\u0438 1\u00b0.\u00a0<\/p>\n<p>\u0414\u0430\u0436\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043c\u0435\u0436\u0434\u0443 360\u00b0\u00a0\u0438 0\u00b0\u00a0\u0434\u0430\u0441\u0442 \u043d\u0430\u043c 180\u00b0, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0438 360\u00b0,\u00a0\u0438 0\u00b0\u00a0\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438.\u00a0<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u044f \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 \u0441\u0432\u043e\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. \u042f \u043f\u0435\u0440\u0435\u0432\u0435\u043b \u0433\u0440\u0430\u0434\u0443\u0441\u044b \u043a\u043e\u043c\u043f\u0430\u0441\u0430 \u0432 \u0440\u0430\u0434\u0438\u0430\u043d\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:\u00a0<a href=\"https:\/\/pingouin-stats.org\/build\/html\/generated\/pingouin.convert_angles.html#pingouin.convert_angles\" rel=\"noopener noreferrer nofollow\"><code>pingouin<\/code><\/a>, \u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0447\u0435\u0440\u0435\u0437\u00a0circ_mean:<\/p>\n<pre><code class=\"python\">from pingouin import circ_mean  arithmetic_mean = data['radians'].mean() circular_mean = circ_mean(data['radians'])  print(f\"Arithmetic mean: {arithmetic_mean:.3f}; Circular mean: {circular_mean:.3f}\")<\/code><\/pre>\n<pre><code>&gt;&gt; Arithmetic mean: 0.082; Circular mean: 2.989<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u0441\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u00a0<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.stats.vonmises.html\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430<\/a>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f.\u00a0<\/p>\n<blockquote>\n<p>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430 \u2014 \u044d\u0442\u043e \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u041e\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0443\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438: \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u043b\u043e\u043a\u0430\u0446\u0438\u0435\u0439<img decoding=\"async\" class=\"formula inline\" source=\"\\mu\" alt=\"\\mu\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c\/c9\/c9f\/c9faf6ead2cd2c2187bd943488de1d0a.svg\" width=\"auto\" height=\"auto\"\/>\u0438 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0435\u0439<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\kappa\" alt=\"\\kappa\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/980\/a79\/9b8\/980a799b84d9eba62a9238a55fd1c760.svg\" width=\"11\" height=\"12\"\/>. \u041a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0431\u0440\u043e\u0441 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0438. \u041a\u043e\u0433\u0434\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440<img decoding=\"async\" class=\"formula inline\" source=\"\\kappa\" alt=\"\\kappa\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2\/26\/269\/269cb4a8704d5fb203ad10436efe52d1.svg\" width=\"auto\" height=\"auto\"\/>\u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c, \u043f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e.\u00a0<\/p>\n<\/blockquote>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:\u00a0<\/p>\n<pre><code class=\"python\">import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns  from scipy.stats import vonmises from pingouin import convert_angles from typing import Tuple, List   def vonmises_kde(series: np.ndarray, kappa: float, n_bins: int = 100) -&gt; Tuple[np.ndarray, np.ndarray]:     \"\"\"     Estimate a von Mises kernel density estimate (KDE) over circular data using scipy.          Parameters:     series: np.ndarray          The input data in radians, expected to be a 1D array.     kappa: float         The concentration parameter for the von Mises distribution.     n_bins: int         The number of bins for the KDE estimate (default is 100).          Returns:     bins: np.ndarray         The bin edges (x-values) used for the KDE.     kde: np.ndarray         The estimated density values (y-values) for each bin.     \"\"\"     bins = np.linspace(-np.pi, np.pi, n_bins)     kde = np.zeros(n_bins)          for angle in series:         kde += vonmises.pdf(bins, kappa, loc=angle)          kde = kde \/ len(series)     return bins, kde   def plot_circular_distribution(     data: pd.DataFrame,     plot_type: str = 'kde',     bins: int = 30,     figsize: tuple = (4, 4),     **kwargs ) -&gt; None:     \"\"\"     Plot a compass rose with either KDE or histogram for circular data.          Parameters:     -----------     data: pd.DataFrame         DataFrame containing 'degrees'and 'radians' columns with circular data     plot_type: str         Type of plot to create: 'kde' or 'histogram'     bins: int         Number of bins for histogram or smoothing parameter for KDE     figsize: tuple         Figure size as (width, height)     **kwargs: dict         Additional styling arguments for histogram (color, edgecolor, etc.)     \"\"\"     plt.figure(figsize=figsize)     ax = plt.subplot(111, projection='polar')      ax.set_theta_zero_location('N')     ax.set_theta_direction(-1)      # add cardinal directions     directions = ['N', 'E', 'S', 'W']     angles = [0, np.pi \/ 2, np.pi, 3 * np.pi \/ 2]     for direction, angle in zip(directions, angles):         ax.text(             angle, 0.45, direction,             horizontalalignment='center',             verticalalignment='center',             fontsize=12,             weight='bold'         )      if plot_type.lower() == 'kde':         x, kde = vonmises_kde(data['radians'].values, bins)         ax.plot(x, kde, color=kwargs.get('color', 'red'), lw=2)          elif plot_type.lower() == 'histogram':         hist_kwargs = {             'color': 'teal',             'edgecolor': 'black',             'alpha': 0.7         }         hist_kwargs.update(kwargs)                   angles_rad = np.deg2rad(data['degrees'].values)         counts, bin_edges = np.histogram(             angles_rad,              bins=bins,              range=(0, 2*np.pi),              density=True         )         widths = np.diff(bin_edges)         ax.bar(             bin_edges[:-1],             counts,             width=widths,             align='edge',             **hist_kwargs         )          else:         raise ValueError(\"plot_type must be either 'kde' or 'histogram'\")          ax.xaxis.grid(True, linestyle='--', alpha=0.5)     ax.yaxis.grid(True, linestyle='--', alpha=0.5)     ax.set_yticklabels([])      plt.show()<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0438:\u00a0<\/p>\n<pre><code class=\"python\">data = pd.read_csv('..\/data\/processed\/compass_degrees.csv', index_col=0) data['radians'] = convert_angles(data['degrees'], low=0, high=360)  plot_circular_distribution(data, plot_type='histogram', figsize=(6, 6)) plot_circular_distribution(data, plot_type='kde', figsize=(5, 5))<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/290\/efc\/399\/290efc3994a8f50a9939c81b3975d6ea.png\" alt=\"\u041a\u0440\u0443\u0433\u043e\u0432\u0430\u044f \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043e\u0431\u0430\u0447\u044c\u0438\u0445 \u0434\u0435\u043b\" title=\"\u041a\u0440\u0443\u0433\u043e\u0432\u0430\u044f \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043e\u0431\u0430\u0447\u044c\u0438\u0445 \u0434\u0435\u043b\" width=\"1400\" height=\"854\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/290\/efc\/399\/290efc3994a8f50a9939c81b3975d6ea.png\"\/><\/p>\n<div><figcaption>\u041a\u0440\u0443\u0433\u043e\u0432\u0430\u044f \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043e\u0431\u0430\u0447\u044c\u0438\u0445 \u0434\u0435\u043b<\/figcaption><\/div>\n<\/figure>\n<p>\u0423\u0436\u0435 \u0438\u0437 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u0410\u0443\u0440\u0438 \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0415\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0447\u0435\u0442\u043a\u0438\u0439 \u043f\u0438\u043a, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 \u0421\u0435\u0432\u0435\u0440, \u0438 \u044f\u0432\u043d\u044b\u0439 \u0441\u0434\u0432\u0438\u0433 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u042e\u0433\u0430. \u041d\u0435\u043f\u043b\u043e\u0445\u043e!\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3a6\/d35\/ba0\/3a6d35ba080686b761ae60ed5e9aed61.png\" alt=\"\u041a\u0440\u0443\u0433\u043e\u0432\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 (KDE)\" title=\"\u041a\u0440\u0443\u0433\u043e\u0432\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 (KDE)\" width=\"1400\" height=\"940\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3a6\/d35\/ba0\/3a6d35ba080686b761ae60ed5e9aed61.png\"\/><\/p>\n<div><figcaption>\u041a\u0440\u0443\u0433\u043e\u0432\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 (KDE)<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430 \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 (KDE) \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u0433\u043b\u0430\u0436\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0418 \u0432\u0441\u0451 \u0435\u0449\u0451 \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u0430.\u00a0<\/p>\n<p>\u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u044d\u0442\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438!\u00a0<\/p>\n<h3>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u0441\u043e\u0431\u0430\u0447\u044c\u0438 \u0434\u0435\u043b\u0430<\/h3>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0434\u043b\u044f \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0443\u0436\u043d\u044b \u043e\u0441\u043e\u0431\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0434\u043b\u044f \u043d\u0438\u0445 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b.\u00a0<\/p>\n<p>\u042f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442\u043e\u0432 \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u00a0<a href=\"https:\/\/pingouin-stats.org\/\" rel=\"noopener noreferrer nofollow\">pingouin<\/a>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b. \u041f\u0435\u0440\u0432\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u2014 \u044d\u0442\u043e\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Rayleigh_test\" rel=\"noopener noreferrer nofollow\">Rayleigh test<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0443\u043b\u0435\u0432\u0430\u044f \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u043f\u043e \u043a\u0440\u0443\u0433\u0443, \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u2014 \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a.\u00a0<\/p>\n<pre><code class=\"python\">from pingouin import circ_rayleigh  z, pval = circ_rayleigh(data['radians']) print(f\"Z-statistics: {z:.3f}; p-value: {pval:.6f}\")<\/code><\/pre>\n<pre><code>&gt;&gt; Z-statistics: 3.893; p-value: 0.020128<\/code><\/pre>\n<p>\u0425\u043e\u0440\u043e\u0448\u0438\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438! \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 p-value \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043c\u0435\u043d\u044c\u0448\u0435 0.05, \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u0432\u0435\u0440\u0433\u043d\u0443\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u0443\u044e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443. \u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0410\u0443\u0440\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0443\u0430\u043b\u0435\u0442\u0430 \u043d\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e!\u00a0<\/p>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0438\u043d\u0443\u0441 \u2014 \u0432 \u043f\u0440\u0435\u0434\u043f\u043e\u0441\u044b\u043b\u043a\u0430\u0445 \u0442\u0435\u0441\u0442\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0443\u043d\u0438\u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u043c (\u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u0438\u043a), \u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u043a\u043e\u0439 \u0438\u0437 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430. \u041d\u0443 \u0447\u0442\u043e \u0436, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0447\u0442\u043e-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435. \u0423 \u0410\u0443\u0440\u0438 \u044f\u0432\u043d\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u044e\u0431\u0438\u043c\u044b\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439.\u00a0<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043d\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u2014\u00a0<a href=\"https:\/\/pingouin-stats.org\/build\/html\/generated\/pingouin.circ_vtest.html\" rel=\"noopener noreferrer nofollow\">V-test<\/a>. \u041e\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0435\u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0441\u0440\u0435\u0434\u043d\u0438\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c. \u0418\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a \u0442\u0435\u0441\u0442\u0443:\u00a0<\/p>\n<blockquote>\n<p>V-\u0442\u0435\u0441\u0442 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u044e, \u0447\u0435\u043c \u0442\u0435\u0441\u0442 Rayleigh, \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u0435\u043d, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438.\u00a0<\/p>\n<\/blockquote>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c.\u00a0<\/p>\n<p>\u0418\u0437 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0432\u044b\u0448\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0410\u0443\u0440\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0442\u044f\u0433\u043e\u0442\u0435\u0435\u0442 \u043a \u044e\u0436\u043d\u043e\u043c\u0443 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e. \u042f \u0437\u0430\u0434\u0430\u043c \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u043a<img decoding=\"async\" class=\"formula inline\" source=\"\\pi\" alt=\"\\pi\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4\/4f\/4f0\/4f08e3dba63dc6d40b22952c7a9dac6d.svg\" width=\"auto\" height=\"auto\"\/>\u0440\u0430\u0434\u0438\u0430\u043d (\u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044e\u0433\u0443) \u0438 \u043f\u0440\u043e\u0433\u043e\u043d\u044e \u0442\u0435\u0441\u0442.<\/p>\n<pre><code class=\"python\">from pingouin import circ_vtest  v, pval = circ_vtest(data['radians'], dir=np.pi) print(f\"V-statistics: {v:.3f}; p-value: {pval:.6f}\")<\/code><\/pre>\n<pre><code>&gt;&gt; V-statistics: 24.127; p-value: 0.002904<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u043c\u044b \u0438 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u043a \u0447\u0435\u043c\u0443-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443! \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 p-value \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u043b\u044e, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u0441\u043d\u043e\u0432\u0430 \u0432\u043f\u0440\u0430\u0432\u0435 \u043e\u0442\u0432\u0435\u0440\u0433\u043d\u0443\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u0443\u044e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443. \u0410\u0443\u0440\u0438 \u2014 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0439 \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0443\u0436\u0434\u0443 \u043c\u043e\u0440\u0434\u043e\u0439 \u043d\u0430 \u044e\u0433!<\/p>\n<h3>\u0411\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u0430\u044f \u0441\u043e\u0431\u0430\u043a\u0430: \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h3>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u2014 \u043a\u043e\u0435-\u0447\u0442\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0435. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0431\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u043e\u0446\u0435\u043d\u043a\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0438. \u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430: \u044f \u043d\u0430\u0447\u043d\u0443 \u0441 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u0433\u043e \u0430\u043f\u0440\u0438\u043e\u0440\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438 \u0431\u0443\u0434\u0443 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u043e\u0432\u044b\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u041f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0444\u0430\u043d\u0430\u0442 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439, \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0443 \u0441 \u043a\u043b\u0430\u0441\u0441\u043d\u044b\u043c\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438!\u00a0<\/p>\n<p><strong>1.<\/strong>\u00a0<strong>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430<\/strong><br \/>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(\\theta | \\mu, \\kappa)\" alt=\"p(\\theta | \\mu, \\kappa)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aa9\/56f\/a76\/aa956fa76e12c4e5a98da4f6200a4423.svg\" width=\"72\" height=\"22\"\/>\u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"p(\\theta | \\mu, \\kappa) = \\frac{\\exp(\\kappa \\cos(\\theta - \\mu))}{2 \\pi I_0(\\kappa)}\" alt=\"p(\\theta | \\mu, \\kappa) = \\frac{\\exp(\\kappa \\cos(\\theta - \\mu))}{2 \\pi I_0(\\kappa)}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b56\/383\/65f\/b5638365f9f502c0444b1fb3cef63e21.svg\" width=\"251\" height=\"50\"\/><\/p>\n<p>\u0433\u0434\u0435:<\/p>\n<ul>\n<li>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\mu\" alt=\"\\mu\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b0\/cdb\/0f0\/8b0cdb0f08183e81be5b80fa0867c5bf.svg\" width=\"12\" height=\"16\"\/>\u2014 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\kappa\" alt=\"\\kappa\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/167\/8a9\/c0d\/1678a9c0d6c7bc48d5b1d73d07d81d15.svg\" width=\"11\" height=\"12\"\/>\u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438 (\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c\u0443 \u043e\u0442 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0438 \u0432 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438)<\/p>\n<\/li>\n<li>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"I_0(\\kappa)\" alt=\"I_0(\\kappa)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/030\/4dc\/4e3\/0304dc4e30e830b226260023f8eb1584.svg\" width=\"44\" height=\"22\"\/>\u2014 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0411\u0435\u0441\u0441\u0435\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u043e\u0434\u0430, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0430\u044f \u0437\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<p><strong>2. \u0410\u043f\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c:<\/p>\n<ul>\n<li>\n<p><strong>\u0410\u043f\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/strong><img decoding=\"async\" class=\"formula inline\" source=\"p(\\theta | \\mu_{\\text{prior}}, \\kappa_{\\text{prior}})\" alt=\"p(\\theta | \\mu_{\\text{prior}}, \\kappa_{\\text{prior}})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/6c\/6c6\/6c66318a3b9f096fd0e06902e28ac57b.svg\" width=\"auto\" height=\"auto\"\/>\u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438<img decoding=\"async\" class=\"formula inline\" source=\"(\\mu_{\\text{prior}}, \\kappa_{\\text{prior}})\" alt=\"(\\mu_{\\text{prior}}, \\kappa_{\\text{prior}})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8d\/8d8\/8d821825f58787657ac3a1a66000fe42.svg\" width=\"auto\" height=\"auto\"\/><\/p>\n<\/li>\n<li>\n<p><strong>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f<\/strong><img decoding=\"async\" class=\"formula inline\" source=\"p(\\theta | \\theta_n, \\kappa_{\\text{likelihood}})\" alt=\"p(\\theta | \\theta_n, \\kappa_{\\text{likelihood}})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e\/ec\/ec6\/ec62d198a424b4957fee95e0258f9796.svg\" width=\"auto\" height=\"auto\"\/>\u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f<img decoding=\"async\" class=\"formula inline\" source=\"\\theta_n\" alt=\"\\theta_n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a3\/a30\/a3026e320c132de94f7c8ebb952bda60.svg\" width=\"auto\" height=\"auto\"\/>\u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438<img decoding=\"async\" class=\"formula inline\" source=\"(\\theta_n, \\kappa_{\\text{likelihood}})\" alt=\"(\\theta_n, \\kappa_{\\text{likelihood}})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/6f\/6fd\/6fd833ef9991afad991df2b20a740548.svg\" width=\"auto\" height=\"auto\"\/><\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430\u0448\u0435 \u0430\u043f\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u043e\u0440\u0435\u043c\u044b \u0411\u0430\u0439\u0435\u0441\u0430:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"p(\\theta | \\text{data}) \\propto p(\\theta | \\mu_{\\text{prior}}, \\kappa_{\\text{prior}}) \\cdot p(\\text{data} | \\theta)\" alt=\"p(\\theta | \\text{data}) \\propto p(\\theta | \\mu_{\\text{prior}}, \\kappa_{\\text{prior}}) \\cdot p(\\text{data} | \\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/37c\/2fd\/8e6\/37c2fd8e6555436e83e771df2bed7f16.svg\" width=\"331\" height=\"23\"\/><\/p>\n<p>\u0433\u0434\u0435<img decoding=\"async\" class=\"formula inline\" source=\"p(\\text{data} | \\theta) = p(\\theta | \\theta_n, \\kappa_{\\text{likelihood}})\" alt=\"p(\\text{data} | \\theta) = p(\\theta | \\theta_n, \\kappa_{\\text{likelihood}})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/fd\/fd1\/fd1d8aea8ac73ec2536d23ea47c6a28f.svg\" width=\"auto\" height=\"auto\"\/><\/p>\n<h3>3. \u041f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u043f\u0440\u0438\u043e\u0440\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430<\/h3>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438<img decoding=\"async\" class=\"formula inline\" source=\"(\\mu_1, \\kappa_1)\" alt=\"(\\mu_1, \\kappa_1)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/91\/91a\/91a0824cb412240a19b389e8d7cf384b.svg\" width=\"auto\" height=\"auto\"\/>\u0438<img decoding=\"async\" class=\"formula inline\" source=\"(\\mu_2, \\kappa_2)\" alt=\"(\\mu_2, \\kappa_2)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2\/24\/243\/24397fc96ad8998adf24a8737077c7f3.svg\" width=\"auto\" height=\"auto\"\/>\u0442\u0430\u043a\u0436\u0435 \u0434\u0430\u0451\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430, \u043d\u043e \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<p>\u0418\u043c\u0435\u044f:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"p(\\theta | \\mu_{\\text{prior}}, \\kappa_{\\text{prior}}) = \\frac{\\exp(\\kappa_{\\text{prior}} \\cos(\\theta - \\mu_{\\text{prior}}))}{2 \\pi I_0(\\kappa_{\\text{prior}})}\" alt=\"p(\\theta | \\mu_{\\text{prior}}, \\kappa_{\\text{prior}}) = \\frac{\\exp(\\kappa_{\\text{prior}} \\cos(\\theta - \\mu_{\\text{prior}}))}{2 \\pi I_0(\\kappa_{\\text{prior}})}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ed4\/f49\/50b\/ed4f4950b1fd0a724b6b32435519cac3.svg\" width=\"377\" height=\"52\"\/><\/p>\n<p>\u0438\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"p(\\theta | \\theta_n, \\kappa_{\\text{likelihood}}) = \\frac{\\exp(\\kappa_{\\text{likelihood}} \\cos(\\theta - \\theta_n))}{2 \\pi I_0(\\kappa_{\\text{likelihood}})}\" alt=\"p(\\theta | \\theta_n, \\kappa_{\\text{likelihood}}) = \\frac{\\exp(\\kappa_{\\text{likelihood}} \\cos(\\theta - \\theta_n))}{2 \\pi I_0(\\kappa_{\\text{likelihood}})}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e5c\/d15\/5a8\/e5cd155a872d6e885bd9aa338873b684.svg\" width=\"387\" height=\"50\"\/><\/p>\n<p>\u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044e:\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"p(\\theta | \\text{data}) \\propto \\exp(\\kappa_{\\text{prior}} \\cos(\\theta - \\mu_{\\text{prior}})) \\cdot \\exp(\\kappa_{\\text{likelihood}} \\cos(\\theta - \\theta_n))\" alt=\"p(\\theta | \\text{data}) \\propto \\exp(\\kappa_{\\text{prior}} \\cos(\\theta - \\mu_{\\text{prior}})) \\cdot \\exp(\\kappa_{\\text{likelihood}} \\cos(\\theta - \\theta_n))\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b1e\/cf6\/5b0\/b1ecf65b0c5502d19d1a8b13e8767332.svg\" width=\"541\" height=\"23\"\/><\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u0443\u043c\u043c\u044b \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043e\u0432:\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\begin {align*} \\cos(\\theta - \\mu_{\\text{prior}}) + \\cos(\\theta - \\theta_n) = &amp;\\cos(\\theta) ( \\cos(\\mu_{\\text{prior}}) + \\cos(\\theta_n)) \\\\ &amp; + \\sin(\\theta) (\\sin(\\mu_{\\text{prior}}) + \\sin(\\theta_n)) \\end {align*}\" alt=\"\\begin {align*} \\cos(\\theta - \\mu_{\\text{prior}}) + \\cos(\\theta - \\theta_n) = &amp;\\cos(\\theta) ( \\cos(\\mu_{\\text{prior}}) + \\cos(\\theta_n)) \\\\ &amp; + \\sin(\\theta) (\\sin(\\mu_{\\text{prior}}) + \\sin(\\theta_n)) \\end {align*}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/374\/18b\/336\/37418b33641cd5db1e3e57b7d93254c9.svg\" width=\"515\" height=\"52\"\/><\/p>\n<p>\u0418\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\begin{align*} p(\\theta | \\text{data}) \\propto &amp; \\exp\\Big(\\left(\\kappa_{\\text{prior}} \\cos(\\mu_{\\text{prior}}) + \\kappa_{\\text{likelihood}} \\cos(\\theta_n)\\right) \\cos(\\theta) \\\\ &amp; + \\left(\\kappa_{\\text{prior}} \\sin(\\mu_{\\text{prior}}) + \\kappa_{\\text{likelihood}} \\sin(\\theta_n)\\right) \\sin(\\theta)\\Big) \\end{align*}\" alt=\"\\begin{align*} p(\\theta | \\text{data}) \\propto &amp; \\exp\\Big(\\left(\\kappa_{\\text{prior}} \\cos(\\mu_{\\text{prior}}) + \\kappa_{\\text{likelihood}} \\cos(\\theta_n)\\right) \\cos(\\theta) \\\\ &amp; + \\left(\\kappa_{\\text{prior}} \\sin(\\mu_{\\text{prior}}) + \\kappa_{\\text{likelihood}} \\sin(\\theta_n)\\right) \\sin(\\theta)\\Big) \\end{align*}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e98\/b2a\/2c5\/e98b2a2c5953d13f4467d607041f13f2.svg\" width=\"508\" height=\"80\"\/><\/p>\n<p><strong>4. \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043f\u043e\u043b\u044f\u0440\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0434\u043b\u044f \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u00a0<\/strong><\/p>\n<p>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u044b\u0432\u043e\u043a! \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0448\u0435 \u2014 \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430, \u0437\u0430\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u043e\u0440\u043c\u0435. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u043b\u044f\u0440\u043d\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0446\u0435\u043d\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438.\u00a0<\/p>\n<p>\u041f\u0443\u0441\u0442\u044c:\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"C = \\kappa_{\\text{prior}} \\cos(\\mu_{\\text{prior}}) + \\kappa_{\\text{likelihood}} \\cos(\\theta_n)\" alt=\"C = \\kappa_{\\text{prior}} \\cos(\\mu_{\\text{prior}}) + \\kappa_{\\text{likelihood}} \\cos(\\theta_n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dff\/868\/21e\/dff86821e4984293bf9597e5787c882b.svg\" width=\"331\" height=\"23\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"S = \\kappa_{\\text{prior}} \\sin(\\mu_{\\text{prior}}) + \\kappa_{\\text{likelihood}} \\sin(\\theta_n)\" alt=\"S = \\kappa_{\\text{prior}} \\sin(\\mu_{\\text{prior}}) + \\kappa_{\\text{likelihood}} \\sin(\\theta_n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/482\/fed\/898\/482fed89831a23e68bb6897ed09ab15a.svg\" width=\"324\" height=\"23\"\/><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442\u0441\u044f \u0434\u043e:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"p(\\theta | \\text{data}) \\propto \\exp(C \\cos(\\theta) + S \\sin(\\theta))\" alt=\"p(\\theta | \\text{data}) \\propto \\exp(C \\cos(\\theta) + S \\sin(\\theta))\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9fe\/84c\/d85\/9fe84cd85a8db3ef992285d642c4e260.svg\" width=\"307\" height=\"22\"\/><\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u044d\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e<img decoding=\"async\" class=\"formula inline\" source=\"C \\cos(\\theta) + S \\sin(\\theta)\" alt=\"C \\cos(\\theta) + S \\sin(\\theta)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1\/17\/177\/1778ef4717973689eed1d36b4248d259.svg\" width=\"auto\" height=\"auto\"\/>\u2014 \u044d\u0442\u043e \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432<img decoding=\"async\" class=\"formula inline\" source=\"(C, S)\" alt=\"(C, S)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/fd\/fd7\/fd7889ccb046ca825fe7d2f6cbfd7f22.svg\" width=\"auto\" height=\"auto\"\/>\u0438<img decoding=\"async\" class=\"formula inline\" source=\"(\\cos(\\theta), \\sin(\\theta))\" alt=\"(\\cos(\\theta), \\sin(\\theta))\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c\/c6\/c61\/c61ed586cb0aa0249045ee82e96e309a.svg\" width=\"auto\" height=\"auto\"\/>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"C \\cos(\\theta) + S \\sin(\\theta) = |(C, S)| \\cdot |(\\cos(\\theta), \\sin(\\theta))| \\cdot \\cos(\\phi),\" alt=\"C \\cos(\\theta) + S \\sin(\\theta) = |(C, S)| \\cdot |(\\cos(\\theta), \\sin(\\theta))| \\cdot \\cos(\\phi),\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ec9\/907\/889\/ec9907889252173b9abf3a062c0cedff.svg\" width=\"466\" height=\"22\"\/><\/p>\n<p>\u0433\u0434\u0435<img decoding=\"async\" class=\"formula inline\" source=\"\\phi\" alt=\"\\phi\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1\/1e\/1ed\/1ed346930917426bc46d41e22cc525ec.svg\" width=\"auto\" height=\"auto\"\/>\u2014 \u0443\u0433\u043e\u043b \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438<img decoding=\"async\" class=\"formula inline\" source=\"(C, S)\" alt=\"(C, S)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/fd\/fd7\/fd7889ccb046ca825fe7d2f6cbfd7f22.svg\" width=\"auto\" height=\"auto\"\/>\u0438<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"(\\cos(\\theta), \\sin(\\theta))\" alt=\"(\\cos(\\theta), \\sin(\\theta))\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a55\/e76\/3c4\/a55e763c4f863bbcb1553ef0ca3b055f.svg\" width=\"123\" height=\"22\"\/><\/p>\n<p>\u0414\u043b\u0438\u043d\u044b \u044d\u0442\u0438\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"|(C, S)| = \\sqrt{C^2 + S^2}\" alt=\"|(C, S)| = \\sqrt{C^2 + S^2}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b80\/02f\/315\/b8002f315b09cf7f1caf94266fde7721.svg\" width=\"178\" height=\"28\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"|(\\cos(\\theta), \\sin(\\theta))| = 1\" alt=\"|(\\cos(\\theta), \\sin(\\theta))| = 1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b40\/428\/ffb\/b40428ffb20d6fb8a3be5837a2915987.svg\" width=\"170\" height=\"22\"\/><\/p>\n<p>\u0423\u0433\u043e\u043b \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u043c<img decoding=\"async\" class=\"formula inline\" source=\"(\\cos(\\theta), \\sin(\\theta))\" alt=\"(\\cos(\\theta), \\sin(\\theta))\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c\/c6\/c61\/c61ed586cb0aa0249045ee82e96e309a.svg\" width=\"auto\" height=\"auto\"\/>\u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0441\u044c\u044e<img decoding=\"async\" class=\"formula inline\" source=\"x\" alt=\"x\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9dd\/9dd4e461268c8034f5c8564e155c67a6.svg\" width=\"auto\" height=\"auto\"\/>\u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e<img decoding=\"async\" class=\"formula inline\" source=\"\\theta\" alt=\"\\theta\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2\/25\/255\/2554a2bb846cffd697389e5dc8912759.svg\" width=\"auto\" height=\"auto\"\/>, \u0430 \u0443\u0433\u043e\u043b \u043c\u0435\u0436\u0434\u0443<img decoding=\"async\" class=\"formula inline\" source=\"(C, S)\" alt=\"(C, S)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/fd\/fd7\/fd7889ccb046ca825fe7d2f6cbfd7f22.svg\" width=\"auto\" height=\"auto\"\/>\u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0441\u044c\u044e<img decoding=\"async\" class=\"formula inline\" source=\"x\" alt=\"x\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9dd\/9dd4e461268c8034f5c8564e155c67a6.svg\" width=\"auto\" height=\"auto\"\/>\u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\phi = \\arctan2(S, C)\" alt=\"\\phi = \\arctan2(S, C)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/473\/701\/77d\/47370177d8fa7de2f3a63f2dde345ee9.svg\" width=\"157\" height=\"22\"\/><\/p>\n<p>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0443\u0433\u043e\u043b \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0434\u0432\u0443\u043c\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\cos(\\phi) = \\cos(\\theta - \\arctan2(S, C))\" alt=\"\\cos(\\phi) = \\cos(\\theta - \\arctan2(S, C))\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a34\/1ee\/1ba\/a341ee1ba9f5824cfdfced2b779777ed.svg\" width=\"273\" height=\"22\"\/><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"p(\\theta | \\text{data}) \\propto \\exp\\left(\\sqrt{C^2 + S^2} \\cos(\\theta - \\arctan2(S, C))\\right)\" alt=\"p(\\theta | \\text{data}) \\propto \\exp\\left(\\sqrt{C^2 + S^2} \\cos(\\theta - \\arctan2(S, C))\\right)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/86a\/6db\/286\/86a6db28672d07dcbf0f545edfea7491.svg\" width=\"444\" height=\"38\"\/><\/p>\n<p>\u0438\u043b\u0438,<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"p(\\theta | \\text{data}) \\propto \\exp\\left(\\kappa_{\\text{post}} \\cos(\\theta - \\mu_{\\text{post}})\\right)\" alt=\"p(\\theta | \\text{data}) \\propto \\exp\\left(\\kappa_{\\text{post}} \\cos(\\theta - \\mu_{\\text{post}})\\right)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/595\/abe\/62c\/595abe62cbf7e4d7a5410a988e0d9535.svg\" width=\"306\" height=\"23\"\/><\/p>\n<p>\u0433\u0434\u0435:<\/p>\n<ul>\n<li>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\kappa_{\\text{post}}\" alt=\"\\kappa_{\\text{post}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7fd\/e27\/c3b\/7fde27c3bdc962f9116e47e906ce8a6a.svg\" width=\"39\" height=\"17\"\/>\u2014 \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438:<\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"formula\" source=\"\\kappa_{\\text{post}} = \\sqrt{C^2 + S^2}\" alt=\"\\kappa_{\\text{post}} = \\sqrt{C^2 + S^2}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/67\/674\/6749c5cacd495c9ed80c4f03c2276cf0.svg\" width=\"auto\" height=\"auto\"\/><\/p>\n<ul>\n<li>\n<p><img decoding=\"async\" class=\"formula inline\" source=\"\\mu_{\\text{post}}\" alt=\"\\mu_{\\text{post}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e\/ef\/efd\/efd9c6c599134e3770e5b40a307ea103.svg\" width=\"auto\" height=\"auto\"\/>\u00a0\u2014 \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\mu_{\\text{post}} = \\arctan2(S, C)\" alt=\"\\mu_{\\text{post}} = \\arctan2(S, C)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/77c\/b89\/1d5\/77cb891d5e6c56f2b482bc5b74995b94.svg\" width=\"184\" height=\"23\"\/><\/p>\n<p>\u0423\u0440\u0430, \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u044d\u0442\u043e! \u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430 \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"(\\mu_{\\text{post}}, \\kappa_{\\text{post}})\" alt=\"(\\mu_{\\text{post}}, \\kappa_{\\text{post}})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dd0\/317\/fff\/dd0317fff8e5992e502a8f0474335f6b.svg\" width=\"102\" height=\"23\"\/>. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0430\u043f\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u043e\u0432\u044b\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435\u043c \u0438 \u0441\u043b\u0435\u0434\u0438\u0442\u044c, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<h3>\u0411\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u0430\u044f \u0441\u043e\u0431\u0430\u043a\u0430: \u0432\u0435\u0441\u0451\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h3>\n<p>\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435\u043c \u0442\u0435\u043c, \u043a\u0442\u043e \u0441\u043a\u0438\u043f\u043d\u0443\u043b \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0438 \u043c\u043e\u0451 \u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u0442\u0435\u043c, \u043a\u0442\u043e \u043f\u0440\u043e\u0431\u0440\u0430\u043b\u0441\u044f \u0441\u043a\u0432\u043e\u0437\u044c \u043d\u0435\u0451. \u041d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043a\u043e\u0434\u0438\u0442\u044c \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u041e\u043d\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439.\u00a0<\/p>\n<pre><code class=\"python\">import imageio from io import BytesIO  def get_posterior_distribution_image_array(     mu_grid: np.ndarray,      posterior_pdf: np.ndarray,      current_samples: List[float],      idx: int,      fig_size: Tuple[int, int],      dpi: int,      r_max_posterior: float ) -&gt; np.ndarray:     \"\"\"     Creates the posterior distribution and observed samples histogram on a polar plot,      converts it to an image array, and returns it for GIF processing.      Parameters:     -----------      mu_grid (np.ndarray):          Grid of mean direction values for plotting the posterior PDF.     posterior_pdf (np.ndarray):          Posterior probability density function values for the given `mu_grid`.     current_samples (List[float]):          List of observed angle samples in radians.     idx (int):          The current step index, used for labeling the plot.     fig_size (Tuple[int, int]):          Size of the plot figure (width, height).     dpi (int):          Dots per inch (resolution) for the plot.     r_max_posterior (float):          Maximum radius for the posterior PDF plot, used to set plot limits.      Returns:         np.ndarray: Image array of the plot in RGB format, suitable for GIF processing.     \"\"\"     fig = plt.figure(figsize=fig_size, dpi=dpi)     ax = plt.subplot(1, 1, 1, projection='polar')     ax.set_theta_zero_location('N')       ax.set_theta_direction(-1)       ax.plot(mu_grid, posterior_pdf, color='red', linewidth=2, label='Posterior PDF')      # observed samples histogram     n_bins = 48     hist_bins = np.linspace(-np.pi, np.pi, n_bins + 1)     hist_counts, _ = np.histogram(current_samples, bins=hist_bins)      # normalize the histogram counts     if np.max(hist_counts) &gt; 0:         hist_counts_normalized = hist_counts \/ np.max(hist_counts)     else:         hist_counts_normalized = hist_counts      bin_centers = (hist_bins[:-1] + hist_bins[1:]) \/ 2     bin_width = hist_bins[1] - hist_bins[0]      # set the maximum radius to accommodate both the posterior pdf and histogram bars     r_histogram_height = r_max_posterior * 0.9      r_max = r_max_posterior + r_histogram_height     ax.set_ylim(0, r_max)      # plot the histogram bars outside the circle     for i in range(len(hist_counts_normalized)):         theta = bin_centers[i]         width = bin_width         hist_height = hist_counts_normalized[i] * r_histogram_height         if hist_counts_normalized[i] &gt; 0:             ax.bar(                 theta, hist_height, width=width, bottom=r_max_posterior,                  color='teal', edgecolor='black', alpha=0.5             )      ax.text(         0.5, 1.1, f'Posterior Distribution (Step {idx + 1})',          transform=ax.transAxes, ha='center', va='bottom', fontsize=18     )     ax.set_yticklabels([])     ax.grid(linestyle='--')     ax.yaxis.set_visible(False)     ax.spines['polar'].set_visible(False)     plt.subplots_adjust(top=0.85, bottom=0.05, left=0.05, right=0.95)      # saving to buffer for gif processing     buf = BytesIO()     plt.savefig(buf, format='png', bbox_inches=None, pad_inches=0)     buf.seek(0)     img_array = plt.imread(buf)     img_array = (img_array * 255).astype(np.uint8)     plt.close(fig)     return img_array<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0446\u0438\u043a\u043b \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0430\u043f\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u042f \u043d\u0430\u0447\u043d\u0443 \u0441 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438, \u0440\u0430\u0432\u043d\u044b\u043c 0.<\/p>\n<p>\u0414\u043b\u044f\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\kappa_{\\text{likelihood}}\" alt=\"\\kappa_{\\text{likelihood}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9fd\/b98\/f7f\/9fdb98f7fe215db517c40bb99228c6b6.svg\" width=\"71\" height=\"15\"\/>\u044f \u0437\u0430\u0434\u0430\u043c \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0443\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438\u00a0<img decoding=\"async\" src=\"\" class=\"formula inline\"\/>. \u042d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0448\u0430\u0433 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u043c.<\/p>\n<pre><code class=\"python\"># initial prior parameters mu_prior = 0.0  # initial mean direction (any value, since kappa_prior = 0) kappa_prior = 0.0  # uniform prior over the circle  # fixed concentration parameter for the likelihood kappa_likelihood = 2.0  posterior_mus = [] posterior_kappas = []  mu_grid = np.linspace(-np.pi, np.pi, 200)  # vizualisation parameters fig_size = (10, 10) dpi = 100  current_samples = [] frames = []  for idx, theta_n in enumerate(data['radians']):      # compute posterior parameters     C = kappa_prior * np.cos(mu_prior) + kappa_likelihood * np.cos(theta_n)     S = kappa_prior * np.sin(mu_prior) + kappa_likelihood * np.sin(theta_n)     kappa_post = np.sqrt(C**2 + S**2)     mu_post = np.arctan2(S, C)      # posterior distribution     posterior_pdf = np.exp(kappa_post * np.cos(mu_grid - mu_post)) \/ (2 * np.pi * i0(kappa_post))      # store posterior parameters and observed samples     posterior_mus.append(mu_post)     posterior_kappas.append(kappa_post)     current_samples.append(theta_n)      # plot posterior distribution     r_max_posterior = max(posterior_pdf) * 1.1     img_array = get_posterior_distribution_image_array(         mu_grid,          posterior_pdf,          current_samples,          idx,          fig_size,          dpi,          r_max_posterior         )     frames.append(img_array)      # updating priors for next iteration     mu_prior = mu_post     kappa_prior = kappa_post  # Create GIF fps = 10 frames.extend([img_array]*fps*3) # repeat last frame a few times to make a \"pause\" at the end of the GIF imageio.mimsave('..\/images\/posterior_updates.gif', frames, fps=fps)<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0451! \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0433\u0438\u0444\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u043e\u0432\u044b\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435\u043c. \u0412\u043e\u0442 \u043e\u043d\u0430 \u0432\u043e \u0432\u0441\u0451\u043c \u0441\u0432\u043e\u0451\u043c \u0432\u0435\u043b\u0438\u043a\u043e\u043b\u0435\u043f\u0438\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d4e\/d3b\/688\/d4ed3b6888b7a3d39b9c6c0a9ae88daf.gif\" alt=\"\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432\" title=\"\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432\" width=\"1000\" height=\"1000\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d4e\/d3b\/688\/d4ed3b6888b7a3d39b9c6c0a9ae88daf.gif\"\/><\/p>\n<div><figcaption>\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<p>\u0421 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u043e\u0432\u044b\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435\u043c, \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u0431\u043e\u043b\u0435\u0435 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0415\u0449\u0435 \u0431\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u0440\u0430\u0441\u043d\u0443\u044e \u043b\u0438\u043d\u0438\u044e \u0441\u0438\u043b\u0443\u044d\u0442\u043e\u043c \u0410\u0443\u0440\u0438, \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u0431\u044b \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439.\u00a0<\/p>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438:\u00a0<\/p>\n<pre><code class=\"python\"># Convert posterior_mus to degrees posterior_mus_deg = np.rad2deg(posterior_mus) % 360 n_samples = data.shape[0] true_mu = data['degrees'].mean() # Plot evolution of posterior mean direction fig, ax1 = plt.subplots(figsize=(12, 6))  color = 'tab:blue' ax1.set_xlabel('Number of Observations') ax1.set_ylabel('Posterior Mean Direction (Degrees)', color=color) ax1.plot(range(1, n_samples + 1), posterior_mus_deg, marker='o', color=color) ax1.tick_params(axis='y', labelcolor=color) ax1.axhline(true_mu, color='red', linestyle='--', label='Sample Distribution Mean Direction') ax1.legend(loc='upper left') ax1.grid(True)  ax2 = ax1.twinx()  # instantiate a second axes that shares the same x-axis color = 'tab:orange' ax2.set_ylabel('Posterior Concentration Parameter (kappa)', color=color)  # we already handled the x-label with ax1 ax2.plot(range(1, n_samples + 1), posterior_kappas, marker='o', color=color) ax2.tick_params(axis='y', labelcolor=color)  fig.tight_layout()  # otherwise the right y-label is slightly clipped sns.despine() plt.title('Evolution of Posterior Mean Direction and Concentration Over Time') plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c9a\/84c\/3ff\/c9a84c3ff97289c829ab2a01e4aed1a4.png\" alt=\"\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u044f\" title=\"\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u044f\" width=\"1189\" height=\"610\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c9a\/84c\/3ff\/c9a84c3ff97289c829ab2a01e4aed1a4.png\"\/><\/p>\n<div><figcaption>\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<p>\u0413\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u043e\u0432\u044b\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435\u043c. \u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0441\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u043c\u0443 \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0443, \u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u0446\u0435\u043d\u043a\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0439.<\/p>\n<h3>\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0411\u0430\u0439\u0435\u0441\u0430: PyMC \u0434\u043b\u044f \u0441\u043e\u0431\u0430\u0447\u044c\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u0430\u0441\u0430\u00a0<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0449\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u2014 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c\u00a0<a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9A%D0%BE%D1%8D%D1%84%D1%84%D0%B8%D1%86%D0%B8%D0%B5%D0%BD%D1%82_%D0%91%D0%B0%D0%B9%D0%B5%D1%81%D0%B0\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0411\u0430\u0439\u0435\u0441\u0430<\/a>\u00a0(\u043e\u043d \u0436\u0435 \u0411\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u0438\u0439 \u0444\u0430\u043a\u0442\u043e\u0440) \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0438\u043f\u043e\u0442\u0435\u0437. \u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u2014 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043c\u0430\u0440\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u0439 \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u043a\u043e\u043d\u043a\u0443\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0433\u0438\u043f\u043e\u0442\u0435\u0437 \u0438\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.\u00a0<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0411\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u0438\u0439 \u0444\u0430\u043a\u0442\u043e\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a:\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"BF_{ij} = \\frac{p(D|M_i)}{p(D|M_j)}=\\frac{p(M_i|D)}{p(M_j|D)} \\cdot \\frac{p(M_j)}{p(M_i)}\" alt=\"BF_{ij} = \\frac{p(D|M_i)}{p(D|M_j)}=\\frac{p(M_i|D)}{p(M_j|D)} \\cdot \\frac{p(M_j)}{p(M_i)}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b39\/ad2\/114\/b39ad2114ac19dd02a2abda04c3c557a.svg\" width=\"326\" height=\"52\"\/><\/p>\n<p>\u0433\u0434\u0435:\u00a0<\/p>\n<ul>\n<li>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(D|M_i)\" alt=\"p(D|M_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b90\/788\/0e7\/b907880e7e3a4aa3a03dd5f03f521cb1.svg\" width=\"73\" height=\"22\"\/>\u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(D|M_j)\" alt=\"p(D|M_j)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/baa\/947\/3db\/baa9473db75213f309a90173486cefe1.svg\" width=\"74\" height=\"23\"\/>\u2014 \u044d\u0442\u043e \u043c\u0430\u0440\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7cb\/298\/2a5\/7cb2982a537307d80a8b64440f0605dc.svg\" width=\"7\" height=\"16\"\/>\u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"j\" alt=\"j\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9b4\/c0a\/725\/9b4c0a725d34abe71ed09f545d8399ed.svg\" width=\"8\" height=\"20\"\/><\/p>\n<\/li>\n<li>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(M_i|D)\" alt=\"p(M_i|D)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/28d\/d12\/2c2\/28dd122c2066828e9b6cdabd00a25bcf.svg\" width=\"73\" height=\"22\"\/>\u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(M_j|D)\" alt=\"p(M_j|D)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4c4\/551\/3d2\/4c45513d2d55bdd0baf0a502d7492164.svg\" width=\"74\" height=\"23\"\/>\u2014 \u044d\u0442\u043e \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(M_i)\" alt=\"p(M_i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/268\/b1a\/cd9\/268b1acd948c19e41626b4b22784f779.svg\" width=\"52\" height=\"22\"\/>\u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"p(M_j)\" alt=\"p(M_j)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/15c\/76b\/3f2\/15c76b3f26bfffc592afe208af444aff.svg\" width=\"52\" height=\"23\"\/>\u2014 \u044d\u0442\u043e \u0430\u043f\u0440\u0438\u043e\u0440\u043d\u044b\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u2014 \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0430 \u043e\u0434\u043d\u0430 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439. \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u043a \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u0411\u0430\u0439\u0435\u0441\u0430, \u043e\u0434\u0438\u043d \u0438\u0437 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u2014 \u044d\u0442\u043e \u0448\u043a\u0430\u043b\u0430 \u0414\u0436\u0435\u0444\u0444\u0440\u0438\u0441\u0430, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f\u00a0<a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B6%D0%B5%D1%84%D1%84%D1%80%D0%B8%D1%81,_%D0%93%D0%B0%D1%80%D0%BE%D0%BB%D1%8C%D0%B4\" rel=\"noopener noreferrer nofollow\">\u0413\u0430\u0440\u043e\u043b\u044c\u0434\u043e\u043c \u0414\u0436\u0435\u0444\u0444\u0440\u0438\u0441\u043e\u043c<\/a>.\u00a0<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\">\u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0411\u0430\u0439\u0435\u0441\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0418\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">&lt; 1<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041e\u0442 1 \u0434\u043e 3<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0410\u043d\u0435\u043a\u0434\u043e\u0442\u0438\u0447\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041e\u0442 3 \u0434\u043e 10<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041e\u0442 30 \u0434\u043e 100<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">&gt; 100<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0448\u0430\u044e\u0449\u0438\u0439 \u044d\u0444\u0444\u0435\u043a\u0442<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c, \u0430 \u0447\u0442\u043e \u0436\u0435 \u0437\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c? \u0412\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e! \u042d\u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u042f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c PyMC, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0442\u044c \u044d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043d\u0430\u0441\u044d\u043c\u043f\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u0437 \u043d\u0438\u0445.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u043d\u043e\u0432\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043d\u0430\u0448\u0443 \u043d\u0443\u043b\u0435\u0432\u0443\u044e \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443. \u042f \u0432\u043d\u043e\u0432\u044c \u0431\u0443\u0434\u0443 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u0435 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\kappa=0\" alt=\"\\kappa=0\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f80\/b36\/627\/f80b366271b8c26ccdae68bf5eff50c4.svg\" width=\"47\" height=\"17\"\/>, \u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u044d\u0442\u043e\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0435. \u0427\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u0437\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u043e\u043c \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f.\u00a0<\/p>\n<pre><code class=\"python\"># Calculate log likelihood for H0 log_likelihood_h0 = vonmises.logpdf(data['radians'], kappa=0, loc=0).sum()<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0432\u0435\u0434\u0435\u043c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c-\u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f: \u0443\u043d\u0438\u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0439 \u042e\u0433, \u0433\u0434\u0435 \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0410\u0443\u0440\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u043d\u0430 \u044e\u0433, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432\u043e\u043a\u0440\u0443\u0433 180\u00b0 \u043d\u0430 \u043a\u043e\u043c\u043f\u0430\u0441\u0435 \u0438\u043b\u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\pi\" alt=\"\\pi\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d38\/147\/495\/d38147495398a3a01630fb596ff91685.svg\" width=\"11\" height=\"12\"\/>\u0432 \u0440\u0430\u0434\u0438\u0430\u043d\u0430\u0445.\u00a0<\/p>\n<pre><code class=\"python\">import pymc as pm import arviz as az import arviz.data.inference_data as InferenceData from scipy.stats import halfnorm, gaussian_kde  with pm.Model() as model_uni:     # Prior for kappa      kappa = pm.HalfNormal('kappa', sigma=10)     # Likelihood     likelihood_h1 = pm.VonMises('angles', mu=np.pi, kappa=kappa, observed=data['radians'])     # Sample from posterior      trace_uni = pm.sample(         10000, tune=3000, chains=4,          return_inferencedata=True,          idata_kwargs={'log_likelihood': True})<\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0433\u0440\u0430\u0444\u0430:\u00a0<\/p>\n<pre><code class=\"python\"># Model graph pm.model_to_graphviz(model_uni)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5ee\/f70\/f0b\/5eef70f0beeae1dc56c7c58c2284d3a2.png\" alt=\"PyMC \u0433\u0440\u0430\u0444 \u043c\u043e\u0434\u0435\u043b\u0438\" title=\"PyMC \u0433\u0440\u0430\u0444 \u043c\u043e\u0434\u0435\u043b\u0438\" width=\"1328\" height=\"602\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ee\/f70\/f0b\/5eef70f0beeae1dc56c7c58c2284d3a2.png\"\/><\/p>\n<div><figcaption>PyMC \u0433\u0440\u0430\u0444 \u043c\u043e\u0434\u0435\u043b\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0410 \u0432\u043e\u0442 \u0438 \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438:\u00a0<\/p>\n<pre><code class=\"python\">az.plot_posterior(trace_uni, var_names=['kappa']) plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/db9\/43d\/bb5\/db943dbb52836863199c074ebb26122b.png\" alt=\"\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438\" title=\"\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438\" width=\"1400\" height=\"716\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/db9\/43d\/bb5\/db943dbb52836863199c074ebb26122b.png\"\/><\/p>\n<div><figcaption>\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0441\u0451, \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u044d\u0442\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f \u0434\u043b\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0411\u0430\u0439\u0435\u0441\u0430.\u00a0<\/p>\n<pre><code class=\"python\"># Posterior samples for kappa kappa_samples = trace_uni.posterior.kappa.values.flatten() # Log likelihood for each sample log_likes = [] for k in kappa_samples:     # Von Mises log likelihood     log_like = vonmises.logpdf(data['radians'], k, loc=np.pi).sum()     log_likes.append(log_like) # Log-mean-exp trick for numerical stability log_likelihood_h1 = np.max(log_likes) +\\        np.log(np.mean(np.exp(log_likes - np.max(log_likes)))) BF = np.exp(log_likelihood_h1 - log_likelihood_h0) print(f\"Bayes Factor: {BF:.4f}\") print(f\"Probability kappa &gt; 0.5: {np.mean(kappa_samples &gt; 0.5):.4f}\")<\/code><\/pre>\n<pre><code>&gt;&gt; Bayes Factor: 32.4645 &gt;&gt; Probability kappa &gt; 0.5: 0.0649<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0434\u0435\u043b\u0438\u043c \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b, \u0442\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0411\u0430\u0439\u0435\u0441\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043e \u0442\u043e\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043f\u0440\u043e\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u0432\u0435\u0440\u043d\u0430 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430\u00a0<img decoding=\"async\" src=\"\" class=\"formula inline\"\/>, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e\u043c\u0443 \u044d\u0444\u0444\u0435\u043a\u0442\u0443. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442, \u0434\u0430\u043d\u043d\u044b\u0435\u00a0<strong>\u043d\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u00a0<\/strong>\u043f\u043e \u043a\u0440\u0443\u0433\u0443 \u0438 \u0435\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0<strong>\u044e\u0436\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435.\u00a0<\/strong><\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043c\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0435\u00a0<img decoding=\"async\" src=\"\" class=\"formula inline\"\/>. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0437\u043d\u0430\u0447\u0438\u043c\u043e \u043b\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e. \u0423 \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u043d\u0438\u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u042e\u0433\u0430 \u044d\u0442\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u0435\u0433\u043e\u00a0<img decoding=\"async\" src=\"\" class=\"formula inline\"\/>, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0451 \u0435\u0449\u0451 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043c\u0430\u0437\u0430\u043d\u043e \u043f\u043e \u043a\u0440\u0443\u0433\u0443 \u0438 \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u0441\u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e.\u00a0<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0434\u0440\u0443\u0433\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c: \u0431\u0438\u043c\u043e\u0434\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u043c\u0435\u0441\u044c \u0421\u0435\u0432\u0435\u0440-\u042e\u0433.\u00a0<\/p>\n<h4>\u0411\u0438\u043c\u043e\u0434\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u043c\u0435\u0441\u044c \u0421\u0435\u0432\u0435\u0440\u0433-\u042e\u0433<\/h4>\n<p>\u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0443, \u0447\u0442\u043e \u0441\u043e\u0431\u0430\u043a\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043b\u0438\u0431\u043e \u043d\u0430 \u0441\u0435\u0432\u0435\u0440\u0433, \u043b\u0438\u0431\u043e \u043d\u0430 \u044e\u0433, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u0432\u0430\u0436\u043d\u044b\u043c\u0438 \u0434\u0435\u043b\u0430\u043c\u0438. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u043c\u043e\u0434\u0435\u043b\u0438 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u044e \u0432\u043e\u043a\u0440\u0443\u0433 0\u00b0 \u0438 180\u00b0 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432 \u043a\u043e\u043c\u043f\u0430\u0441\u0430.\u00a0<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043c\u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043c\u0435\u0441\u044c \u0434\u0432\u0443\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0438 \u043e\u0431\u0449\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438.\u00a0<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:\u00a0<\/p>\n<pre><code class=\"python\"># Type aliases ArrayLike = Union[np.ndarray, pd.Series] ResultDict = Dict[str, Union[float, InferenceData.InferenceData]]  def compute_mixture_vonmises_logpdf(     series: ArrayLike,     kappa: float,     weights: npt.NDArray[np.float64],     mus: List[float] ) -&gt; float:     \"\"\"     Compute log PDF for a mixture of von Mises distributions          Parameters:     -----------     series: ArrayLike          Array of observed angles in radians     kappa: float         Concentration parameter     weights: npt.NDArray[np.float64],         Array of mixture weights     mus: List[float]          Array of means for each component          Returns:     --------     float: Sum of log probabilities for all data points     \"\"\"     mixture_pdf = np.zeros_like(series)          for w, mu in zip(weights, mus):         mixture_pdf += w * vonmises.pdf(series, kappa, loc=mu)          return np.log(np.maximum(mixture_pdf, 1e-300)).sum()  def compute_log_likelihoods(     trace: az.InferenceData,      series: ArrayLike,     mus: List[float]     ) -&gt; np.ndarray:     \"\"\"     Compute log likelihoods for each sample in the trace      Parameters:     -----------     trace: az.InferenceData         The trace from the PyMC3 model sampling.      series: ArrayLike         Array of observed angles in radians          \"\"\"      kappa_samples = trace.posterior.kappa.values.flatten()     weights_samples = trace.posterior.weights.values.reshape(-1, 2)     # Calculate log likelihood for each posterior sample     log_likes = []     for k, w in zip(kappa_samples, weights_samples):         log_like = compute_mixture_vonmises_logpdf(             series,              kappa=k,              weights=w,              mus=mus         )         log_likes.append(log_like)          # Calculate marginal likelihood using log-sum-exp trick     log_likelihood_h1 = np.max(log_likes) + np.log(np.mean(np.exp(log_likes - np.max(log_likes))))     return log_likelihood_h1  def posterior_report(     log_likelihood_h0: float,      log_likelihood_h1: float,      kappa_samples: ArrayLike,     kappa_threshold: float = 0.5     ) -&gt; str:      \"\"\"     Generate a report with Bayes Factor and probability kappa &gt; threshold      Parameters:     -----------     log_likelihood_h0: float         Log likelihood for the null hypothesis     log_likelihood_h1: float         Log likelihood for the alternative hypothesis     kappa_samples: ArrayLike         Flattened posterior samples of the concentration parameter     kappa_threshold: float         Threshold for computing the probability that kappa &gt; threshold      Returns:     --------     summary: str         A formatted string containing the summary statistics.     \"\"\"     BF = np.exp(log_likelihood_h1 - log_likelihood_h0)      summary = (         f\"Bayes Factor: {BF:.4f}\\n\"         f\"Probability kappa &gt; {kappa_threshold}: {np.mean(kappa_samples &gt; kappa_threshold):.4f}\"     )      return summary<\/code><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043a \u043c\u043e\u0434\u0435\u043b\u0438:\u00a0<\/p>\n<pre><code class=\"python\">mu1 = 0            # 0 degrees mu2 = np.pi        # 180 degrees  with pm.Model() as model_mixture_bimodal_NS:     # Priors for concentration parameters     kappa = pm.HalfNormal('kappa', sigma=10)      # Priors for component weights     weights = pm.Dirichlet('weights', a=np.ones(2))          # Define the von Mises components     vm1 = pm.VonMises.dist(mu=mu1, kappa=kappa)     vm2 = pm.VonMises.dist(mu=mu2, kappa=kappa)          # Mixture distribution     likelihood = pm.Mixture(         'angles',         w=weights,         comp_dists=[vm1, vm2],         observed=data['radians']     )          # Sample from the posterior     trace_mixture_bimodal_NS = pm.sample(         10000, tune=3000, chains=4, return_inferencedata=True, idata_kwargs={'log_likelihood': True})          # Get kappa samples     kappa_samples = trace_mixture_bimodal_NS.posterior.kappa.values.flatten()<\/code><\/pre>\n<p>\u0418 \u0441\u043d\u043e\u0432\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u0440\u0430\u0444 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\kappa\" alt=\"\\kappa\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bda\/2da\/9c9\/bda2da9c9a0aad094dfcc33d6496c86c.svg\" width=\"11\" height=\"12\"\/>:<\/p>\n<pre><code class=\"python\"># Model graph pm.model_to_graphviz(model_mixture_bimodal_NS)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bbd\/ab8\/bd5\/bbdab8bd5e93b49402fd12c809b87189.png\" alt=\"PyMC \u0433\u0440\u0430\u0444 \u043c\u043e\u0434\u0435\u043b\u0438\" title=\"PyMC \u0433\u0440\u0430\u0444 \u043c\u043e\u0434\u0435\u043b\u0438\" width=\"1400\" height=\"636\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bbd\/ab8\/bd5\/bbdab8bd5e93b49402fd12c809b87189.png\"\/><\/p>\n<div><figcaption>PyMC \u0433\u0440\u0430\u0444 \u043c\u043e\u0434\u0435\u043b\u0438<\/figcaption><\/div>\n<\/figure>\n<pre><code class=\"python\"># Posterior Analysis az.plot_posterior(trace_mixture_bimodal_NS, var_names=['kappa']) plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2df\/803\/215\/2df803215bdea26f3ca276889694988b.png\" alt=\"\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438\" title=\"\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438\" width=\"1400\" height=\"621\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2df\/803\/215\/2df803215bdea26f3ca276889694988b.png\"\/><\/p>\n<div><figcaption>\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0411\u0430\u0439\u0435\u0441\u0430 \u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 0.5:<\/p>\n<pre><code class=\"python\">log_likelihood_h1 = compute_log_likelihoods(trace_mixture_bimodal_NS,                                              data['radians'], [mu1, mu2]) print(posterior_report(log_likelihood_h0, log_likelihood_h1, kappa_samples))<\/code><\/pre>\n<pre><code>&gt;&gt; Bayes Factor: 214.2333 &gt;&gt; Probability kappa &gt; 0.5: 0.9110<\/code><\/pre>\n<p><strong>\u041a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0443\u0434\u0430\u0447\u0430!<\/strong>\u00a0\u041e\u0431\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0411\u0430\u0439\u0435\u0441\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0435 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 90% \u0432\u0441\u0435\u0445 \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 0.5 \u0441\u043e \u0441\u0440\u0435\u0434\u043d\u0438\u043c \u0432 0.99, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0432\u044b\u0448\u0435.\u00a0<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0435\u0449\u0435 \u043f\u0430\u0440\u0443 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c.\u00a0<\/p>\n<h4>\u0411\u0438\u043c\u043e\u0434\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u043c\u0435\u0441\u044c \u0417\u0430\u043f\u0430\u0434-\u042e\u0433<\/h4>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u044b \u0432\u043d\u043e\u0432\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u043e\u0431\u0430\u043a\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0434\u0432\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0441\u0432\u0435\u0442\u0430, \u043d\u043e \u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043d\u0430 \u0437\u0430\u043f\u0430\u0434 \u0438 \u043d\u0430 \u044e\u0433 \u0438\u043b\u0438 270\u00b0 \u0438 180\u00b0 \u2014 \u0442\u043e\u0436\u0435 \u0447\u0430\u0441\u0442\u044b\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u043f\u0435\u0440\u0432\u043e\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u0441\u0443.\u00a0<\/p>\n<pre><code class=\"python\">mu1 = np.pi          # 180 degrees mu2 = 3 * np.pi \/ 2  # 270 degrees  with pm.Model() as model_mixture_bimodal_WS:     # Priors for concentration parameters     kappa = pm.HalfNormal('kappa', sigma=10)          # Priors for component weights     weights = pm.Dirichlet('weights', a=np.ones(2))          # Define the four von Mises components     vm1 = pm.VonMises.dist(mu=mu1, kappa=kappa)     vm2 = pm.VonMises.dist(mu=mu2, kappa=kappa)          # Mixture distribution     likelihood = pm.Mixture(         'angles',         w=weights,         comp_dists=[vm1, vm2],         observed=data['radians']     )          # Sample from the posterior     trace_mixture_bimodal_WS = pm.sample(         10000, tune=3000, chains=4, return_inferencedata=True,        idata_kwargs={'log_likelihood': True})          # Get kappa samples     kappa_samples = trace_mixture_bimodal_WS.posterior.kappa.values.flatten()  # Posterior Analysis az.plot_posterior(trace_mixture_bimodal_WS, var_names=['kappa']) plt.show()  log_likelihood_h1 = compute_log_likelihoods(trace_mixture_bimodal_WS,                                              data['radians'], [mu1, mu2]) print(posterior_report(log_likelihood_h0, log_likelihood_h1, kappa_samples))<\/code><\/pre>\n<pre><code>&gt;&gt; Bayes Factor: 20.2361 &gt;&gt; Probability kappa &gt; 0.5: 0.1329<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1ab\/bb6\/631\/1abbb66310016c8acc12e161fabe0a3d.png\" alt=\"\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438\" title=\"\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438\" width=\"1400\" height=\"708\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1ab\/bb6\/631\/1abbb66310016c8acc12e161fabe0a3d.png\"\/><\/p>\n<div><figcaption>\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0443 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c. \u0422\u043e\u0447\u043d\u043e \u043d\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u041f\u043e\u0435\u0445\u0430\u043b\u0438 \u0434\u0430\u043b\u044c\u0448\u0435!\u00a0<\/p>\n<h4>\u0421\u043c\u0435\u0441\u044c &#171;\u043d\u0430 \u0432\u0441\u0435 \u0447\u0435\u0442\u044b\u0440\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b&#187;<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430. \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u043e\u0431\u0430\u043a\u0430 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u0433\u043e \u043f\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u0430\u043c \u0441\u0432\u0435\u0442\u0430? \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441 \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0441\u0440\u0435\u0434\u043d\u0438\u043c\u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438: 0\u00b0, 90\u00b0, 180\u00b0 \u0438 270\u00b0.\u00a0<\/p>\n<pre><code class=\"python\">mu1 = 0            # 0 degrees mu2 = np.pi \/ 2    # 90 degrees mu3 = np.pi        # 180 degrees mu4 = 3 * np.pi \/ 2  # 270 degrees  with pm.Model() as model_mixture_quad:     # Priors for concentration parameters     kappa = pm.HalfNormal('kappa', sigma=10)          # Priors for component weights     weights = pm.Dirichlet('weights', a=np.ones(4))          # Define the four von Mises components     vm1 = pm.VonMises.dist(mu=mu1, kappa=kappa)     vm2 = pm.VonMises.dist(mu=mu2, kappa=kappa)     vm3 = pm.VonMises.dist(mu=mu3, kappa=kappa)     vm4 = pm.VonMises.dist(mu=mu4, kappa=kappa)          # Mixture distribution     likelihood = pm.Mixture(         'angles',         w=weights,         comp_dists=[vm1, vm2, vm3, vm4],         observed=data['radians']     )          # Sample from the posterior     trace_mixture_quad = pm.sample(         10000, tune=3000, chains=4, return_inferencedata=True, idata_kwargs={'log_likelihood': True}     )     # Get kappa samples     kappa_samples = trace_mixture_quad.posterior.kappa.values.flatten() # Posterior Analysis az.plot_posterior(trace_mixture_quad, var_names=['kappa']) plt.show() log_likelihood_h1 = compute_log_likelihoods(trace_mixture_quad, data['radians'], [mu1, mu2, mu3, mu4]) print(posterior_report(log_likelihood_h0, log_likelihood_h1, kappa_samples))<\/code><\/pre>\n<pre><code>&gt;&gt; Bayes Factor: 0.0000 &gt;&gt; Probability kappa &gt; 0.5: 0.9644<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/619\/019\/ddb\/619019ddbedb370ec084e6f57d1ceac5.png\" alt=\"\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438\" title=\"\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438\" width=\"1400\" height=\"727\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/619\/019\/ddb\/619019ddbedb370ec084e6f57d1ceac5.png\"\/><\/p>\n<div><figcaption>\u0410\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e \u0436, \u0441\u043d\u043e\u0432\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c. \u0425\u043e\u0442\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 0.5, \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0411\u0430\u0439\u0435\u0441\u0430 \u0441\u0442\u0430\u043b \u0440\u0430\u0432\u0435\u043d 0.0. \u0410 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0445\u0443\u0436\u0435 \u0434\u0430\u0436\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u0441 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c.\u00a0<\/p>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u0411\u0430\u0439\u0435\u0441\u0430 \u2014 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438.\u00a0<\/p>\n<h3>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434 \u0434\u0440\u0443\u0433\u0438\u043c \u0443\u0433\u043b\u043e\u043c \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438. \u041c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u0432\u0430 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432 \u0411\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u043e\u043c \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438:\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Watanabe%E2%80%93Akaike_information_criterion#:~:text=In%20statistics%2C%20the%20Widely%20Applicable,it%20wasn't%20trained%20on.\" rel=\"noopener noreferrer nofollow\">Widely Applicable Information Criterion<\/a>\u00a0(WAIC)\u00a0\u0438 Leave-One-Out Cross-Validation (LOO).\u00a0<\/p>\n<pre><code class=\"python\"># Compute WAIC for each model wail_uni = az.waic(trace_uni) waic_quad = az.waic(trace_mixture_quad) waic_bimodal_NS = az.waic(trace_mixture_bimodal_NS) waic_bimodal_WS = az.waic(trace_mixture_bimodal_WS)  model_dict = {     'Quadrimodal Model': trace_mixture_quad,     'Bimodal Model (NS)': trace_mixture_bimodal_NS,     'Bimodal Model (WS)': trace_mixture_bimodal_WS,     'Unimodal Model': trace_uni  } # Compare models using WAIC waic_comparison = az.compare(model_dict, ic='waic') waic_comparison<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9e9\/55f\/ee5\/9e955fee557b16031222663947711a60.png\" width=\"2000\" height=\"405\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9e9\/55f\/ee5\/9e955fee557b16031222663947711a60.png\"\/><\/figure>\n<pre><code class=\"python\"># Compare models using LOO loo_comparison = az.compare(model_dict, ic='loo') loo_comparison<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/464\/654\/d53\/464654d5342a3f630ac2bce97277b468.png\" width=\"2000\" height=\"406\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/464\/654\/d53\/464654d5342a3f630ac2bce97277b468.png\"\/><\/figure>\n<pre><code class=\"python\"># Visualize the comparison az.plot_compare(waic_comparison) plt.show()<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/260\/d2a\/2a9\/260d2a2a93ca593138dd47ca57de742a.png\" alt=\"\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u043e WAIC\" title=\"\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u043e WAIC\" width=\"1400\" height=\"643\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/260\/d2a\/2a9\/260d2a2a93ca593138dd47ca57de742a.png\"\/><\/p>\n<div><figcaption>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u043e WAIC<\/figcaption><\/div>\n<\/figure>\n<p>\u0418 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044c! \u0411\u0438\u043c\u043e\u0434\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0421\u0435\u0432\u0435\u0440-\u042e\u0433 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043e\u0431\u043e\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c.\u00a0<\/p>\n<h2>\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/659\/79b\/e3e\/65979be3e2074c917405ca2b2eb3e196.png\" alt=\"\u041d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u0438\u0439 \u0410\u0443\u0440\u0438\" title=\"\u041d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u0438\u0439 \u0410\u0443\u0440\u0438\" width=\"960\" height=\"1280\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/659\/79b\/e3e\/65979be3e2074c917405ca2b2eb3e196.png\"\/><\/p>\n<div><figcaption>\u041d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u0438\u0439 \u0410\u0443\u0440\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u043e! \u0422\u043e, \u0447\u0442\u043e \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c, \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u0437\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0443\u0430\u043b\u0435\u0442\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u0430\u043c\u0438 \u043c\u043e\u0435\u0439 \u0441\u043e\u0431\u0430\u043a\u0438, \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u043e\u0441\u044c \u0432 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0435 \u0431\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u043e\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435.\u00a0<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u043e\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0430\u043f\u043e\u0441\u0442\u0435\u0440\u0438\u043e\u0440\u043d\u044b\u0445 \u043e\u0446\u0435\u043d\u043e\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u0411\u0430\u0439\u0435\u0441\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0438\u043f\u043e\u0442\u0435\u0437 \u0438 \u043d\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432.\u00a0<\/p>\n<p>\u0418 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u043e\u0436\u0435 \u043d\u0435 \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043b\u0438! \u0410\u0443\u0440\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0447\u0430\u0441\u0442\u043e \u0443\u043c\u0443\u0434\u0440\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u0432\u0434\u043e\u043b\u044c \u043e\u0441\u0438 \u0421\u0435\u0432\u0435\u0440-\u042e\u0433. \u0415\u0441\u043b\u0438 \u044f \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u0431\u043b\u0443\u0436\u0443\u0441\u044c \u0432 \u043b\u0435\u0441\u0443 \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u043f\u0451\u0441\u0435\u043b\u0435\u043c, \u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u043c\u0445\u0430 \u043d\u0430 \u0434\u0435\u0440\u0435\u0432\u0435 \u0441\u043c\u043e\u0433\u0443 \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443. \u041d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u044b\u0431\u043e\u0440\u043a\u0438.\u00a0<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u0430\u043c \u0442\u043e\u0436\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u044d\u0442\u043e \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438\u043b\u0438 \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f, \u0441\u043c\u0435\u043b\u043e \u043f\u0438\u0448\u0438\u0442\u0435 \u043c\u043d\u0435!\u00a0<\/p>\n<p>\u0415\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439 \u0438 \u0437\u0430\u043c\u0435\u0442\u043e\u043a \u043f\u0440\u043e \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445, \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435, HealthTech \u0438 \u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043c\u043e\u0451\u043c \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b\u0435\u00a0<a href=\"https:\/\/t.me\/data_wondering\" rel=\"noopener noreferrer nofollow\">Data Wondering<\/a>:<\/p>\n<div class=\"embed_link\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;https:\/\/cdn4.cdn-telegram.org\/file\/RJ_jFLyEAVB0AfaJFXiCa50vyHh5f0BdHrveoty9w3DvNOv-n4T8a0ZOssyDisyFRK1D5YjpLX_154i8f13YfWl0H5I7kucMC0p88iSu2vrSwAer17tKPFDDh56mvMz6NAu7armaYoH8VamY6FUNRYgnzyAVpRihgwtkFE_Yq3Bb1zz37TpLgTpRHLxZEhVmrD6BhDygGWC5hYoRyncuXNUGJZHjhibZGDaq7Y65Ds0SFj9wLWqb96lngq-BLO5YxGn-vw2CbLQMmINwxGM08xqHfJmcZIU0wsNU1V-ftb-uJRcGickzh9wRinVU09ebRMGOaiDYHta7QKm8jsH3rg.jpg&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>Data Wondering<\/span><\/div>\n<p><a href=\"https:\/\/t.me\/data_wondering\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-host\">t.me<\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/895332\/\"> https:\/\/habr.com\/ru\/articles\/895332\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>tl;dr<\/h2>\n<p>\u041e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043b\u0438 \u0441\u043e\u0431\u0430\u043a\u0438 \u043f\u043e \u043a\u043e\u043c\u043f\u0430\u0441\u0443, \u043a\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u0430\u044e\u0442 \u0441\u0432\u043e\u0438 \u0433\u0440\u044f\u0437\u043d\u044b\u0435 \u0434\u0435\u043b\u0430? \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u2014 \u0434\u0430! \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0432 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043c\u043f\u0430\u0441, \u0411\u0430\u0439\u0435\u0441\u043e\u0432\u0441\u043a\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438 \u0441\u043e\u0431\u0430\u043a\u0443 (\u0441\u043e\u0431\u0430\u043a\u0430 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430), \u0442\u043e \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0442.\u00a0<\/p>\n<p>\u042f \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u043b\u044e \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0438\u0448\u0443 \u043e \u043d\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u0437\u0430\u043c\u0435\u0442\u043a\u0438 (\u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0439). \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0442\u0430\u043a\u043e\u0435 \u0442\u043e\u0436\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u2014 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043c\u043e\u0439 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b:\u00a0<a href=\"https:\/\/t.me\/data_wondering\" rel=\"noopener noreferrer nofollow\">Data Wondering<\/a>.\u00a0<\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u044f \u0441\u043e\u0431\u0430\u043a\u0430, \u0410\u0443\u0440\u0438. \u0415\u043c\u0443 \u043f\u044f\u0442\u044c \u043b\u0435\u0442 \u0438 \u043f\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c \u043e\u043d \u043f\u043e\u0440\u043e\u0434\u0438\u0441\u0442\u044b\u0439 \u041a\u0430\u0432\u0430\u043b\u0435\u0440-\u043a\u0438\u043d\u0433-\u0447\u0430\u0440\u043b\u044c\u0437-\u0441\u043f\u0430\u043d\u0438\u0435\u043b\u044c, \u0445\u043e\u0442\u044f \u043f\u043e \u043f\u043e\u0432\u0430\u0434\u043a\u0430\u043c \u0434\u043e \u043a\u0430\u0432\u0430\u043b\u0435\u0440\u0430 \u0431\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043b\u0435\u043a\u043e.\u00a0<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0410\u0443\u0440\u0438 \u0432\u043e \u0432\u0441\u0435\u0439 \u043a\u0440\u0430\u0441\u0435 (\u0444\u043e\u0442\u043e \u0430\u0432\u0442\u043e\u0440\u0430)<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u044b \u0441\u043e\u0431\u0430\u043a, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0448\u0438\u0445 \u0441 \u043d\u0438\u043c \u043f\u0440\u043e\u0433\u0443\u043b\u043e\u043a \u044f \u043d\u0430\u0447\u0430\u043b \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u0443 \u0410\u0443\u0440\u0438 \u0435\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0442\u0443\u0430\u043b\u0435\u0442\u043d\u044b\u0439 \u0440\u0438\u0442\u0443\u0430\u043b. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e, \u043e\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043a\u0440\u0443\u0436\u0438\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u0432\u043e\u0435\u0439 \u043e\u0441\u0438, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043f\u043e\u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u043f\u0440\u044f\u043c\u043e \u043a\u0430\u043a \u0441\u0442\u0440\u0435\u043b\u043a\u0430 \u043a\u043e\u043c\u043f\u0430\u0441\u0430.\u00a0<\/p>\n<p>\u041f\u043e\u043d\u0430\u0447\u0430\u043b\u0443, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u0437\u0430\u0431\u0430\u0432\u043d\u043e. \u0412 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432, \u043a\u0442\u043e \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0430\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043f\u0451\u0441\u044c\u0435\u0439 \u0433\u043e\u043b\u043e\u0432\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u043f\u0443\u0441\u0442\u044f \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u044f \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b, \u0447\u0442\u043e \u0432 \u0434\u0430\u043b\u0435\u043a\u043e\u043c 2013-\u043c \u0433\u043e\u0434\u0443 \u043c\u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u0433\u043b\u0430\u0437\u0430 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c &#171;\u0421\u043e\u0431\u0430\u043a\u0438 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b \u043a \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044f\u043c \u043c\u0430\u0433\u043d\u0438\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0417\u0435\u043c\u043b\u0438&#187; (\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b:\u00a0<a href=\"https:\/\/frontiersinzoology.biomedcentral.com\/counter\/pdf\/10.1186\/1742-9994-10-80.pdf\" rel=\"noopener noreferrer nofollow\">Dogs are sensitive to small variations of the Earth\u2019s magnetic field<\/a>). \u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043e \u043d\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0435 \u0441\u043e\u0431\u0430\u043a, \u0430 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u043b, \u0447\u0442\u043e &#171;\u0441\u043e\u0431\u0430\u043a\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0438\u0441\u043f\u0440\u0430\u0436\u043d\u044f\u0442\u044c\u0441\u044f, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443\u044f \u0441\u0432\u043e\u0451 \u0442\u0435\u043b\u043e \u0432\u0434\u043e\u043b\u044c \u043e\u0441\u0438 \u0421\u0435\u0432\u0435\u0440-\u042e\u0433&#187;.\u00a0<\/p>\n<p>&#171;\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043a \u0440\u0430\u0437 \u0432 \u043c\u043e\u0451\u043c \u0441\u0442\u0438\u043b\u0435, \u043d\u0430\u0434\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c!&#187;,\u00a0\u043f\u043e\u0434\u0443\u043c\u0430\u043b \u044f. \u0418, \u043a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0443 \u043c\u0435\u043d\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0434\u043e\u043f\u044b\u0442\u043d\u044b\u0439. \u042f \u0440\u0435\u0448\u0438\u043b \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u0443 \u0440\u0430\u0431\u043e\u0442\u0443 \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c (\u043b\u0438\u0431\u043e \u043e\u043f\u0440\u043e\u0432\u0435\u0440\u0433\u043d\u0443\u0442\u044c!) \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443 \u043d\u0430 \u0410\u0443\u0440\u0438, \u043c\u043e\u0451\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e\u0449\u0435\u043c N=1 \u0438\u0441\u043f\u044b\u0442\u0443\u0435\u043c\u043e\u043c.<\/p>\n<p>\u0421 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043d\u0430\u0447\u0430\u043b\u0441\u044f \u043c\u043e\u0439 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438 \u043e\u0447\u0435\u043d\u044c \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f \u0437\u0430\u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0431\u043e\u043b\u0435\u0435 150 &#171;\u0441\u0435\u0430\u043d\u0441\u043e\u0432 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f&#187;, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u043e \u0447\u0435\u043c \u044f.\u00a0<\/p>\n<h2>\u0421\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0414\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f, \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u0441\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0410\u0443\u0440\u0438 \u0445\u043e\u0434\u0438\u043b \u0432 \u0442\u0443\u0430\u043b\u0435\u0442. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439, \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u0442\u044c\u00a0<a href=\"https:\/\/www.theverge.com\/2024\/6\/10\/24175487\/ipad-calculator-app-ipados18-pencil-apple-wwdc2024\" rel=\"noopener noreferrer nofollow\">\u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440 \u043d\u0430 iPad<\/a>, \u043d\u043e \u0438\u00a0<a href=\"https:\/\/www.simplymac.com\/apps\/how-accurate-is-the-iphone-compass\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u043e\u0447\u043d\u044b\u0439<\/a>\u00a0\u043a\u043e\u043c\u043f\u0430\u0441 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435. \u0415\u0433\u043e-\u0442\u043e \u044f \u0438 \u0441\u0442\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.\u00a0<\/p>\n<p>\u041c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f \u0431\u044b\u043b\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0439 \u043f\u0451\u0441 \u0443\u0441\u0430\u0436\u0438\u0432\u0430\u043b\u0441\u044f \u043f\u043e\u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u044f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043a\u043e\u043c\u043f\u0430\u0441\u043e\u043c, \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b \u0435\u0433\u043e \u0432\u0434\u043e\u043b\u044c \u0441\u043e\u0431\u0430\u0447\u044c\u0435\u0439 \u0442\u0443\u0448\u043a\u0438 \u0438 \u0434\u0435\u043b\u0430\u043b \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442. \u0412 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0430\u0432\u0442\u043e\u0440\u044b \u043e\u0447\u0435\u043d\u044c \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u043b\u0438 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 &#171;<em>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u0441\u0430 \u043f\u043e \u0433\u0440\u0443\u0434\u043d\u043e\u043c\u0443 \u043e\u0442\u0434\u0435\u043b\u0443 \u043f\u043e\u0437\u0432\u043e\u043d\u043e\u0447\u043d\u0438\u043a\u0430 (\u043c\u0435\u0436\u0434\u0443 \u043b\u043e\u043f\u0430\u0442\u043a\u0430\u043c\u0438) \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0433\u043e\u043b\u043e\u0432\u044b<\/em>&#171;. \u041e\u0447\u0435\u043d\u044c \u043d\u0430\u0443\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043a\u0430\u0437\u0430\u0442\u044c &#171;\u0441\u0442\u0440\u0435\u043b\u043a\u0430 \u043a\u043e\u043c\u043f\u0430\u0441\u0430 \u0438 \u0433\u043e\u043b\u043e\u0432\u0430 \u0441\u043e\u0431\u0430\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443&#187;.\u00a0<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0430\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0438\u0437 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.\u00a0<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u044d\u0442\u0443 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u044f \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043b, \u0432 \u043e\u0431\u0449\u0435\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, 150 \u0441 \u043b\u0438\u0448\u043d\u0438\u043c \u0440\u0430\u0437 \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u044f\u0446\u0435\u0432. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u043e \u043b\u043e\u0432\u0438\u0442\u044c \u0432\u0437\u0433\u043b\u044f\u0434\u044b \u043f\u0440\u043e\u0445\u043e\u0436\u0438\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043d\u043e \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b\u0438, \u043f\u043e\u0447\u0435\u043c\u0443 \u044f \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0440\u0443\u044e \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0442\u0438\u043c\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0431\u0430\u0447\u044c\u0435\u0439 \u0436\u0438\u0437\u043d\u0438. \u0421\u0442\u043e\u0438\u043b\u043e \u043b\u0438 \u043e\u043d\u043e \u0442\u043e\u0433\u043e? \u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u0441\u0451 \u0443\u0437\u043d\u0430\u0435\u043c.\u00a0<\/p>\n<h2>\u0410\u043d\u0430\u043b\u0438\u0437<\/h2>\n<p>\u042f \u043a\u0440\u0430\u0442\u043a\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0433\u0438\u043f\u043e\u0442\u0435\u0437.\u00a0<\/p>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u043d\u0430 \u043c\u043e\u0439 \u0433\u0438\u0442\u0445\u0430\u0431:\u00a0<a href=\"https:\/\/github.com\/DmitrySerg\/data-wondering\/tree\/main\/bayesian-dog-poop\" rel=\"noopener noreferrer nofollow\">Data Wondering<\/a>.\u00a0<\/p>\n<h3>\u041a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f?\u00a0<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u0440\u0443\u043a\u0430\u0445 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0441\u0435\u0440\u0438\u044f \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u0441\u0430:\u00a0<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u043a\u0440\u0438\u0448\u043d\u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u0441\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0411\u0443\u0434\u0443\u0447\u0438 \u0432 \u043c\u0435\u0440\u0443 \u043b\u0435\u043d\u0438\u0432\u044b\u043c, \u044f \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u0445\u043e\u0442\u0435\u043b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0431\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043e\u0432. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e, \u044f \u0440\u0435\u0448\u0438\u043b \u0431\u044b\u0441\u0442\u0440\u0435\u043d\u044c\u043a\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430.\u00a0<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0431\u044b\u043b\u0430 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e\u0439:\u00a0\u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043d\u0435 \u0431\u044b\u043b\u0430 \u043d\u0443\u0436\u043d\u0430 \u2014 \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u0432\u043d\u0438\u0437\u0443 \u044d\u043a\u0440\u0430\u043d\u0430. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u0434\u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0435\u0433\u043a\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043e\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Optical_character_recognition\" rel=\"noopener noreferrer nofollow\">OCR<\/a>). \u042f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430\u00a0<a href=\"https:\/\/github.com\/JaidedAI\/EasyOCR\" rel=\"noopener noreferrer nofollow\"><code>easyocr<\/code><\/a>, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u043c\u043e\u0436\u0435\u0442, \u0438 \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u0448\u0443\u0441\u0442\u0440\u0430\u044f, \u043d\u043e \u0437\u0430\u0442\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0438 \u0441 \u043d\u0435\u0439 \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.\u00a0<\/p>\n<p>\u042f \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f\u00a0easyocr\u00a0\u0438 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438,\u00a0<a href=\"https:\/\/opencv.org\/\" rel=\"noopener noreferrer nofollow\"><code>opencv<\/code><\/a> \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u0430\u0441\u0430 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u0433\u043e:\u00a0<\/p>\n<pre><code class=\"python\">import cv2 import os  image_dir = '..\/data\/raw\/' img = cv2.imread(image_dir + 'IMG_6828.png')  plt.imshow(img) plt.show()<\/code><\/pre>\n<figure class=\"full-width\">\n<div><figcaption>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u044e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0447\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u043c\u0435\u043d\u0435\u0435 \u0448\u0443\u043c\u043d\u044b\u043c:\u00a0<\/p>\n<pre><code class=\"python\">gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) plt.imshow(gray, cmap='gray') plt.show()<\/code><\/pre>\n<figure class=\"full-width\">\n<div><figcaption>\u0427\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u044f \u043e\u0431\u0440\u0435\u0437\u0430\u044e \u0432\u0441\u0435 \u043b\u0438\u0448\u043d\u0435\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043d\u0443\u0436\u043d\u043e\u0439 \u043c\u043d\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041e\u0431\u0440\u0435\u0437\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f\u00a0<code>easyocr<\/code>\u00a0\u044f \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e \u0447\u0438\u0441\u043b\u043e \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438. \u041f\u043e\u043c\u0438\u043c\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430, \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0435\u0449\u0435 \u0438 \u043e\u0446\u0435\u043d\u043a\u0443 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 (confidence score), \u043d\u043e \u0434\u043b\u044f \u043c\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e.\u00a0<\/p>\n<pre><code class=\"python\">import easyocr  reader = easyocr.Reader(['en']) result = reader.readtext(gray[1850:2100, 200:580]) for bbox, text, prob in result:     print(f\"Detected text: {text} with confidence {prob}\")<\/code><\/pre>\n<pre><code class=\"markdown\">&gt;&gt; Detected text: 340 with confidence 0.999995182215476<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0451! \u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0446\u0438\u043a\u043b, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430\u043c, \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 CSV \u0444\u0430\u0439\u043b.\u00a0<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u043b\u043d\u044b\u0439 \u043d\u043e\u0443\u0442\u0431\u0443\u043a \u0441 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433\u043e\u043c:\u00a0<a href=\"https:\/\/github.com\/DmitrySerg\/data-wondering\/blob\/main\/bayesian-dog-poop\/notebooks\/0-data-preprocessing.ipynb\" rel=\"noopener noreferrer nofollow\">Data Preprocessing<\/a>.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0434 \u0434\u0430\u043d\u043d\u044b\u0445<\/figcaption><\/div>\n<\/figure>\n<h3>\u041a\u0440\u0443\u0442\u0438\u043c \u043a\u043e\u043b\u0435\u0441\u043e: \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f<\/h3>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e, \u044f \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0441 \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u043f\u043e\u0438\u0437\u0443\u0447\u0430\u0442\u044c. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0445 \u043d\u0430\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439, \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e: &#171;\u043a\u043e\u043d\u0446\u044b&#187; \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c.\u00a0<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u043e\u0432 \u0432 \u0434\u043d\u0435, \u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 23:00 \u0438 00:00 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0436\u0435, \u043a\u0430\u043a \u043c\u0435\u0436\u0434\u0443 00:00 \u0438 01:00. \u0418\u043b\u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043a\u043e\u043c\u043f\u0430\u0441\u043e\u043c, \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 359\u00b0\u00a0\u0438 0\u00b0\u00a0\u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u0438 \u043c\u0435\u0436\u0434\u0443 0\u00b0\u00a0\u0438 1\u00b0.\u00a0<\/p>\n<p>\u0414\u0430\u0436\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043c\u0435\u0436\u0434\u0443 360\u00b0\u00a0\u0438 0\u00b0\u00a0\u0434\u0430\u0441\u0442 \u043d\u0430\u043c 180\u00b0, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0438 360\u00b0,\u00a0\u0438 0\u00b0\u00a0\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438.\u00a0<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u044f \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 \u0441\u0432\u043e\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. \u042f \u043f\u0435\u0440\u0435\u0432\u0435\u043b \u0433\u0440\u0430\u0434\u0443\u0441\u044b \u043a\u043e\u043c\u043f\u0430\u0441\u0430 \u0432 \u0440\u0430\u0434\u0438\u0430\u043d\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:\u00a0<a href=\"https:\/\/pingouin-stats.org\/build\/html\/generated\/pingouin.convert_angles.html#pingouin.convert_angles\" rel=\"noopener noreferrer nofollow\"><code>pingouin<\/code><\/a>, \u0438 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0447\u0435\u0440\u0435\u0437\u00a0circ_mean:<\/p>\n<pre><code class=\"python\">from pingouin import circ_mean  arithmetic_mean = data['radians'].mean() circular_mean = circ_mean(data['radians'])  print(f\"Arithmetic mean: {arithmetic_mean:.3f}; Circular mean: {circular_mean:.3f}\")<\/code><\/pre>\n<pre><code>&gt;&gt; Arithmetic mean: 0.082; Circular mean: 2.989<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u0441\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u00a0<a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.stats.vonmises.html\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430<\/a>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f.\u00a0<\/p>\n<blockquote>\n<p>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u043e\u043d \u041c\u0438\u0437\u0435\u0441\u0430 \u2014 \u044d\u0442\u043e \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u041e\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0443\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438: \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u043b\u043e\u043a\u0430\u0446\u0438\u0435\u0439\u0438 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0435\u0439. \u041a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0431\u0440\u043e\u0441 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0434\u0438\u0441\u043f\u0435\u0440\u0441\u0438\u0438. \u041a\u043e\u0433\u0434\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0440\u0430\u0432\u0435\u043d \u043d\u0443\u043b\u044e, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c, \u043f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0446\u0438\u0438, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e.\u00a0<\/p>\n<\/blockquote>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:\u00a0<\/p>\n<pre><code class=\"python\">import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns  from scipy.stats import vonmises from pingouin import convert_angles from typing import Tuple, List   def vonmises_kde(series: np.ndarray, kappa: float, n_bins: int = 100) -&gt; Tuple[np.ndarray, np.ndarray]:     \"\"\"     Estimate a von Mises kernel density estimate (KDE) over circular data using scipy.          Parameters:     series: np.ndarray          The input data in radians, expected to be a 1D array.     kappa: float         The concentration parameter for the von Mises distribution.     n_bins: int         The number of bins for the KDE estimate (default is 100).          Returns:     bins: np.ndarray         The bin edges (x-values) used for the KDE.     kde: np.ndarray         The estimated density values (y-values) for each bin.     \"\"\"     bins = np.linspace(-np.pi, np.pi, n_bins)     kde = np.zeros(n_bins)          for angle in series:         kde += vonmises.pdf(bins, kappa, loc=angle)          kde = kde \/ len(series)     return bins, kde   def plot_circular_distribution(     data: pd.DataFrame,     plot_type: str = 'kde',     bins: int = 30,     figsize: tuple = (4, 4),     **kwargs ) -&gt; None:     \"\"\"     Plot a compass rose with either KDE or histogram for circular data.          Parameters:     -----------     data: pd.DataFrame         DataFrame containing 'degrees'and 'radians' columns with circular data     plot_type: str         Type of plot to create: 'kde' or 'histogram'     bins: int         Number of bins for histogram or smoothing parameter for KDE     figsize: tuple         Figure size as (width, height)     **kwargs: dict         Additional styling arguments for histogram (color, edgecolor, etc.)     \"\"\"     plt.figure(figsize=figsize)     ax = plt.subplot(111, projection='polar')      ax.set_theta_zero_location('N')     ax.set_theta_direction(-1)      # add cardinal directions     directions = ['N', 'E', 'S', 'W']     angles = [0, np.pi \/ 2, np.pi, 3 * np.pi \/ 2]     for direction, angle in zip(directions, angles):         ax.text(             angle, 0.45, direction,             horizontalalignment='center',             verticalalignment='center',             fontsize=12,             weight='bold'         )      if plot_type.lower() == 'kde':         x, kde = vonmises_kde(data['radians'].values, bins)         ax.plot(x, kde, color=kwargs.get('color', 'red'), lw=2)          elif plot_type.lower() == 'histogram':         hist_kwargs = {             'color': 'teal',             'edgecolor': 'black',             'alpha': 0.7         }         hist_kwargs.update(kwargs)                   angles_rad = np.deg2rad(data['degrees'].values)         counts, bin_edges = np.histogram(             angles_rad,              bins=bins,              range=(0, 2*np.pi),              density=True         )         widths <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-453647","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/453647","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=453647"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/453647\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=453647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=453647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=453647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}