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

Better data types #120

Open
ayushpatnaikgit opened this issue Jun 13, 2023 · 4 comments · May be fixed by #122
Open

Better data types #120

ayushpatnaikgit opened this issue Jun 13, 2023 · 4 comments · May be fixed by #122
Assignees

Comments

@ayushpatnaikgit
Copy link
Member

Instead of Prior_Cauchy Prior_Gauss, etc

We should have

julia> abstract type Prior end

julia> struct Cauchy <: Prior end

julia> struct Gauss <: Prior end

Later on, you can have a function(::Prior), and you won't have to define it for every kind of Prior like function(::Prior_Cauchy), function(::Prior_Gauss), etc.

@ayushpatnaikgit
Copy link
Member Author

Similarly, with Link functions also. We should have a parent and child system.

@ShouvikGhosh2048
Copy link
Collaborator

ShouvikGhosh2048 commented Jun 15, 2023

The Distributions library has a Laplace function which we use - renaming Prior_Laplace to Laplace will causeCRRao's Laplace to take preference within our library. We can use Distributions.Laplace to specify which one to use within CRRao, but users using both Distributions and CRRao will have to specify which Laplace to use. (Also TDist)

@ShouvikGhosh2048
Copy link
Collaborator

Similarly, with Link functions also. We should have a parent and child system.

We have a parent and child system for Link.

@sourish-cmi
Copy link
Collaborator

The Distributions library has a Laplace function which we use - renaming Prior_Laplace to Laplace will causeCRRao's Laplace to take preference within our library. We can use Distributions.Laplace to specify which one to use within CRRao, but users using both Distributions and CRRao will have to specify which Laplace to use. (Also TDist)

We are using Laplace in Turing. I think Turing is using Distributions only

@model LinearRegression(X, y) = begin
        p = size(X, 2)

        #priors
        a0 = 0.1
        b0 = 0.1
        v ~ InverseGamma(h, h)
        σ ~ InverseGamma(a0, b0)
        #α ~ Laplace(0, σ * v)
        β ~ filldist(Laplace(0, σ * v), p)

        #likelihood
        #y ~ MvNormal(α .+ X * β, σ)
        y ~ MvNormal(X * β, σ)
    end

@ShouvikGhosh2048 ShouvikGhosh2048 linked a pull request Jun 16, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants