with

pm

.

Model

()

as

model

:

# specify glm and pass in data. The resulting linear model, its likelihood and

# and all its parameters are automatically added to our model.

pm

.

glm

.

glm

(

'y ~ x'

,

data

)

step

=

pm

.

NUTS

()

# Instantiate MCMC sampling algorithm

trace

=

pm

.

sample

(

2000

,

step

,

progressbar

=

False

)

# draw 2000 posterior samples using NUTS sampling