{"id":46573868,"url":"https://github.com/liesel-devs/rliesel","last_synced_at":"2026-03-07T09:20:32.756Z","repository":{"id":64620663,"uuid":"496612771","full_name":"liesel-devs/rliesel","owner":"liesel-devs","description":"An R interface for the Liesel probabilistic programming framework","archived":false,"fork":false,"pushed_at":"2025-04-29T13:48:12.000Z","size":2015,"stargazers_count":6,"open_issues_count":10,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-29T14:49:32.246Z","etag":null,"topics":["machine-learning","r","statistics"],"latest_commit_sha":null,"homepage":"https://liesel-devs.github.io/rliesel/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liesel-devs.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-26T12:31:43.000Z","updated_at":"2025-04-29T13:45:05.000Z","dependencies_parsed_at":"2025-04-29T14:50:26.099Z","dependency_job_id":null,"html_url":"https://github.com/liesel-devs/rliesel","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/liesel-devs/rliesel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liesel-devs%2Frliesel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liesel-devs%2Frliesel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liesel-devs%2Frliesel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liesel-devs%2Frliesel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liesel-devs","download_url":"https://codeload.github.com/liesel-devs/rliesel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liesel-devs%2Frliesel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30210715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T09:02:10.694Z","status":"ssl_error","status_checked_at":"2026-03-07T09:02:08.429Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine-learning","r","statistics"],"created_at":"2026-03-07T09:20:32.336Z","updated_at":"2026-03-07T09:20:32.741Z","avatar_url":"https://github.com/liesel-devs.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\",\n  message = FALSE\n)\n```\n\n# RLiesel\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\nThe goal of RLiesel is to provide an R interface for the probabilistic programming framework [Liesel](https://github.com/liesel-devs/liesel).\n\nRLiesel assists the user in expressing semi-parametric regression models as probabilistic graphical models (PGMs). It supports generalized additive models for location, scale and shape (GAMLSS) with different response distributions, spline-based smooth terms and shrinkage priors. In a second step, the models can be transferred to Python for the further analysis.\n\n## Installation\n\nYou can install the development version of RLiesel by running the following commands:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"liesel-devs/rliesel\")\n```\n\n## Usage\n\n```{r}\nlibrary(rliesel)\n```\n\nThe `liesel()` function is the workhorse of RLiesel and can be used to set up semi-parametric regression models. We illustrate the flexibility of the function by means of two examples.\n\n### A linear model\n\nIn the first example, we assume a linear relationship between the mean and the log-standard deviation of a response variable `y` and an explanatory variable `x`.\n\n```{r}\n# generate some data\nset.seed(1337)\n\nn \u003c- 250\nx \u003c- runif(n)\ny \u003c- rnorm(n, mean = x, sd = exp(x))\n```\n\nThe regression predictors of the distributional parameters are specified with the `predictor()` function. The predictors are then passed to the `predictors` argument of the `liesel()` function as a named list. Finally, the conditional distribution of the response variable needs to be defined via the `distribution` argument:\n\n```{r}\nlinear_mod \u003c- liesel(\n  response = y,\n  distribution = \"Normal\",\n  predictors = list(\n    loc = predictor(~x, inverse_link = \"Identity\"),\n    scale = predictor(~x, inverse_link = \"Exp\")\n  )\n)\n```\n\nThe hierarchical structure of a Liesel model can be visualized with the generic `plot()` function:\n\n```{r, eval = FALSE}\nplot(linear_mod)\n```\n\n```{python linear-mod, echo = FALSE}\nimport liesel.model as lsl\nlsl.plot_vars(r.linear_mod)\n```\n\nThe attributes of the Python model object such as the nodes or the log-probability can be accessed in R with the `$` operator, e.g. `linear_mod$nodes$loc_p1_beta$value` or `linear_mod$log_prob`.\n\n### A generalized additive model (GAM)\n\nIn the second example, both the location and the scale parameter are connected to the explanatory variable `x` through a smoothing spline:\n\n```{r, eval = -5}\ny \u003c- rnorm(n, mean = sin(2 * pi * x), sd = exp(sin(2 * pi * x)))\n\nspline_mod \u003c- liesel(\n  response = y,\n  distribution = \"Normal\",\n  predictors = list(\n    loc = predictor(~s(x), inverse_link = \"Identity\"),\n    scale = predictor(~s(x), inverse_link = \"Exp\")\n  )\n)\n\nplot(spline_mod)\n```\n\n```{python spline-mod, echo = FALSE}\nlsl.plot_vars(r.spline_mod)\n```\n\nUsers who are familiar with the `mgcv` package may recognize the syntax from the `gam()` function, which can be used to set up an equivalent model as follows:\n\n```{r, eval = FALSE}\nlibrary(mgcv)\ngam(list(y ~ s(x), ~s(x)), family = gaulss())\n```\n\nFinally, the Liesel model can be saved to a pickle file with the `save_model()` command:\n\n```{r, eval = FALSE}\nsave_model(spline_mod, \"spline-mod.pickle\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliesel-devs%2Frliesel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliesel-devs%2Frliesel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliesel-devs%2Frliesel/lists"}