Code Monkey home page Code Monkey logo

Comments (1)

cscherrer avatar cscherrer commented on May 18, 2024
julia> linReg1D
@model (x, y) begin
        α ~ Cauchy(0, 10)
        β ~ Cauchy(0, 2.5)
        σ ~ HalfCauchy(3)
        ŷ = α .+ β .* x
        N = length(x)
        y ~ For(1:N) do n
                Normal(ŷ[n], σ)
            end
    end

julia> nuts(linReg1D; x=randn(10),y=randn(10))
MCMC, adapting ϵ (75 steps)
0.0012 s/step ...done
MCMC, adapting ϵ (25 steps)
6.2e-5 s/step ...done
MCMC, adapting ϵ (50 steps)
0.0026 s/step ...done
MCMC, adapting ϵ (100 steps)
0.00021 s/step ...done
MCMC, adapting ϵ (200 steps)
4.5e-5 s/step ...done
MCMC, adapting ϵ (400 steps)
7.9e-5 s/step ...done
MCMC, adapting ϵ (50 steps)
4.3e-5 s/step ...done
MCMC (1000 steps)
6.8e-5 s/step ...done
NUTS_result with samples:
NamedTuple{(, , ),Tuple{Float64,Float64,Float64}}[(α = 0.134199, β = 0.039896, σ = 1.25893), (α = 0.216197, β = -0.228738, σ = 0.839331), (α = 0.345356, β = -0.285191, σ = 0.89817), (α = 0.520704, β = 0.170101, σ = 1.26003), (α = 0.0737416, β = -0.208811, σ = 1.04277), (α = -0.484939, β = 0.103993, σ = 1.57054), (α = 0.196448, β = -0.438468, σ = 1.22845), (α = -0.0937784, β = -0.46028, σ = 1.70606), (α = 0.576773, β = -0.0414117, σ = 0.779702), (α = -0.281724, β = -0.31755, σ = 1.51629)  = 0.96813, β = -0.736026, σ = 0.906863), (α = 0.823625, β = -0.251088, σ = 1.45545), (α = 1.30175, β = -0.407163, σ = 1.43959), (α = -0.153905, β = 0.340668, σ = 1.04707), (α = 0.227668, β = 0.278747, σ = 0.961204), (α = 0.0630767, β = -0.583266, σ = 1.18634), (α = 0.260204, β = 0.281929, σ = 1.28619), (α = 0.460613, β = -0.723942, σ = 1.15268), (α = 0.536627, β = -0.735313, σ = 1.19799), (α = 0.14234, β = -0.524957, σ = 1.39457)]

from soss.jl.

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.