@@ -294,7 +294,7 @@ julia> ℓ = pointwise_logdensities(m, VarInfo(m)); first.((ℓ[@varname(x[1])],
294294
295295"""
296296function pointwise_logdensities (
297- model:: Model , chain, context:: AbstractContext = DefaultContext ()
297+ model:: Model , chain, context:: AbstractContext = DefaultContext (), keytype :: Type{T} = String
298298) where {T}
299299 # Get the data by executing the model once
300300 vi = VarInfo (model)
@@ -339,23 +339,26 @@ including the likelihood terms.
339339See also: [`pointwise_logdensities`](@ref).
340340"""
341341function pointwise_loglikelihoods (
342- model:: Model , chain, context:: AbstractContext = LikelihoodContext ()
342+ model:: Model ,
343+ chain,
344+ context:: AbstractContext = LikelihoodContext (),
345+ keytype:: Type{T} = String,
343346) where {T}
344347 if ! (leafcontext (context) isa LikelihoodContext)
345348 throw (ArgumentError (" Leaf context should be a LikelihoodContext" ))
346349 end
347350
348- return pointwise_logdensities (model, chain, context)
351+ return pointwise_logdensities (model, chain, context, keytype )
349352end
350353
351354function pointwise_loglikelihoods (
352355 model:: Model , varinfo:: AbstractVarInfo , context:: AbstractContext = LikelihoodContext ()
353- ) where {T}
356+ )
354357 if ! (leafcontext (context) isa LikelihoodContext)
355358 throw (ArgumentError (" Leaf context should be a LikelihoodContext" ))
356359 end
357360
358- return pointwise_logdensities (model, chain , context)
361+ return pointwise_logdensities (model, varinfo , context)
359362end
360363
361364"""
@@ -369,21 +372,21 @@ including the prior terms.
369372See also: [`pointwise_logdensities`](@ref).
370373"""
371374function pointwise_prior_logdensities (
372- model:: Model , chain, context:: AbstractContext = PriorContext ()
375+ model:: Model , chain, context:: AbstractContext = PriorContext (), keytype :: Type{T} = String
373376) where {T}
374377 if ! (leafcontext (context) isa PriorContext)
375378 throw (ArgumentError (" Leaf context should be a PriorContext" ))
376379 end
377380
378- return pointwise_logdensities (model, chain, context)
381+ return pointwise_logdensities (model, chain, context, keytype )
379382end
380383
381384function pointwise_prior_logdensities (
382385 model:: Model , varinfo:: AbstractVarInfo , context:: AbstractContext = PriorContext ()
383- ) where {T}
386+ )
384387 if ! (leafcontext (context) isa PriorContext)
385388 throw (ArgumentError (" Leaf context should be a PriorContext" ))
386389 end
387390
388- return pointwise_logdensities (model, chain , context)
391+ return pointwise_logdensities (model, varinfo , context)
389392end
0 commit comments