{"action":"created","issue":{"url":"https://api.github.com/repos/econtoolkit/Expectations.jl/issues/13","repository_url":"https://api.github.com/repos/econtoolkit/Expectations.jl","labels_url":"https://api.github.com/repos/econtoolkit/Expectations.jl/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/econtoolkit/Expectations.jl/issues/13/comments","events_url":"https://api.github.com/repos/econtoolkit/Expectations.jl/issues/13/events","html_url":"https://github.com/econtoolkit/Expectations.jl/issues/13","id":341635175,"node_id":"MDU6SXNzdWUzNDE2MzUxNzU=","number":13,"title":"Ensure coverage of QuantEcon lecture notes expecations","user":{"login":"jlperla","id":13106721,"node_id":"MDQ6VXNlcjEzMTA2NzIx","avatar_url":"https://avatars2.githubusercontent.com/u/13106721?v=4","gravatar_id":"","url":"https://api.github.com/users/jlperla","html_url":"https://github.com/jlperla","followers_url":"https://api.github.com/users/jlperla/followers","following_url":"https://api.github.com/users/jlperla/following{/other_user}","gists_url":"https://api.github.com/users/jlperla/gists{/gist_id}","starred_url":"https://api.github.com/users/jlperla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlperla/subscriptions","organizations_url":"https://api.github.com/users/jlperla/orgs","repos_url":"https://api.github.com/users/jlperla/repos","events_url":"https://api.github.com/users/jlperla/events{/privacy}","received_events_url":"https://api.github.com/users/jlperla/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"ArnavSood","id":5009477,"node_id":"MDQ6VXNlcjUwMDk0Nzc=","avatar_url":"https://avatars1.githubusercontent.com/u/5009477?v=4","gravatar_id":"","url":"https://api.github.com/users/ArnavSood","html_url":"https://github.com/ArnavSood","followers_url":"https://api.github.com/users/ArnavSood/followers","following_url":"https://api.github.com/users/ArnavSood/following{/other_user}","gists_url":"https://api.github.com/users/ArnavSood/gists{/gist_id}","starred_url":"https://api.github.com/users/ArnavSood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArnavSood/subscriptions","organizations_url":"https://api.github.com/users/ArnavSood/orgs","repos_url":"https://api.github.com/users/ArnavSood/repos","events_url":"https://api.github.com/users/ArnavSood/events{/privacy}","received_events_url":"https://api.github.com/users/ArnavSood/received_events","type":"User","site_admin":false},"assignees":[{"login":"ArnavSood","id":5009477,"node_id":"MDQ6VXNlcjUwMDk0Nzc=","avatar_url":"https://avatars1.githubusercontent.com/u/5009477?v=4","gravatar_id":"","url":"https://api.github.com/users/ArnavSood","html_url":"https://github.com/ArnavSood","followers_url":"https://api.github.com/users/ArnavSood/followers","following_url":"https://api.github.com/users/ArnavSood/following{/other_user}","gists_url":"https://api.github.com/users/ArnavSood/gists{/gist_id}","starred_url":"https://api.github.com/users/ArnavSood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArnavSood/subscriptions","organizations_url":"https://api.github.com/users/ArnavSood/orgs","repos_url":"https://api.github.com/users/ArnavSood/repos","events_url":"https://api.github.com/users/ArnavSood/events{/privacy}","received_events_url":"https://api.github.com/users/ArnavSood/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2018-07-16T18:50:58Z","updated_at":"2018-07-18T04:16:48Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"@Nosferican I tried to go through all of the expectations used in the QuantEcon lectures, so here is a list of the things that @ArnavSood could target to make sure the library can handle lecture note rewrites.\r\n\r\nA few clear priorities:\r\n- [x] Arbitrary univariate discrete distributions  (relatively easy, with argumenterror if unbounded)\r\n- [x] univariate normal distribution with gaussian quadrature (I think that you can start with the QuantEcon quadrature nodes/etc.)\r\n- [x] univariate lognormal distribution with gaussian quadrature\r\n- [x] univariate quadrature on an arbitrary function with bounded support (i.e. gauss-legendre in general).   see #11\r\n- [x] univariate quadrature for a beta distribution (i.e. a specialization instead of relying on #11).  See http://quantecon.github.io/QuantEcon.jl/latest/api/QuantEcon.html#QuantEcon.qnwbeta-Tuple{Int64,Real,Real} provides weights and nodes for the beta distribution?\r\n- [ ] conditional distributions from a markov-chain, i.e. see #12, although not worth it quite yet.\r\n\r\nI looked in the lectures for key places that QuantEcon expectations come up, to make sure these can be fulfilled:\r\n- https://lectures.quantecon.org/jl/mccall_model.html#implementation and https://lectures.quantecon.org/jl/lake_model.html  -> Needs to support general discrete distributions with `E * v` in the `IterableExpectation` type.\r\n- https://lectures.quantecon.org/jl/optgrowth.html -> currently does monte-carlo, but I think it should be changed to use `LogNormal` or `Normal` distributions.  Maybe both to test that it is correct.\r\n- https://lectures.quantecon.org/jl/coleman_policy_iter.html and https://lectures.quantecon.org/jl/egm_policy_iter.html also does monte-carlo integration, but I think that we should ask John if it can use the expectation operator instead\r\n- https://lectures.quantecon.org/jl/ifp.html uses a discrete-time markov chain\r\n  - Taking slices of rows is probably good enough for now, but later could add in features such as #12\r\n- https://lectures.quantecon.org/jl/lucas_model.html does monte-carlo for a lognormal distribution.\r\n- https://lectures.quantecon.org/jl/aiyagari.html uses the `DiscreteDP` which has built in expectations.\r\n- https://lectures.quantecon.org/jl/arellano.html uses a markov-chain\r\n- https://lectures.quantecon.org/jl/odu.html  -> This is the trickiest as it requires taking an expectation over 2 dimensions.  But I believe it nests them, so a multivariate integral isn't used\r\n  - The current code uses gauss-legendre quadrature such as in #11 for an arbitrary distribution. But I think there may be better Beta specific ones.\r\n"},"comment":{"url":"https://api.github.com/repos/econtoolkit/Expectations.jl/issues/comments/405803731","html_url":"https://github.com/econtoolkit/Expectations.jl/issues/13#issuecomment-405803731","issue_url":"https://api.github.com/repos/econtoolkit/Expectations.jl/issues/13","id":405803731,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTgwMzczMQ==","user":{"login":"jlperla","id":13106721,"node_id":"MDQ6VXNlcjEzMTA2NzIx","avatar_url":"https://avatars2.githubusercontent.com/u/13106721?v=4","gravatar_id":"","url":"https://api.github.com/users/jlperla","html_url":"https://github.com/jlperla","followers_url":"https://api.github.com/users/jlperla/followers","following_url":"https://api.github.com/users/jlperla/following{/other_user}","gists_url":"https://api.github.com/users/jlperla/gists{/gist_id}","starred_url":"https://api.github.com/users/jlperla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlperla/subscriptions","organizations_url":"https://api.github.com/users/jlperla/orgs","repos_url":"https://api.github.com/users/jlperla/repos","events_url":"https://api.github.com/users/jlperla/events{/privacy}","received_events_url":"https://api.github.com/users/jlperla/received_events","type":"User","site_admin":false},"created_at":"2018-07-18T04:16:48Z","updated_at":"2018-07-18T04:16:48Z","author_association":"CONTRIBUTOR","body":"> , but I have had great success with the qnwdist function in quantecon \r\n\r\nGreat, lets make sure to merge it!  Sorry, I didn't notice that this was a non-gaussian quadrature method.  The type design allows us to add in multi-dispatch for different quadrature algorithms.  I think the code could largely be merged in for something like that with little trouble.  I added #16 so we don't forget about it.\r\n\r\n> he first is ordinary trapezoidal integration, for situations where we pick specific nodes. \r\n\r\nJust to be clear for everyone, integrating with the trapezoidal (or simpsons rule) is never ideal you have control over exactly where the nodes are.  But if you have to stick with a particular set of nodes (e.g. discretizing a function in finite differences) then you have no other choice.\r\n"}}
{"actor":{"display_login":"jlperla"}}