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

swh:1:snp:218ce733af7de6247148caa3cf8c71ef1c66e614
  • Code
  • Branches (8)
  • Releases (0)
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/0.9
    • refs/tags/0.9.1
    • refs/tags/1.0.0
    • refs/tags/1.1.0
    • refs/tags/1.1.1
    • refs/tags/1.1.2
    • refs/tags/1.2.2
    No releases to show
  • b713208
  • /
  • man
  • /
  • ess.Rd
Raw File Download

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
content badge Iframe embedding
swh:1:cnt:db4075eb54398d5272bfc74372634a93a4336fc4
directory badge Iframe embedding
swh:1:dir:33d0e019667189eb9f0f9cf186d39144290a288c
revision badge
swh:1:rev:9829a5182483d64b64779c302eea58781cc356b0
snapshot badge
swh:1:snp:218ce733af7de6247148caa3cf8c71ef1c66e614

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: 9829a5182483d64b64779c302eea58781cc356b0 authored by Asad Hasan on 25 August 2014, 00:00:00 UTC
version 0.9
Tip revision: 9829a51
ess.Rd
\name{ess}
\alias{ess}

\title{Effective Sample Size Calculator}

\description{
Computes the effective sample size using the algorithm in Section 2.3 of the paper by Madeline Thompson. The algorithm is taken from earlier work on 'Initial Sequence Estimators' by multiple authors. The 'magic' argument is inspired by the Appendix in the No U-Turn Sampler paper by Hoffman & Gelman.
}

\usage{
ess(chain, mu=NULL, adj=TRUE, magic=0.05)
}

\arguments{
    \item{chain}{Matrix object with each sample (possibly multivariate) as a row.}
    \item{mu}{Vector of means with length = \code{ncol(chain)}.}
    \item{adj}{Set to \code{TRUE} to enable Initial Convex Sequence Estimator (see Section
2.3 of the paper by Thompson).}
    \item{magic}{cutoff used in Appendix of the NUTS paper by Gelman & Hoffmann. NOT used if \code{adj == TRUE}.}
}

\value{
  effective sample sizes for the time series in each column of \code{chain}.
}

\note{
Using the 'magic' argument (and choosing its value) is not mathematically rigorous in all situations. However, it's widely used in practice (e.g. in work of Hoffman and Gelman) and usually produces sensible results.
}

\references{
  Thompson, Madeline (2010) 
  \emph{A Comparison of Methods for Computing Autocorrelation Time}
  \url{http://arxiv.org/pdf/1011.0175v1.pdf}

  Hoffman, Matthew D. and  Gelman, Andrew (2014)
  \emph{The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo}
  \url{http://jmlr.org/papers/v15/hoffman14a.html} 
}

\examples{
  \dontrun{
   # Evaluator for Logistic log-likelihood, gradient, Hessian
   fghEval <- glmfgh(N=100, K=2, glmtype="logistic")
   # Draw samples using SNS
   sns.out <- runSNS(K, burnin.iters=20, nsamples=1000, fghEval)
   # Compute effective sample size
   apply(sns.out$samplesMat, 2, ess)
  }
}

back to top

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— Content policy— Contact— JavaScript license information— Web API