{"action":"created","comment":{"url":"https://api.github.com/repos/stripe/rainier/pulls/comments/220366744","pull_request_review_id":158759617,"id":220366744,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDM2Njc0NA==","diff_hunk":"@@ -22,9 +22,11 @@ final case class SBC[T, L <: Distribution[T]](priors: Seq[Continuous],\n   def posteriorSamples(nSamples: Int)(implicit rng: RNG): List[T] =\n     RandomVariable\n       .traverse(priors.map(_.param))\n-      .map { priorParams =>\n+      .flatMap { priorParams =>","path":"rainier-core/src/main/scala/com/stripe/rainier/core/SBC.scala","position":5,"original_position":5,"commit_id":"9dda111001d0ea9e6b89c7e827b71013dfc2b62e","original_commit_id":"9dda111001d0ea9e6b89c7e827b71013dfc2b62e","user":{"login":"mio-stripe","id":21321145,"node_id":"MDQ6VXNlcjIxMzIxMTQ1","avatar_url":"https://avatars2.githubusercontent.com/u/21321145?v=4","gravatar_id":"","url":"https://api.github.com/users/mio-stripe","html_url":"https://github.com/mio-stripe","followers_url":"https://api.github.com/users/mio-stripe/followers","following_url":"https://api.github.com/users/mio-stripe/following{/other_user}","gists_url":"https://api.github.com/users/mio-stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/mio-stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mio-stripe/subscriptions","organizations_url":"https://api.github.com/users/mio-stripe/orgs","repos_url":"https://api.github.com/users/mio-stripe/repos","events_url":"https://api.github.com/users/mio-stripe/events{/privacy}","received_events_url":"https://api.github.com/users/mio-stripe/received_events","type":"User","site_admin":false},"body":"@avi-stripe addressing your comment about exercising the logDensity and generator for both the prior and likelihood: I'm almost doing `model(1000).sample(nSamples)`, but `SBC.fit` returns the prior so I did this to get samples from the posterior. It looks like we've got everything now because we use both generators in `synthesize` (and the posterior generator again here) and flatmapping with a call to `RandomVariable.fit` uses both logDensities. This is pretty similar to `fit` and `synthesize` so lemme know if you see a better way to do this.","created_at":"2018-09-25T21:47:46Z","updated_at":"2018-09-25T21:47:46Z","html_url":"https://github.com/stripe/rainier/pull/205#discussion_r220366744","pull_request_url":"https://api.github.com/repos/stripe/rainier/pulls/205","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/stripe/rainier/pulls/comments/220366744"},"html":{"href":"https://github.com/stripe/rainier/pull/205#discussion_r220366744"},"pull_request":{"href":"https://api.github.com/repos/stripe/rainier/pulls/205"}}},"pull_request":{"url":"https://api.github.com/repos/stripe/rainier/pulls/205","id":216462224,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2NDYyMjI0","html_url":"https://github.com/stripe/rainier/pull/205","diff_url":"https://github.com/stripe/rainier/pull/205.diff","patch_url":"https://github.com/stripe/rainier/pull/205.patch","issue_url":"https://api.github.com/repos/stripe/rainier/issues/205","number":205,"state":"open","locked":false,"title":"[WIP] Move more tests over to SBC","user":{"login":"mio-stripe","id":21321145,"node_id":"MDQ6VXNlcjIxMzIxMTQ1","avatar_url":"https://avatars2.githubusercontent.com/u/21321145?v=4","gravatar_id":"","url":"https://api.github.com/users/mio-stripe","html_url":"https://github.com/mio-stripe","followers_url":"https://api.github.com/users/mio-stripe/followers","following_url":"https://api.github.com/users/mio-stripe/following{/other_user}","gists_url":"https://api.github.com/users/mio-stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/mio-stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mio-stripe/subscriptions","organizations_url":"https://api.github.com/users/mio-stripe/orgs","repos_url":"https://api.github.com/users/mio-stripe/repos","events_url":"https://api.github.com/users/mio-stripe/events{/privacy}","received_events_url":"https://api.github.com/users/mio-stripe/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-18T22:25:47Z","updated_at":"2018-09-25T21:47:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6495ba97b97a3ec8242ce22b14fdebfca965d16e","assignee":null,"assignees":[],"requested_reviewers":[{"login":"avi-stripe","id":23175169,"node_id":"MDQ6VXNlcjIzMTc1MTY5","avatar_url":"https://avatars1.githubusercontent.com/u/23175169?v=4","gravatar_id":"","url":"https://api.github.com/users/avi-stripe","html_url":"https://github.com/avi-stripe","followers_url":"https://api.github.com/users/avi-stripe/followers","following_url":"https://api.github.com/users/avi-stripe/following{/other_user}","gists_url":"https://api.github.com/users/avi-stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/avi-stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avi-stripe/subscriptions","organizations_url":"https://api.github.com/users/avi-stripe/orgs","repos_url":"https://api.github.com/users/avi-stripe/repos","events_url":"https://api.github.com/users/avi-stripe/events{/privacy}","received_events_url":"https://api.github.com/users/avi-stripe/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/stripe/rainier/pulls/205/commits","review_comments_url":"https://api.github.com/repos/stripe/rainier/pulls/205/comments","review_comment_url":"https://api.github.com/repos/stripe/rainier/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stripe/rainier/issues/205/comments","statuses_url":"https://api.github.com/repos/stripe/rainier/statuses/9dda111001d0ea9e6b89c7e827b71013dfc2b62e","head":{"label":"stripe:mio/more-sbc","ref":"mio/more-sbc","sha":"9dda111001d0ea9e6b89c7e827b71013dfc2b62e","user":{"login":"stripe","id":856813,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg1NjgxMw==","avatar_url":"https://avatars1.githubusercontent.com/u/856813?v=4","gravatar_id":"","url":"https://api.github.com/users/stripe","html_url":"https://github.com/stripe","followers_url":"https://api.github.com/users/stripe/followers","following_url":"https://api.github.com/users/stripe/following{/other_user}","gists_url":"https://api.github.com/users/stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stripe/subscriptions","organizations_url":"https://api.github.com/users/stripe/orgs","repos_url":"https://api.github.com/users/stripe/repos","events_url":"https://api.github.com/users/stripe/events{/privacy}","received_events_url":"https://api.github.com/users/stripe/received_events","type":"Organization","site_admin":false},"repo":{"id":124964747,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQ5NjQ3NDc=","name":"rainier","full_name":"stripe/rainier","private":false,"owner":{"login":"stripe","id":856813,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg1NjgxMw==","avatar_url":"https://avatars1.githubusercontent.com/u/856813?v=4","gravatar_id":"","url":"https://api.github.com/users/stripe","html_url":"https://github.com/stripe","followers_url":"https://api.github.com/users/stripe/followers","following_url":"https://api.github.com/users/stripe/following{/other_user}","gists_url":"https://api.github.com/users/stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stripe/subscriptions","organizations_url":"https://api.github.com/users/stripe/orgs","repos_url":"https://api.github.com/users/stripe/repos","events_url":"https://api.github.com/users/stripe/events{/privacy}","received_events_url":"https://api.github.com/users/stripe/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/stripe/rainier","description":"Bayesian inference in Scala.","fork":false,"url":"https://api.github.com/repos/stripe/rainier","forks_url":"https://api.github.com/repos/stripe/rainier/forks","keys_url":"https://api.github.com/repos/stripe/rainier/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stripe/rainier/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stripe/rainier/teams","hooks_url":"https://api.github.com/repos/stripe/rainier/hooks","issue_events_url":"https://api.github.com/repos/stripe/rainier/issues/events{/number}","events_url":"https://api.github.com/repos/stripe/rainier/events","assignees_url":"https://api.github.com/repos/stripe/rainier/assignees{/user}","branches_url":"https://api.github.com/repos/stripe/rainier/branches{/branch}","tags_url":"https://api.github.com/repos/stripe/rainier/tags","blobs_url":"https://api.github.com/repos/stripe/rainier/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stripe/rainier/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stripe/rainier/git/refs{/sha}","trees_url":"https://api.github.com/repos/stripe/rainier/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stripe/rainier/statuses/{sha}","languages_url":"https://api.github.com/repos/stripe/rainier/languages","stargazers_url":"https://api.github.com/repos/stripe/rainier/stargazers","contributors_url":"https://api.github.com/repos/stripe/rainier/contributors","subscribers_url":"https://api.github.com/repos/stripe/rainier/subscribers","subscription_url":"https://api.github.com/repos/stripe/rainier/subscription","commits_url":"https://api.github.com/repos/stripe/rainier/commits{/sha}","git_commits_url":"https://api.github.com/repos/stripe/rainier/git/commits{/sha}","comments_url":"https://api.github.com/repos/stripe/rainier/comments{/number}","issue_comment_url":"https://api.github.com/repos/stripe/rainier/issues/comments{/number}","contents_url":"https://api.github.com/repos/stripe/rainier/contents/{+path}","compare_url":"https://api.github.com/repos/stripe/rainier/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stripe/rainier/merges","archive_url":"https://api.github.com/repos/stripe/rainier/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stripe/rainier/downloads","issues_url":"https://api.github.com/repos/stripe/rainier/issues{/number}","pulls_url":"https://api.github.com/repos/stripe/rainier/pulls{/number}","milestones_url":"https://api.github.com/repos/stripe/rainier/milestones{/number}","notifications_url":"https://api.github.com/repos/stripe/rainier/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stripe/rainier/labels{/name}","releases_url":"https://api.github.com/repos/stripe/rainier/releases{/id}","deployments_url":"https://api.github.com/repos/stripe/rainier/deployments","created_at":"2018-03-12T23:35:29Z","updated_at":"2018-09-25T16:48:28Z","pushed_at":"2018-09-25T21:22:55Z","git_url":"git://github.com/stripe/rainier.git","ssh_url":"git@github.com:stripe/rainier.git","clone_url":"https://github.com/stripe/rainier.git","svn_url":"https://github.com/stripe/rainier","homepage":"","size":1223,"stargazers_count":181,"watchers_count":181,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":27,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":15,"open_issues":27,"watchers":181,"default_branch":"develop"}},"base":{"label":"stripe:mio/sbc","ref":"mio/sbc","sha":"2d0e8fb34abce637f55488771cf12a341b6897d4","user":{"login":"stripe","id":856813,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg1NjgxMw==","avatar_url":"https://avatars1.githubusercontent.com/u/856813?v=4","gravatar_id":"","url":"https://api.github.com/users/stripe","html_url":"https://github.com/stripe","followers_url":"https://api.github.com/users/stripe/followers","following_url":"https://api.github.com/users/stripe/following{/other_user}","gists_url":"https://api.github.com/users/stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stripe/subscriptions","organizations_url":"https://api.github.com/users/stripe/orgs","repos_url":"https://api.github.com/users/stripe/repos","events_url":"https://api.github.com/users/stripe/events{/privacy}","received_events_url":"https://api.github.com/users/stripe/received_events","type":"Organization","site_admin":false},"repo":{"id":124964747,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQ5NjQ3NDc=","name":"rainier","full_name":"stripe/rainier","private":false,"owner":{"login":"stripe","id":856813,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg1NjgxMw==","avatar_url":"https://avatars1.githubusercontent.com/u/856813?v=4","gravatar_id":"","url":"https://api.github.com/users/stripe","html_url":"https://github.com/stripe","followers_url":"https://api.github.com/users/stripe/followers","following_url":"https://api.github.com/users/stripe/following{/other_user}","gists_url":"https://api.github.com/users/stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stripe/subscriptions","organizations_url":"https://api.github.com/users/stripe/orgs","repos_url":"https://api.github.com/users/stripe/repos","events_url":"https://api.github.com/users/stripe/events{/privacy}","received_events_url":"https://api.github.com/users/stripe/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/stripe/rainier","description":"Bayesian inference in Scala.","fork":false,"url":"https://api.github.com/repos/stripe/rainier","forks_url":"https://api.github.com/repos/stripe/rainier/forks","keys_url":"https://api.github.com/repos/stripe/rainier/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stripe/rainier/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stripe/rainier/teams","hooks_url":"https://api.github.com/repos/stripe/rainier/hooks","issue_events_url":"https://api.github.com/repos/stripe/rainier/issues/events{/number}","events_url":"https://api.github.com/repos/stripe/rainier/events","assignees_url":"https://api.github.com/repos/stripe/rainier/assignees{/user}","branches_url":"https://api.github.com/repos/stripe/rainier/branches{/branch}","tags_url":"https://api.github.com/repos/stripe/rainier/tags","blobs_url":"https://api.github.com/repos/stripe/rainier/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stripe/rainier/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stripe/rainier/git/refs{/sha}","trees_url":"https://api.github.com/repos/stripe/rainier/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stripe/rainier/statuses/{sha}","languages_url":"https://api.github.com/repos/stripe/rainier/languages","stargazers_url":"https://api.github.com/repos/stripe/rainier/stargazers","contributors_url":"https://api.github.com/repos/stripe/rainier/contributors","subscribers_url":"https://api.github.com/repos/stripe/rainier/subscribers","subscription_url":"https://api.github.com/repos/stripe/rainier/subscription","commits_url":"https://api.github.com/repos/stripe/rainier/commits{/sha}","git_commits_url":"https://api.github.com/repos/stripe/rainier/git/commits{/sha}","comments_url":"https://api.github.com/repos/stripe/rainier/comments{/number}","issue_comment_url":"https://api.github.com/repos/stripe/rainier/issues/comments{/number}","contents_url":"https://api.github.com/repos/stripe/rainier/contents/{+path}","compare_url":"https://api.github.com/repos/stripe/rainier/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stripe/rainier/merges","archive_url":"https://api.github.com/repos/stripe/rainier/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stripe/rainier/downloads","issues_url":"https://api.github.com/repos/stripe/rainier/issues{/number}","pulls_url":"https://api.github.com/repos/stripe/rainier/pulls{/number}","milestones_url":"https://api.github.com/repos/stripe/rainier/milestones{/number}","notifications_url":"https://api.github.com/repos/stripe/rainier/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stripe/rainier/labels{/name}","releases_url":"https://api.github.com/repos/stripe/rainier/releases{/id}","deployments_url":"https://api.github.com/repos/stripe/rainier/deployments","created_at":"2018-03-12T23:35:29Z","updated_at":"2018-09-25T16:48:28Z","pushed_at":"2018-09-25T21:22:55Z","git_url":"git://github.com/stripe/rainier.git","ssh_url":"git@github.com:stripe/rainier.git","clone_url":"https://github.com/stripe/rainier.git","svn_url":"https://github.com/stripe/rainier","homepage":"","size":1223,"stargazers_count":181,"watchers_count":181,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":27,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":15,"open_issues":27,"watchers":181,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/stripe/rainier/pulls/205"},"html":{"href":"https://github.com/stripe/rainier/pull/205"},"issue":{"href":"https://api.github.com/repos/stripe/rainier/issues/205"},"comments":{"href":"https://api.github.com/repos/stripe/rainier/issues/205/comments"},"review_comments":{"href":"https://api.github.com/repos/stripe/rainier/pulls/205/comments"},"review_comment":{"href":"https://api.github.com/repos/stripe/rainier/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stripe/rainier/pulls/205/commits"},"statuses":{"href":"https://api.github.com/repos/stripe/rainier/statuses/9dda111001d0ea9e6b89c7e827b71013dfc2b62e"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"mio-stripe"}}