{"action":"created","comment":{"url":"https://api.github.com/repos/stan-ja/stan-ja/pulls/comments/73276761","id":73276761,"diff_hunk":"@@ -0,0 +1,73 @@\n+## 56. ベイズデータ解析\n+\n+Gelmanら(2013)はベイズデータ解析の特徴を以下のように述べています。\n+\n+> ベイズデータ解析と言うときは、観測する量や、知りたい量について、確率モデルを使ってデータから推定を行なう実用的な方法という意味で言っています。\n+\n+続けて、ベイズ統計が頻度主義の方法とどのように異なるかを記述しています。\n+\n+> ベイズ法の本質的な特徴は、統計解析に基づく推定の際、不確実性を定量化するのに確率を明示的に使うところにあります。\n+\n+厳密な頻度主義者は、観測値の相対頻度の極値を確率と見なしますから、パラメータについて確率的に言明することを禁止します。パラメータは固定したもので、確率的（**randomの訳**）ではないとされるのです。\n+\n+ベイズ主義者も、パラメータを固定した、未知のものと扱います。しかし頻度主義者とは異なり、パラメータの事前分布と、パラメータの事後分布の両方を使います。これら事前分布・事後分布と事後予測確率は、パラメータと将来の観測値についての知識を特徴づけるためにあります。以下で述べるように、事後分布はベイズ推定の基礎を形づくるものです。\n+\n+### 56.1 ベイズモデリング\n+\n+Gelmanら(2013)は、応用ベイズモデリングを以下の3ステップに分解しています。\n+\n+1. すべての観測可能な量と観測不可能な量とについてのフル確率モデルをつくります。このモデルは、モデリングするデータとそれがどのように集められたかということについて、既存の知識と合致するべきです。\n+\n+2. 観測された量を条件として未知の量の事後確率を計算します。未知の量には、パラメータのような観測できない量や、将来の観測の予測値のような潜在的には観測可能な量といったものが含まれるでしょう。\n+\n+3. データに対するモデルの当てはまりを評価します。これには、事後分布の効果（**implicationsの訳**）を評価することも含まれます。\n+\n+典型的には、3番目のステップでじゅうぶんな当てはまりが得られるまでこのサイクルは繰り返されます。Stanは、2番目と3番目のステップに含まれる計算を自動化します。\n+\n+### 56.2 ベイズ推定\n+\n+#### 基本的な量\n+\n+ベイズ推定のメカニズムはそのままベイズの定理に従っています。記法を定めて、$y$でデータのような観測された量を表し、$\\theta$でパラメータや将来の観測値のような未知の量を表すとします。$y$と$\\theta$の両方が確率的（**randomの訳**）としてモデリングされるでしょう。定数や、ハイパーパラメータ、予測変数のような、既知ですがモデリングされない量を$x$で表すとします。\n+\n+#### 確率関数\n+\n+確率関数$p(y,\\theta)$は、データ$y$とパラメータ$\\theta$の同時確率関数です。定数および予測変数$x$は、明示されていませんが条件に含まれていることになっています。パラメータ$\\theta$が与えられたときのデータ$y$の条件付き確率関数$p(y \\mid \\theta)$はサンプリング確率関数と呼ばれます。また、$y$と$x$を固定して$\\theta$の関数と見たときには尤度関数とも呼ばれます。\n+\n+定数$x$が与えられたときのパラメータについての確率関数$p(\\theta)$は事前分布と呼ばれます。というのは、データがまだまったく観測されていないときのパラメータの確率を特徴づけるものだからです。条件付き確率関数$p(\\theta \\mid y)$は事後分布と呼ばれます。観測データ$y$と定数$x$とが与えられたときのパラメータの確率を特徴づけるものだからです。\n+\n+#### ベイズの定理\n+\n+ベイズ推定の技術的な仕組みは、以下の一連の式のように決まっています。これはベイズの定理のさまざまな形式として知られています（ここでも、定数$x$は明示していません）。\n+\n+![$$ \\begin{array}{lll} p(\\theta\\mid y) &= \\frac{p(\\theta, y)}{p(y)} & [条件付き確率の定義]\\\\ &= \\frac{p(y\\mid\\theta)p(\\theta)}{p(y)} & [連鎖律] \\\\ &= \\frac{p(y\\mid\\theta)p(\\theta)}{\\int_{\\Theta}p(y,\\theta)d\\theta} & [全確率の法則] \\\\ &= \\frac{p(y\\mid\\theta)p(\\theta)}{\\int_{\\Theta}p(y\\mid\\theta)p(\\theta)d\\theta} & [連鎖律] \\\\ &\\propto p(y\\mid\\theta)p(\\theta) & [yは固定値] \\end{array} $$](fig/fig01.png)\n+\n+（**chain rule は「連鎖律」でよい?**）\n+\n+ベイズの定理は、事後確率$p(\\theta \\mid y)$を「ひっくり返し」て、尤度$p(y \\mid \\theta)$と事前分布$p(\\theta)$だけからなる項で表します（ここでも、定数および予測変数$x$は明示していません）。最後のステップはStanにとって重要です。Stanでは、確率関数のみが必要で、これに定数が掛けられることになります（**訳: to be characterized up to a constant multiplier: よくわかりません**）。","path":"part07/chap56/chap56.md","position":47,"original_position":47,"commit_id":"4812ca644377d2e884715be355a1a46bc38b9599","original_commit_id":"4812ca644377d2e884715be355a1a46bc38b9599","user":{"login":"hagijyun","id":19633848,"avatar_url":"https://avatars.githubusercontent.com/u/19633848?v=3","gravatar_id":"","url":"https://api.github.com/users/hagijyun","html_url":"https://github.com/hagijyun","followers_url":"https://api.github.com/users/hagijyun/followers","following_url":"https://api.github.com/users/hagijyun/following{/other_user}","gists_url":"https://api.github.com/users/hagijyun/gists{/gist_id}","starred_url":"https://api.github.com/users/hagijyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hagijyun/subscriptions","organizations_url":"https://api.github.com/users/hagijyun/orgs","repos_url":"https://api.github.com/users/hagijyun/repos","events_url":"https://api.github.com/users/hagijyun/events{/privacy}","received_events_url":"https://api.github.com/users/hagijyun/received_events","type":"User","site_admin":false},"body":"　最後のステップはStanにとって重要です。Stanでは、確率関数のみが必要で、これに定数が掛けられることになります。\r\n→最後のステップがStanにとっては重要で、Stanで必要なのは定係数を除いた確率関数の部分のみです。\r\n\r\n取り急ぎ部分的なコメントで恐縮ですが、\"up to ～\"は数学関連の文章では通常の文章とやや趣が異なり「～を除く」と訳すとしっくりくる場合が個人的に多く、ここでもその意図で使われているのではないかと推測して、表現を少しだけ変えてみました。\r\n内容は同じだと思いますので趣味の範疇かもしれませんが、参考にしていただけると幸いです。","created_at":"2016-08-03T03:44:43Z","updated_at":"2016-08-03T03:44:43Z","html_url":"https://github.com/stan-ja/stan-ja/pull/56#discussion_r73276761","pull_request_url":"https://api.github.com/repos/stan-ja/stan-ja/pulls/56","_links":{"self":{"href":"https://api.github.com/repos/stan-ja/stan-ja/pulls/comments/73276761"},"html":{"href":"https://github.com/stan-ja/stan-ja/pull/56#discussion_r73276761"},"pull_request":{"href":"https://api.github.com/repos/stan-ja/stan-ja/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/stan-ja/stan-ja/pulls/56","id":79825074,"html_url":"https://github.com/stan-ja/stan-ja/pull/56","diff_url":"https://github.com/stan-ja/stan-ja/pull/56.diff","patch_url":"https://github.com/stan-ja/stan-ja/pull/56.patch","issue_url":"https://api.github.com/repos/stan-ja/stan-ja/issues/56","number":56,"state":"open","locked":false,"title":"56章を訳しました","user":{"login":"ito4303","id":13703977,"avatar_url":"https://avatars.githubusercontent.com/u/13703977?v=3","gravatar_id":"","url":"https://api.github.com/users/ito4303","html_url":"https://github.com/ito4303","followers_url":"https://api.github.com/users/ito4303/followers","following_url":"https://api.github.com/users/ito4303/following{/other_user}","gists_url":"https://api.github.com/users/ito4303/gists{/gist_id}","starred_url":"https://api.github.com/users/ito4303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ito4303/subscriptions","organizations_url":"https://api.github.com/users/ito4303/orgs","repos_url":"https://api.github.com/users/ito4303/repos","events_url":"https://api.github.com/users/ito4303/events{/privacy}","received_events_url":"https://api.github.com/users/ito4303/received_events","type":"User","site_admin":false},"body":"レビューお願いいたします。","created_at":"2016-08-02T23:16:13Z","updated_at":"2016-08-03T03:44:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6895ea4dbd3c04cb468e1f3e63a46fe8882d3f45","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/stan-ja/stan-ja/pulls/56/commits","review_comments_url":"https://api.github.com/repos/stan-ja/stan-ja/pulls/56/comments","review_comment_url":"https://api.github.com/repos/stan-ja/stan-ja/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stan-ja/stan-ja/issues/56/comments","statuses_url":"https://api.github.com/repos/stan-ja/stan-ja/statuses/4812ca644377d2e884715be355a1a46bc38b9599","head":{"label":"stan-ja:create/part07/chap56","ref":"create/part07/chap56","sha":"4812ca644377d2e884715be355a1a46bc38b9599","user":{"login":"stan-ja","id":16357636,"avatar_url":"https://avatars.githubusercontent.com/u/16357636?v=3","gravatar_id":"","url":"https://api.github.com/users/stan-ja","html_url":"https://github.com/stan-ja","followers_url":"https://api.github.com/users/stan-ja/followers","following_url":"https://api.github.com/users/stan-ja/following{/other_user}","gists_url":"https://api.github.com/users/stan-ja/gists{/gist_id}","starred_url":"https://api.github.com/users/stan-ja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stan-ja/subscriptions","organizations_url":"https://api.github.com/users/stan-ja/orgs","repos_url":"https://api.github.com/users/stan-ja/repos","events_url":"https://api.github.com/users/stan-ja/events{/privacy}","received_events_url":"https://api.github.com/users/stan-ja/received_events","type":"Organization","site_admin":false},"repo":{"id":48265007,"name":"stan-ja","full_name":"stan-ja/stan-ja","owner":{"login":"stan-ja","id":16357636,"avatar_url":"https://avatars.githubusercontent.com/u/16357636?v=3","gravatar_id":"","url":"https://api.github.com/users/stan-ja","html_url":"https://github.com/stan-ja","followers_url":"https://api.github.com/users/stan-ja/followers","following_url":"https://api.github.com/users/stan-ja/following{/other_user}","gists_url":"https://api.github.com/users/stan-ja/gists{/gist_id}","starred_url":"https://api.github.com/users/stan-ja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stan-ja/subscriptions","organizations_url":"https://api.github.com/users/stan-ja/orgs","repos_url":"https://api.github.com/users/stan-ja/repos","events_url":"https://api.github.com/users/stan-ja/events{/privacy}","received_events_url":"https://api.github.com/users/stan-ja/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stan-ja/stan-ja","description":"","fork":false,"url":"https://api.github.com/repos/stan-ja/stan-ja","forks_url":"https://api.github.com/repos/stan-ja/stan-ja/forks","keys_url":"https://api.github.com/repos/stan-ja/stan-ja/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stan-ja/stan-ja/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stan-ja/stan-ja/teams","hooks_url":"https://api.github.com/repos/stan-ja/stan-ja/hooks","issue_events_url":"https://api.github.com/repos/stan-ja/stan-ja/issues/events{/number}","events_url":"https://api.github.com/repos/stan-ja/stan-ja/events","assignees_url":"https://api.github.com/repos/stan-ja/stan-ja/assignees{/user}","branches_url":"https://api.github.com/repos/stan-ja/stan-ja/branches{/branch}","tags_url":"https://api.github.com/repos/stan-ja/stan-ja/tags","blobs_url":"https://api.github.com/repos/stan-ja/stan-ja/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stan-ja/stan-ja/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stan-ja/stan-ja/git/refs{/sha}","trees_url":"https://api.github.com/repos/stan-ja/stan-ja/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stan-ja/stan-ja/statuses/{sha}","languages_url":"https://api.github.com/repos/stan-ja/stan-ja/languages","stargazers_url":"https://api.github.com/repos/stan-ja/stan-ja/stargazers","contributors_url":"https://api.github.com/repos/stan-ja/stan-ja/contributors","subscribers_url":"https://api.github.com/repos/stan-ja/stan-ja/subscribers","subscription_url":"https://api.github.com/repos/stan-ja/stan-ja/subscription","commits_url":"https://api.github.com/repos/stan-ja/stan-ja/commits{/sha}","git_commits_url":"https://api.github.com/repos/stan-ja/stan-ja/git/commits{/sha}","comments_url":"https://api.github.com/repos/stan-ja/stan-ja/comments{/number}","issue_comment_url":"https://api.github.com/repos/stan-ja/stan-ja/issues/comments{/number}","contents_url":"https://api.github.com/repos/stan-ja/stan-ja/contents/{+path}","compare_url":"https://api.github.com/repos/stan-ja/stan-ja/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stan-ja/stan-ja/merges","archive_url":"https://api.github.com/repos/stan-ja/stan-ja/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stan-ja/stan-ja/downloads","issues_url":"https://api.github.com/repos/stan-ja/stan-ja/issues{/number}","pulls_url":"https://api.github.com/repos/stan-ja/stan-ja/pulls{/number}","milestones_url":"https://api.github.com/repos/stan-ja/stan-ja/milestones{/number}","notifications_url":"https://api.github.com/repos/stan-ja/stan-ja/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stan-ja/stan-ja/labels{/name}","releases_url":"https://api.github.com/repos/stan-ja/stan-ja/releases{/id}","deployments_url":"https://api.github.com/repos/stan-ja/stan-ja/deployments","created_at":"2015-12-19T02:08:26Z","updated_at":"2016-07-17T09:02:09Z","pushed_at":"2016-08-02T23:16:13Z","git_url":"git://github.com/stan-ja/stan-ja.git","ssh_url":"git@github.com:stan-ja/stan-ja.git","clone_url":"https://github.com/stan-ja/stan-ja.git","svn_url":"https://github.com/stan-ja/stan-ja","homepage":null,"size":4040,"stargazers_count":15,"watchers_count":15,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":15,"default_branch":"master"}},"base":{"label":"stan-ja:master","ref":"master","sha":"ebb373413319a888e1f346bc82303b64b79d8c39","user":{"login":"stan-ja","id":16357636,"avatar_url":"https://avatars.githubusercontent.com/u/16357636?v=3","gravatar_id":"","url":"https://api.github.com/users/stan-ja","html_url":"https://github.com/stan-ja","followers_url":"https://api.github.com/users/stan-ja/followers","following_url":"https://api.github.com/users/stan-ja/following{/other_user}","gists_url":"https://api.github.com/users/stan-ja/gists{/gist_id}","starred_url":"https://api.github.com/users/stan-ja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stan-ja/subscriptions","organizations_url":"https://api.github.com/users/stan-ja/orgs","repos_url":"https://api.github.com/users/stan-ja/repos","events_url":"https://api.github.com/users/stan-ja/events{/privacy}","received_events_url":"https://api.github.com/users/stan-ja/received_events","type":"Organization","site_admin":false},"repo":{"id":48265007,"name":"stan-ja","full_name":"stan-ja/stan-ja","owner":{"login":"stan-ja","id":16357636,"avatar_url":"https://avatars.githubusercontent.com/u/16357636?v=3","gravatar_id":"","url":"https://api.github.com/users/stan-ja","html_url":"https://github.com/stan-ja","followers_url":"https://api.github.com/users/stan-ja/followers","following_url":"https://api.github.com/users/stan-ja/following{/other_user}","gists_url":"https://api.github.com/users/stan-ja/gists{/gist_id}","starred_url":"https://api.github.com/users/stan-ja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stan-ja/subscriptions","organizations_url":"https://api.github.com/users/stan-ja/orgs","repos_url":"https://api.github.com/users/stan-ja/repos","events_url":"https://api.github.com/users/stan-ja/events{/privacy}","received_events_url":"https://api.github.com/users/stan-ja/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stan-ja/stan-ja","description":"","fork":false,"url":"https://api.github.com/repos/stan-ja/stan-ja","forks_url":"https://api.github.com/repos/stan-ja/stan-ja/forks","keys_url":"https://api.github.com/repos/stan-ja/stan-ja/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stan-ja/stan-ja/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stan-ja/stan-ja/teams","hooks_url":"https://api.github.com/repos/stan-ja/stan-ja/hooks","issue_events_url":"https://api.github.com/repos/stan-ja/stan-ja/issues/events{/number}","events_url":"https://api.github.com/repos/stan-ja/stan-ja/events","assignees_url":"https://api.github.com/repos/stan-ja/stan-ja/assignees{/user}","branches_url":"https://api.github.com/repos/stan-ja/stan-ja/branches{/branch}","tags_url":"https://api.github.com/repos/stan-ja/stan-ja/tags","blobs_url":"https://api.github.com/repos/stan-ja/stan-ja/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stan-ja/stan-ja/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stan-ja/stan-ja/git/refs{/sha}","trees_url":"https://api.github.com/repos/stan-ja/stan-ja/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stan-ja/stan-ja/statuses/{sha}","languages_url":"https://api.github.com/repos/stan-ja/stan-ja/languages","stargazers_url":"https://api.github.com/repos/stan-ja/stan-ja/stargazers","contributors_url":"https://api.github.com/repos/stan-ja/stan-ja/contributors","subscribers_url":"https://api.github.com/repos/stan-ja/stan-ja/subscribers","subscription_url":"https://api.github.com/repos/stan-ja/stan-ja/subscription","commits_url":"https://api.github.com/repos/stan-ja/stan-ja/commits{/sha}","git_commits_url":"https://api.github.com/repos/stan-ja/stan-ja/git/commits{/sha}","comments_url":"https://api.github.com/repos/stan-ja/stan-ja/comments{/number}","issue_comment_url":"https://api.github.com/repos/stan-ja/stan-ja/issues/comments{/number}","contents_url":"https://api.github.com/repos/stan-ja/stan-ja/contents/{+path}","compare_url":"https://api.github.com/repos/stan-ja/stan-ja/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stan-ja/stan-ja/merges","archive_url":"https://api.github.com/repos/stan-ja/stan-ja/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stan-ja/stan-ja/downloads","issues_url":"https://api.github.com/repos/stan-ja/stan-ja/issues{/number}","pulls_url":"https://api.github.com/repos/stan-ja/stan-ja/pulls{/number}","milestones_url":"https://api.github.com/repos/stan-ja/stan-ja/milestones{/number}","notifications_url":"https://api.github.com/repos/stan-ja/stan-ja/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stan-ja/stan-ja/labels{/name}","releases_url":"https://api.github.com/repos/stan-ja/stan-ja/releases{/id}","deployments_url":"https://api.github.com/repos/stan-ja/stan-ja/deployments","created_at":"2015-12-19T02:08:26Z","updated_at":"2016-07-17T09:02:09Z","pushed_at":"2016-08-02T23:16:13Z","git_url":"git://github.com/stan-ja/stan-ja.git","ssh_url":"git@github.com:stan-ja/stan-ja.git","clone_url":"https://github.com/stan-ja/stan-ja.git","svn_url":"https://github.com/stan-ja/stan-ja","homepage":null,"size":4040,"stargazers_count":15,"watchers_count":15,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stan-ja/stan-ja/pulls/56"},"html":{"href":"https://github.com/stan-ja/stan-ja/pull/56"},"issue":{"href":"https://api.github.com/repos/stan-ja/stan-ja/issues/56"},"comments":{"href":"https://api.github.com/repos/stan-ja/stan-ja/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/stan-ja/stan-ja/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/stan-ja/stan-ja/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stan-ja/stan-ja/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/stan-ja/stan-ja/statuses/4812ca644377d2e884715be355a1a46bc38b9599"}}}}
{"actor":{"display_login":"hagijyun"}}