Skip to content
Discussion options

You must be logged in to vote

Hey! Thanks for using RxInfer, an interesting model you have, I checked the original comment from you before editing, to me it seems like you wanted to do smth, like

@model function mixture_regression(x, y)

    s ~ Beta(1.0, 1.0)

    a[1] ~ Normal(mean = 0.0, variance = 1e3)
    w[1] ~ Gamma(shape = 0.01, rate = 0.01)

    a[2] ~ Normal(mean = 2.0, variance = 1e3)
    w[2] ~ Gamma(shape = 0.01, rate = 0.01)

    b ~ Normal(mean=0.0, variance=100.0)

    local m

    for i in eachindex(x)
        z[i] ~ Bernoulli(s)

        # Hand-written equivalent of 
        # the map operation, with `m` defined above
        for k in 1:length(a)
            m[i, k] := a[k] * x[i] + b
        end

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@max-de-rooij
Comment options

@bvdmitri
Comment options

Answer selected by max-de-rooij
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants