# define a model likelihood
# observed data and mean parameter to be estimated
# (explicitly coerce data to a greta array so we can refer to it later)
y = as_data(rnorm(5, 0, 3))
mu = free()
# define the distribution over y (the model likelihood)
distribution(y) = normal(mu, 1)
# get the distribution over y
distribution(y)
# define a truncated-positive standard normal random variable
tn = free(lower = 0)
distribution(tn) = normal(0, 1)
Run the code above in your browser using DataLab