potential vs. stochastic, data, and observed?

80 views
Skip to first unread message

Nor

unread,
Dec 4, 2009, 11:17:15 AM12/4/09
to PyMC
Hi,

I am not sure that I quite understand what decorator to use for a
function that computes a logP based on a simple linear fit between
some observations (which are set for the whole run and do not vary)
and a model with depends in a deterministic way on some input
variables.
It seems that things more or less work wether I use the @data and
@stochastic decorator or just the @potential decorator.
It seems that using @potential is quite a bit faster, which might or
might not be a red herring.
Should one use the @data and or @observed decorators in this case?

What should one really be using in this case?

The function is:

def D
(value=params,z=z,ltime=ltime,ltburst=ltburst,brst1m=brst1m,Av=Av):
...
...
return logP

where params is a structure containing a bunch of values to create
models as well as observed data to compare the model-derived values
against. All of this is done in the ... part of the snippet above. The
parameters which are being explored are z,ltime,ltburst, brst1m and
Av.

Thanks
N

David Huard

unread,
Dec 4, 2009, 2:07:30 PM12/4/09
to py...@googlegroups.com
Hi Nor,

As far as I understand correctly, @observed would be the right decorator for this use case.

What I sometimes do to improve clarity is define a @deterministic function which only takes input and  computes the model output (the `physical` model).  I then write an @observed stochastic describing the probability of the observed output given the simulated output (the `output error` model).

HTH,
 
David


--

You received this message because you are subscribed to the Google Groups "PyMC" group.
To post to this group, send email to py...@googlegroups.com.
To unsubscribe from this group, send email to pymc+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pymc?hl=en.



Reply all
Reply to author
Forward
0 new messages