{"action":"created","comment":{"url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/pulls/comments/74305132","id":74305132,"diff_hunk":"@@ -0,0 +1,59 @@\n+#=\n+Filename: odu_vfi_plots.jl\n+Author: Victoria Gregory\n+\n+Demonstrates the solution to the Offer Distribution Unknown Model\n+=#\n+\n+using QuantEcon\n+using Interpolations\n+using LaTeXStrings\n+using Plots\n+pyplot()\n+include(\"odu.jl\")\n+\n+# Set up the problem and initial guess, solve by VFI\n+sp = SearchProblem(;w_grid_size=100, pi_grid_size=100)\n+v_init = zeros(sp.n_w, sp.n_pi) + sp.c / (1 - sp.bet)\n+f(x) = bellman_operator(sp, x)\n+v = compute_fixed_point(f, v_init)\n+policy = get_greedy(sp, v)\n+\n+# Make functions for the linear interpolants of these\n+vf = extrapolate(interpolate((sp.w_grid, sp.pi_grid), v, Gridded(Linear())),\n+                 Flat())\n+pf = extrapolate(interpolate((sp.w_grid, sp.pi_grid), policy,\n+                 Gridded(Linear())), Flat())\n+\n+# Make finer grid for interpolation\n+pi_plot_grid_size, w_plot_grid_size = 500, 500\n+pi_plot_grid = linspace(0.001, 0.99, pi_plot_grid_size)\n+w_plot_grid = linspace(0, sp.w_max, w_plot_grid_size)\n+\n+plot_choice = \"policy_function\"\n+\n+# Make chosen plot\n+if plot_choice == \"value_function\"","path":"odu/odu_vfi_plots.jl","position":36,"original_position":36,"commit_id":"527750905c6061040028cd46af3832b1465fa409","original_commit_id":"527750905c6061040028cd46af3832b1465fa409","user":{"login":"spencerlyon2","id":1001948,"avatar_url":"https://avatars.githubusercontent.com/u/1001948?v=3","gravatar_id":"","url":"https://api.github.com/users/spencerlyon2","html_url":"https://github.com/spencerlyon2","followers_url":"https://api.github.com/users/spencerlyon2/followers","following_url":"https://api.github.com/users/spencerlyon2/following{/other_user}","gists_url":"https://api.github.com/users/spencerlyon2/gists{/gist_id}","starred_url":"https://api.github.com/users/spencerlyon2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spencerlyon2/subscriptions","organizations_url":"https://api.github.com/users/spencerlyon2/orgs","repos_url":"https://api.github.com/users/spencerlyon2/repos","events_url":"https://api.github.com/users/spencerlyon2/events{/privacy}","received_events_url":"https://api.github.com/users/spencerlyon2/received_events","type":"User","site_admin":false},"body":"I suggest making these functions instead of an if/else based on a global variable. That way users can do both without having to edit and rerun the script","created_at":"2016-08-10T18:42:33Z","updated_at":"2016-08-10T18:42:33Z","html_url":"https://github.com/QuantEcon/QuantEcon.applications/pull/64#discussion_r74305132","pull_request_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/pulls/64","_links":{"self":{"href":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/pulls/comments/74305132"},"html":{"href":"https://github.com/QuantEcon/QuantEcon.applications/pull/64#discussion_r74305132"},"pull_request":{"href":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/pulls/64"}}},"pull_request":{"url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/pulls/64","id":80844276,"html_url":"https://github.com/QuantEcon/QuantEcon.applications/pull/64","diff_url":"https://github.com/QuantEcon/QuantEcon.applications/pull/64.diff","patch_url":"https://github.com/QuantEcon/QuantEcon.applications/pull/64.patch","issue_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/issues/64","number":64,"state":"open","locked":false,"title":"Julia odu code with Interpolations.jl","user":{"login":"vgregory757","id":16957988,"avatar_url":"https://avatars.githubusercontent.com/u/16957988?v=3","gravatar_id":"","url":"https://api.github.com/users/vgregory757","html_url":"https://github.com/vgregory757","followers_url":"https://api.github.com/users/vgregory757/followers","following_url":"https://api.github.com/users/vgregory757/following{/other_user}","gists_url":"https://api.github.com/users/vgregory757/gists{/gist_id}","starred_url":"https://api.github.com/users/vgregory757/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgregory757/subscriptions","organizations_url":"https://api.github.com/users/vgregory757/orgs","repos_url":"https://api.github.com/users/vgregory757/repos","events_url":"https://api.github.com/users/vgregory757/events{/privacy}","received_events_url":"https://api.github.com/users/vgregory757/received_events","type":"User","site_admin":false},"body":"The odu code was broken because of some incompatibility issue of Grids.jl with the current version of Julia. I re-did it with Interpolations.jl and also added a Julia version of `odu_vfi_plots`. ","created_at":"2016-08-10T18:33:29Z","updated_at":"2016-08-10T18:42:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3473c43bccdb38eb87397564ace6f2c2487aea91","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/pulls/64/commits","review_comments_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/pulls/64/comments","review_comment_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/pulls/comments{/number}","comments_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/issues/64/comments","statuses_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/statuses/527750905c6061040028cd46af3832b1465fa409","head":{"label":"vgregory757:odu_fix","ref":"odu_fix","sha":"527750905c6061040028cd46af3832b1465fa409","user":{"login":"vgregory757","id":16957988,"avatar_url":"https://avatars.githubusercontent.com/u/16957988?v=3","gravatar_id":"","url":"https://api.github.com/users/vgregory757","html_url":"https://github.com/vgregory757","followers_url":"https://api.github.com/users/vgregory757/followers","following_url":"https://api.github.com/users/vgregory757/following{/other_user}","gists_url":"https://api.github.com/users/vgregory757/gists{/gist_id}","starred_url":"https://api.github.com/users/vgregory757/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgregory757/subscriptions","organizations_url":"https://api.github.com/users/vgregory757/orgs","repos_url":"https://api.github.com/users/vgregory757/repos","events_url":"https://api.github.com/users/vgregory757/events{/privacy}","received_events_url":"https://api.github.com/users/vgregory757/received_events","type":"User","site_admin":false},"repo":{"id":51265260,"name":"QuantEcon.applications","full_name":"vgregory757/QuantEcon.applications","owner":{"login":"vgregory757","id":16957988,"avatar_url":"https://avatars.githubusercontent.com/u/16957988?v=3","gravatar_id":"","url":"https://api.github.com/users/vgregory757","html_url":"https://github.com/vgregory757","followers_url":"https://api.github.com/users/vgregory757/followers","following_url":"https://api.github.com/users/vgregory757/following{/other_user}","gists_url":"https://api.github.com/users/vgregory757/gists{/gist_id}","starred_url":"https://api.github.com/users/vgregory757/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgregory757/subscriptions","organizations_url":"https://api.github.com/users/vgregory757/orgs","repos_url":"https://api.github.com/users/vgregory757/repos","events_url":"https://api.github.com/users/vgregory757/events{/privacy}","received_events_url":"https://api.github.com/users/vgregory757/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vgregory757/QuantEcon.applications","description":"A repository that houses example code, applications and teaching material related to QuantEcon","fork":true,"url":"https://api.github.com/repos/vgregory757/QuantEcon.applications","forks_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/forks","keys_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/teams","hooks_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/hooks","issue_events_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/issues/events{/number}","events_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/events","assignees_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/assignees{/user}","branches_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/branches{/branch}","tags_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/tags","blobs_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/git/refs{/sha}","trees_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/statuses/{sha}","languages_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/languages","stargazers_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/stargazers","contributors_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/contributors","subscribers_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/subscribers","subscription_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/subscription","commits_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/commits{/sha}","git_commits_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/git/commits{/sha}","comments_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/comments{/number}","issue_comment_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/issues/comments{/number}","contents_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/contents/{+path}","compare_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/merges","archive_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/downloads","issues_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/issues{/number}","pulls_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/pulls{/number}","milestones_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/milestones{/number}","notifications_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/labels{/name}","releases_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/releases{/id}","deployments_url":"https://api.github.com/repos/vgregory757/QuantEcon.applications/deployments","created_at":"2016-02-07T20:39:33Z","updated_at":"2016-05-01T22:41:44Z","pushed_at":"2016-08-10T18:26:52Z","git_url":"git://github.com/vgregory757/QuantEcon.applications.git","ssh_url":"git@github.com:vgregory757/QuantEcon.applications.git","clone_url":"https://github.com/vgregory757/QuantEcon.applications.git","svn_url":"https://github.com/vgregory757/QuantEcon.applications","homepage":null,"size":29661,"stargazers_count":2,"watchers_count":2,"language":"Jupyter Notebook","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"QuantEcon:master","ref":"master","sha":"0b1d24e4ed4a1002a61084446f300f9991aeb3ac","user":{"login":"QuantEcon","id":8703060,"avatar_url":"https://avatars.githubusercontent.com/u/8703060?v=3","gravatar_id":"","url":"https://api.github.com/users/QuantEcon","html_url":"https://github.com/QuantEcon","followers_url":"https://api.github.com/users/QuantEcon/followers","following_url":"https://api.github.com/users/QuantEcon/following{/other_user}","gists_url":"https://api.github.com/users/QuantEcon/gists{/gist_id}","starred_url":"https://api.github.com/users/QuantEcon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuantEcon/subscriptions","organizations_url":"https://api.github.com/users/QuantEcon/orgs","repos_url":"https://api.github.com/users/QuantEcon/repos","events_url":"https://api.github.com/users/QuantEcon/events{/privacy}","received_events_url":"https://api.github.com/users/QuantEcon/received_events","type":"Organization","site_admin":false},"repo":{"id":46374513,"name":"QuantEcon.applications","full_name":"QuantEcon/QuantEcon.applications","owner":{"login":"QuantEcon","id":8703060,"avatar_url":"https://avatars.githubusercontent.com/u/8703060?v=3","gravatar_id":"","url":"https://api.github.com/users/QuantEcon","html_url":"https://github.com/QuantEcon","followers_url":"https://api.github.com/users/QuantEcon/followers","following_url":"https://api.github.com/users/QuantEcon/following{/other_user}","gists_url":"https://api.github.com/users/QuantEcon/gists{/gist_id}","starred_url":"https://api.github.com/users/QuantEcon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuantEcon/subscriptions","organizations_url":"https://api.github.com/users/QuantEcon/orgs","repos_url":"https://api.github.com/users/QuantEcon/repos","events_url":"https://api.github.com/users/QuantEcon/events{/privacy}","received_events_url":"https://api.github.com/users/QuantEcon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/QuantEcon/QuantEcon.applications","description":"A repository that houses example code, applications and teaching material related to QuantEcon","fork":false,"url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications","forks_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/forks","keys_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/teams","hooks_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/hooks","issue_events_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/issues/events{/number}","events_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/events","assignees_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/assignees{/user}","branches_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/branches{/branch}","tags_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/tags","blobs_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/git/refs{/sha}","trees_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/statuses/{sha}","languages_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/languages","stargazers_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/stargazers","contributors_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/contributors","subscribers_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/subscribers","subscription_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/subscription","commits_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/commits{/sha}","git_commits_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/git/commits{/sha}","comments_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/comments{/number}","issue_comment_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/issues/comments{/number}","contents_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/contents/{+path}","compare_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/merges","archive_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/downloads","issues_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/issues{/number}","pulls_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/pulls{/number}","milestones_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/milestones{/number}","notifications_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/labels{/name}","releases_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/releases{/id}","deployments_url":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/deployments","created_at":"2015-11-17T20:48:04Z","updated_at":"2016-08-09T10:10:37Z","pushed_at":"2016-08-10T18:33:29Z","git_url":"git://github.com/QuantEcon/QuantEcon.applications.git","ssh_url":"git@github.com:QuantEcon/QuantEcon.applications.git","clone_url":"https://github.com/QuantEcon/QuantEcon.applications.git","svn_url":"https://github.com/QuantEcon/QuantEcon.applications","homepage":null,"size":28732,"stargazers_count":35,"watchers_count":35,"language":"Jupyter Notebook","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":207,"mirror_url":null,"open_issues_count":14,"forks":207,"open_issues":14,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/pulls/64"},"html":{"href":"https://github.com/QuantEcon/QuantEcon.applications/pull/64"},"issue":{"href":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/issues/64"},"comments":{"href":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/issues/64/comments"},"review_comments":{"href":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/pulls/64/comments"},"review_comment":{"href":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/pulls/64/commits"},"statuses":{"href":"https://api.github.com/repos/QuantEcon/QuantEcon.applications/statuses/527750905c6061040028cd46af3832b1465fa409"}}}}
{"actor":{"display_login":"spencerlyon2"}}