-
Notifications
You must be signed in to change notification settings - Fork 19
Description
I'm asking for a bit more clarity on the intended interface for AdvancedVI. For context, I'm a bit confused by the README, which includes the following example:
using LogDensityProblems
struct NormalLogNormal{MX,SX,MY,SY}
μ_x::MX
σ_x::SX
μ_y::MY
Σ_y::SY
end
function LogDensityProblems.logdensity(model::NormalLogNormal, θ)
(; μ_x, σ_x, μ_y, Σ_y) = model
return logpdf(LogNormal(μ_x, σ_x), θ[1]) + logpdf(MvNormal(μ_y, Σ_y), θ[2:end])
end
function LogDensityProblems.dimension(model::NormalLogNormal)
return length(model.μ_y) + 1
end
function LogDensityProblems.capabilities(::Type{<:NormalLogNormal})
return LogDensityProblems.LogDensityOrder{0}()
endThis all makes sense me: we define the intended probability model, and use the LogDensityProblems interface to provide helpful abstractions. I interpret the second parameter of the logdensity function to be where the "data" (in this case, [X, Y] ) would come in. I understand that X is a scalar and Y a vector.
However, later in the sample, I would expect that would simulate X and Y from the true generative model, and then attempt to infer the posterior of the parameters using AdvanedVI.optimize . However, that doesn't occur; the example instantiates the parameters, but does not simulate the 'data' from the true generative model.
Where in this example is the "data" actually fed in?