0

I'm using the pymc3 module for some curve fitting and while following the tutorial, I came across an unfamiliar term: Deterministic Transformations. I was just wondering what exactly these deterministic transformations do?

Link to the tutorial https://exoplanet.dfm.io/en/stable/tutorials/intro-to-pymc3/#intro-to-pymc3

I tried to look into the documentation but I didn't really understand it.

P = pm.Deterministic("P", tt.exp(logP))
sophros
  • 14,672
  • 11
  • 46
  • 75

1 Answers1

0

I actually found the answer

I dont know how I missed it; perhaps, I skimmed over it.

According to the documentation, Deterministic Transformations allow you to freely do algebra with RVs in all kinds of ways

with pm.Model():
    x = pm.Normal('x', mu=0, sigma=1)
    y = pm.Gamma('y', alpha=1, beta=1)
    plus_2 = x + 2
    summed = x + y
    squared = x**2
    sined = pm.math.sin(x)
  • 1
    Yes -- importantly, when you sample from this, `pymc3` will record all sampled values of `x` and `y`. If you wrap `plus_2` in `pm.Deterministic` (as in, `plus_2 = pm.Deterministic("plus_2", x + 2)`), then the trace will also record values for `plus_2`. – colcarroll Aug 22 '19 at 19:57
  • Thank you so much! – Rohan Nagavardhan Aug 23 '19 at 21:00