Replies: 2 comments 5 replies
-
I agree, that would be nice. For now, you could just not specify @pmx.as_model()
def logistic_model(x):
alpha = pm.Normal("alpha")
beta = pm.Normal("beta")
p = pm.Deterministic("p", pm.math.sigmoid(alpha + beta * x))
obs = pm.Bernoulli("obs", p=p) # I don't think you even need shape here
lm = logistic_model(x)
lm_obs = pm.observe(lm, {"obs": y})
idata = pm.sample(model=lm_obs) |
Beta Was this translation helpful? Give feedback.
0 replies
-
But will I need to add it while generating predictions?
…On Fri, 29 Mar 2024, 07:26 Thomas Wiecki, ***@***.***> wrote:
I agree, that would be nice.
For now, you could just not specify observerd and only add it with
pm.observed() at inference time and otherwise have the first model just
be the generative one.
—
Reply to this email directly, view it on GitHub
<#7225 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACCUP5CBJERTBFNBGKI7DY2UCSNAVCNFSM6AAAAABFLKHJ3KVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DSNBYGQ4TM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As part of using
pm.as_model
, I often end up writing code that looks a like this like:This is fairly clean. I don't have to put a dummy value for
y
when doing oos. But, I have to pass bothp
andobs
tovar_names
. Setting aside the need to passp
to force resampling of the Deterministic. I don't know why we need to specifyobs
. While it's not inlm_oos
it is inidata
and it would be nice to resample it!What do others thinks?
Beta Was this translation helpful? Give feedback.
All reactions