Skip to contents

Core DSL

Define data, variables, and models using the gretaR array DSL.

as_data()
Wrap Observed Data as a gretaR Array
variable()
Create a Free Variable
distribution()
Get the Distribution of a gretaR Array
`distribution<-`()
Assign a Distribution (Likelihood) to Observed Data
`[`(<gretaR_array>)
Extract elements from a gretaR_array
model()
Create a gretaR Model
model_from_arrays()
Build a gretaR Model from Explicit Arrays (Programmatic Interface)
random_effect()
Partially-Centred Random-Effect Block
joint_density()
Get the Log Joint Density Function

Distributions

Probability distributions for priors and likelihoods.

normal()
Normal Distribution
half_normal()
Half-Normal Distribution
half_cauchy()
Half-Cauchy Distribution
student_t()
Student-t Distribution
uniform()
Uniform Distribution
bernoulli()
Bernoulli Distribution
binomial_dist()
Binomial Distribution
poisson_dist()
Poisson Distribution
gamma_dist()
Gamma Distribution
beta_dist()
Beta Distribution
exponential()
Exponential Distribution
multivariate_normal()
Multivariate Normal Distribution
dirichlet()
Dirichlet distribution
negative_binomial()
Negative Binomial distribution
lkj_correlation()
LKJ Correlation distribution
lognormal()
Log-Normal Distribution
cauchy()
Cauchy Distribution
wishart()
Wishart Distribution

Inference

MCMC samplers, variational inference, and optimisation.

mcmc() experimental
Draw MCMC Samples from a gretaR Model
hmc() experimental
Run HMC Sampling
nuts() experimental
Run NUTS Sampling
variational() experimental
Variational Inference (ADVI)
opt() experimental
Find the Maximum A Posteriori (MAP) Estimate
laplace() experimental
Laplace Approximation

Custom & Mixture

User-defined distributions and mixture models.

custom_distribution()
Custom Distribution
mixture()
Mixture Distribution

Formula Interface

High-level formula-based model specification.

gretaR_glm() experimental
Fit a Bayesian GLM Using Formula Syntax
parse_re_bars()
Parse random effects bar terms from an lme4-style formula
remove_re_bars()
Remove random effects bar terms from a formula
process_smooths()
Process Smooth Terms from an mgcv-Style Formula

Stan Backend

Stan code generation and inference.

compile_to_stan()
Generate Stan Code from a gretaR Model

Methods and operators

S3 methods and operators on gretaR objects.

`%*%`
Matrix multiplication with gretaR_array support
sum(<gretaR_array>)
Sum of a gretaR_array
mean(<gretaR_array>)
Mean of a gretaR_array
print(<gretaR_fit>)
Print a gretaR Fit Object
summary(<gretaR_fit>)
Summarise a gretaR Fit Object
coef(<gretaR_fit>)
Extract Coefficients from a gretaR Fit
plot(<gretaR_fit>)
Plot Diagnostics for a gretaR Fit

Utilities

Helper functions for data handling and environment management.

reset_gretaR_env()
Reset the gretaR Global Environment

Package

gretaR gretaR-package
gretaR: Bayesian Statistical Modelling with Torch