Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/cran/bayestestR
22 February 2025, 11:05:59 UTC
  • Code
  • Branches (30)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/0.1.0
    • refs/tags/0.10.0
    • refs/tags/0.10.5
    • refs/tags/0.11.0
    • refs/tags/0.11.5
    • refs/tags/0.12.1
    • refs/tags/0.13.0
    • refs/tags/0.13.1
    • refs/tags/0.13.2
    • refs/tags/0.14.0
    • refs/tags/0.15.0
    • refs/tags/0.15.1
    • refs/tags/0.15.2
    • refs/tags/0.2.0
    • refs/tags/0.2.2
    • refs/tags/0.2.5
    • refs/tags/0.3.0
    • refs/tags/0.4.0
    • refs/tags/0.5.0
    • refs/tags/0.5.1
    • refs/tags/0.5.2
    • refs/tags/0.5.3
    • refs/tags/0.6.0
    • refs/tags/0.7.0
    • refs/tags/0.7.2
    • refs/tags/0.7.5
    • refs/tags/0.8.0
    • refs/tags/0.8.2
    • refs/tags/0.9.0
    No releases to show
  • 7f03a19
  • /
  • man
  • /
  • hdi.Rd
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:05466c26077fe388f8b7b7f87f93c5a35bea3a85
origin badgedirectory badge Iframe embedding
swh:1:dir:b95f610cb305b7d727fd4508487272f92c1cef88
origin badgerevision badge
swh:1:rev:fe07bfa906d7e155439160caee538a3449cd3877
origin badgesnapshot badge
swh:1:snp:f21ef7ccd15683bc087b4dc9c75c918ccb5245a2
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: fe07bfa906d7e155439160caee538a3449cd3877 authored by Dominique Makowski on 08 April 2019, 08:42:41 UTC
version 0.1.0
Tip revision: fe07bfa
hdi.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hdi.R
\name{hdi}
\alias{hdi}
\alias{hdi.numeric}
\alias{hdi.stanreg}
\alias{hdi.brmsfit}
\title{Highest Density Interval (HDI)}
\usage{
hdi(x, ...)

\method{hdi}{numeric}(x, ci = 0.9, verbose = TRUE, ...)

\method{hdi}{stanreg}(x, ci = 0.9, effects = c("fixed", "random",
  "all"), parameters = NULL, verbose = TRUE, ...)

\method{hdi}{brmsfit}(x, ci = 0.9, effects = c("fixed", "random",
  "all"), component = c("conditional", "zi", "zero_inflated", "all"),
  parameters = NULL, verbose = TRUE, ...)
}
\arguments{
\item{x}{Vector representing a posterior distribution. Can also be a
\code{stanreg} or \code{brmsfit} model.}

\item{...}{Currently not used.}

\item{ci}{Value or vector of probability of the interval (between 0 and 1)
to be estimated. Named Credible Interval (CI) for consistency.}

\item{verbose}{Toggle off warnings.}

\item{effects}{Should results for fixed effects, random effects or both be returned?
Only applies to mixed models. May be abbreviated.}

\item{parameters}{Regular expression pattern that describes the parameters that
should be returned. Meta-parameters (like \code{lp__} or \code{prior_}) are
filtered by default, so only parameters that typically appear in the
\code{summary()} are returned. Use \code{parameters} to select specific parameters
for the output.}

\item{component}{Should results for all parameters, parameters for the conditional model
or the zero-inflated part of the model be returned? May be abbreviated. Only
applies to \pkg{brms}-models.}
}
\value{
A data frame with following columns:
  \itemize{
    \item \code{Parameter} The model parameter(s), if \code{x} is a model-object. If \code{x} is a vector, this column is missing.
    \item \code{CI} The probability of the HDI.
    \item \code{CI_low} , \code{CI_high} The lower and upper HDI limits for the parameters.
  }
}
\description{
Compute the \strong{Highest Density Interval (HDI)} of a posterior distribution, i.e., all points within the interval have a higher probability density than points outside the interval. The HDI can be used in the context of Bayesian posterior characterisation as \strong{Credible Interval (CI)}.
}
\details{
Unlike equal-tailed intervals (see \link{ci}) that typically exclude 2.5\% from each tail
  of the distribution, the HDI is \emph{not} equal-tailed and therefore always
  includes the mode(s) of posterior distributions.
  \cr \cr
  By default, \code{hdi()} returns the 90\% intervals (\code{ci = 0.9}),
  deemed to be more stable than, for instance, 95\% intervals (\cite{Kruschke, 2015}).
  An effective sample size of at least 10.000 is recommended if 95\% intervals
  should be computed (\cite{Kruschke, 2015, p. 183ff}).
}
\examples{
library(bayestestR)

posterior <- rnorm(1000)
hdi(posterior, ci = .90)
hdi(posterior, ci = c(.80, .90, .95))
\dontrun{
library(rstanarm)
model <- rstanarm::stan_glm(mpg ~ wt + cyl, data = mtcars)
hdi(model)
hdi(model, ci = c(.80, .90, .95))

library(brms)
model <- brms::brm(mpg ~ wt + cyl, data = mtcars)
hdi(model)
hdi(model, ci = c(.80, .90, .95))
}

}
\references{
Kruschke, J. (2015). Doing Bayesian data analysis: A tutorial with R, JAGS, and Stan. Academic Press.
}
\author{
Credits go to \href{https://rdrr.io/cran/ggdistribute/src/R/stats.R}{ggdistribute} and \href{https://github.com/mikemeredith/HDInterval}{HDInterval}.
}

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top