Package: gretaR 0.5.2

Max Moldovan

gretaR: Bayesian Statistical Modelling with Torch

A probabilistic programming package for Bayesian statistical modelling in R using native R syntax. Models are defined interactively with 'gretaR_array' objects, then compiled to 'torch' tensors for Hamiltonian Monte Carlo and No-U-Turn Sampler inference. Runs on a native 'torch' (libtorch) backend with no Python dependency required.

Authors:Max Moldovan [aut, cre, cph]

gretaR_0.5.2.tar.gz
gretaR_0.5.2.zip(r-4.7-any)gretaR_0.5.2.zip(r-4.6-any)gretaR_0.5.2.zip(r-4.5-any)
gretaR_0.5.2.tgz(r-4.6-any)gretaR_0.5.2.tgz(r-4.5-any)
gretaR_0.5.2.tar.gz(r-4.7-any)gretaR_0.5.2.tar.gz(r-4.6-any)
gretaR_0.5.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
gretaR/json (API)

# Install 'gretaR' in R:
install.packages('gretaR', repos = c('https://max578.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/max578/gretar/issues

Pkgdown/docs site:https://max578.github.io

On CRAN:

Conda:

4.18 score 41 exports 38 dependencies

Last updated from:c4a1515f52 (on main). Checks:7 ERROR, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develERROR241
source / vignettesOK230
linux-releaseERROR334
macos-releaseERROR253
macos-oldrelERROR177
windows-develERROR356
windows-releaseERROR348
windows-oldrelERROR343
wasm-releaseOK280

Exports:%*%as_databernoullibeta_distbinomial_distcauchycompile_to_stancustom_distributiondirichletdistributiondistribution<-exponentialgamma_distgretaR_glmhalf_cauchyhalf_normalhmcjoint_densitylaplacelkj_correlationlognormalmcmcmixturemodelmodel_from_arraysmultivariate_normalnegative_binomialnormalnutsoptparse_re_barspoisson_distprocess_smoothsrandom_effectremove_re_barsreset_gretaR_envstudent_tuniformvariablevariationalwishart

Dependencies:abindbackportsbitbit64callrcheckmateclicorodescdistributionalfarvergenericsgluejsonlitelabelinglifecyclemagrittrmatrixStatsnumDerivotelpillarpkgconfigposteriorprocessxpsR6RColorBrewerRcpprlangsafetensorsscalestensorAtibbletorchutf8vctrsviridisLitewithr

Getting Started with gretaR
Overview | Installation | Example 1: Estimating a Normal Mean | Example 2: Bayesian Linear Regression | Workflow Summary | Available Distributions | Choosing a Sampler | Next Steps

Last update: 2026-08-25
Started: 2026-04-10

GLMs with gretaR
Overview | Formula Interface | Gaussian Linear Regression | Logistic Regression | Poisson Regression | DSL Interface | Linear Regression (DSL) | Custom Priors | Inference Methods | Model Comparison with loo

Last update: 2026-08-25
Started: 2026-04-10

Hierarchical Models with gretaR
Overview | Random Intercepts Model | Random Intercepts and Slopes | Using MAP for Quick Estimates | Using Variational Inference | Partially-Centred Random Effects with random_effect() | Formula Interface for Simple Models | Tips for Hierarchical Models | References

Last update: 2026-08-25
Started: 2026-04-10

Readme and manuals

Help Manual

Help pageTopics
Extract elements from a gretaR_array[.gretaR_array
Matrix multiplication with gretaR_array support%*%
Wrap Observed Data as a gretaR Arrayas_data
Bernoulli Distributionbernoulli
Beta Distributionbeta_dist
Binomial Distributionbinomial_dist
Cauchy Distributioncauchy
Extract Coefficients from a gretaR Fitcoef.gretaR_fit
Generate Stan Code from a gretaR Modelcompile_to_stan
Custom Distributioncustom_distribution
Dirichlet distributiondirichlet
Get the Distribution of a gretaR Arraydistribution
Assign a Distribution (Likelihood) to Observed Datadistribution<-
Exponential Distributionexponential
Gamma Distributiongamma_dist
Fit a Bayesian GLM Using Formula SyntaxgretaR_glm
Half-Cauchy Distributionhalf_cauchy
Half-Normal Distributionhalf_normal
Run HMC Samplinghmc
Get the Log Joint Density Functionjoint_density
Laplace Approximationlaplace
LKJ Correlation distributionlkj_correlation
Log-Normal Distributionlognormal
Draw MCMC Samples from a gretaR Modelmcmc
Mean of a gretaR_arraymean.gretaR_array
Mixture Distributionmixture
Create a gretaR Modelmodel
Build a gretaR Model from Explicit Arrays (Programmatic Interface)model_from_arrays
Multivariate Normal Distributionmultivariate_normal
Negative Binomial distributionnegative_binomial
Normal Distributionnormal
Run NUTS Samplingnuts
Find the Maximum A Posteriori (MAP) Estimateopt
Parse random effects bar terms from an lme4-style formulaparse_re_bars
Plot Diagnostics for a gretaR Fitplot.gretaR_fit
Poisson Distributionpoisson_dist
Print a gretaR Fit Objectprint.gretaR_fit
Process Smooth Terms from an mgcv-Style Formulaprocess_smooths
Partially-Centred Random-Effect Blockrandom_effect
Remove random effects bar terms from a formularemove_re_bars
Reset the gretaR Global Environmentreset_gretaR_env
Student-t Distributionstudent_t
Sum of a gretaR_arraysum.gretaR_array
Summarise a gretaR Fit Objectsummary.gretaR_fit
Uniform Distributionuniform
Create a Free Variablevariable
Variational Inference (ADVI)variational
Wishart Distributionwishart