Giter Club home page Giter Club logo

Comments (3)

junpenglao avatar junpenglao commented on August 18, 2024

For the group level prediction, we are using hyper prior - the reason is that, hyper-prior could be considered as the average effect for each specific group/category here. So when you want group level prediction, you can use these hyper-prior directly. You could see in Code block 4.18 where we use a HalfNormal (like what you did in the code) for a new hypothetical group.

from bookcode_edition1.

JeanLuc001 avatar JeanLuc001 commented on August 18, 2024

Thanks for the fast response.

What would you do if the hyperprior and the prior had different distributions, not both half-normal like in the book example? Or does this not matter?

from bookcode_edition1.

junpenglao avatar junpenglao commented on August 18, 2024

It does not matter as long as you are considering the hyper parameter as the group average, and each group is a small variation on top of the group average. For example, say we are assigning a fix prior sigma_group = yield tfd.Sample(tfd.Normal(10, .01), num_groups), then I usually interpreted the group average being 10, and if I want to generate sample to indicate group average effect i will just use 10 as the standard deviation.
But there is a subtly here: what about other parameterization like

sigma_group = yield tfd.Sample(tfd.HalfNormal(1), num_groups)

or

sigma_group = yield tfd.Sample(tfd.Gamma(a, b), num_groups)

Here, we should be a bit more careful to instead find the expected value of the distribution tfd.HalfNormal(1) and tfd.Gamma(a, b) (a and b is hyper parameters). We didnt do that in the book because the posterior is mostly Gaussian like, but I think this is something we will add a bit more clarity in the 2nd Edition.

from bookcode_edition1.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.