Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO: Add intercepts to the GLM examples #100

Open
DilumAluthge opened this issue Aug 30, 2020 · 8 comments
Open

TODO: Add intercepts to the GLM examples #100

DilumAluthge opened this issue Aug 30, 2020 · 8 comments
Labels
documentation and examples Improvements or additions to documentation enhancement New feature or request

Comments

@DilumAluthge
Copy link
Collaborator

No description provided.

@DilumAluthge
Copy link
Collaborator Author

@cscherrer How would we go about this? You mentioned that usually we use a different prior for the intercept?

@DilumAluthge DilumAluthge added documentation and examples Improvements or additions to documentation enhancement New feature or request labels Aug 30, 2020
@cscherrer
Copy link
Owner

Something like

m = @model X, s, t begin
    p = size(X, 2) # number of features
    α ~ InterceptPrior
    β ~ Normal(0, s) |> iid(p) # coefficients
    σ ~ HalfNormal(t) # dispersion
    η = α .+ X * β # linear predictor
    μ = η # `μ = g⁻¹(η) = η`
    y ~ For(eachindex(μ)) do j
        Normal(μ[j], σ) # `Yᵢ ~ Normal(mean=μᵢ, variance=σ²)`
    end
end;

@DilumAluthge
Copy link
Collaborator Author

Any recommendations for what priors we should use in the linear regression and the multinomial logistic regression?

@cscherrer
Copy link
Owner

Yeah, that's trickier. I've sometimes used a broader prior for the intercept, but for general-purpose use there's some danger the result might not be identifiable. Maybe Gelman has good suggestions for a default?

@DilumAluthge
Copy link
Collaborator Author

@DilumAluthge
Copy link
Collaborator Author

We can spend some time thinking about this. The models are actually pretty good already

@DilumAluthge
Copy link
Collaborator Author

What if we use Normals for all the priors, but just a bigger variance for the intercept?

So e.g. the intercept has prior Normal(0, 5), and the coefficients have Normal(0,1).

In this case, would the result be identifiable? Since we are using Normal for all of the priors?

@DilumAluthge
Copy link
Collaborator Author

I'll admit, I don't particularly understand what conditions need to be met for the result to be identifiable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation and examples Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants