Skip to content

Commit b72a963

Browse files
committed
use fix and fix some errors
1 parent 4a5eb0c commit b72a963

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/abstractprobprog.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,20 +131,19 @@ end
131131
params,
132132
) -> T
133133
134-
Draw a sample from the joint distribution specified by `model` conditioned on the values in
135-
`params`.
134+
Draw a sample from the predictive distribution specified by `model` with its parameters fixed to `params`.
136135
137136
The sample will be returned as format specified by `T`.
138137
"""
139-
function StatsBase.predict(rand::AbstractRNG, T::Type, model::AbstractProbabilisticProgram, params)
140-
return rand(rng, T, condition(model, params))
138+
function StatsBase.predict(rng::AbstractRNG, T::Type, model::AbstractProbabilisticProgram, params)
139+
return rand(rng, T, fix(model, params))
141140
end
142141
function StatsBase.predict(T::Type, model::AbstractProbabilisticProgram, params)
143142
return StatsBase.predict(Random.default_rng(), T, model, params)
144143
end
145144
function StatsBase.predict(model::AbstractProbabilisticProgram, params)
146145
return StatsBase.predict(NamedTuple, model, params)
147146
end
148-
function StatsBase.predict(rng::AbstractRNG, params)
147+
function StatsBase.predict(rng::AbstractRNG, T::Type, model::AbstractProbabilisticProgram, params)
149148
return StatsBase.predict(rng, NamedTuple, model, params)
150149
end

0 commit comments

Comments
 (0)