theogf / ThermodynamicIntegration.jl

Thermodynamic Integration for Turing models and more
MIT License
13 stars 1 forks source link

Add warning that scalar models are not allowed #20

Closed theogf closed 2 years ago

theogf commented 2 years ago
# data
y = rand(Normal(0,1), 10)

prior = Normal(0, 1)
logprior(μ) = logpdf(prior, μ) 
loglikelihood(μ, data) = sum(logpdf.(Normal(μ, 1), data)) 

alg = ThermInt(n_samples=1000) 
logZ = alg(logprior, x -> loglikelihood(x, data), rand(prior)) 

Typically, this will not work cause mu is a scalar and not a vector