# NOT RUN {
# a uniform parameter constrained to be between 0 and 1
phi = uniform(min = 0, max = 1)
# a length-three variable, with each element following a standard normal
# distribution
alpha = normal(0, 1, dim = 3)
# a length-three variable of lognormals
sigma = lognormal(0, 3, dim = 3)
# a hierarchical uniform, constrained between alpha and alpha + sigma,
eta = alpha + uniform(0, 1, dim = 3) * sigma
# a hierarchical distribution
mu = normal(0, 1)
sigma = lognormal(0, 1)
theta = normal(mu, sigma)
# a vector of 3 variables drawn from the same hierarchical distribution
thetas = normal(mu, sigma, dim = 3)
# a matrix of 12 variables drawn from the same hierarchical distribution
thetas = normal(mu, sigma, dim = c(3, 4))
# a multivariate normal variable, with correlation between two elements
Sig <- diag(4)
Sig[3, 4] <- Sig[4, 3] <- 0.6
theta = multivariate_normal(rep(mu, 4), Sig)
# 10 independent replicates of that
theta = multivariate_normal(rep(mu, 4), Sig, dim = 10)
# a Wishart variable with the same covariance parameter
theta = wishart(df = 5, Sigma = Sig)
# }
Run the code above in your browser using DataLab