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

  • d8f0567
  • /
  • man
  • /
  • bayesGLM.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
content badge
swh:1:cnt:a652322452dea40cfeafec54f0dde2c573704f36
directory badge
swh:1:dir:a1faf343a1ffc7090bfe8216a3a38e9d93e35542

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
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
bayesGLM.Rd
\name{bayesGLM}
\alias{glmfgh}

\title{Bayesian Regression of Generalized Linear Models}

\description{
  A closure which generates a function, gradient, Hessian evaluator using for log-likelihood functions of 4 types of GLMs. 
}

\usage{
glmfgh(N, K, glmtype = "logistic", X=NULL, y=NULL) 
}

\arguments{
    \item{N}{Number of observations.}
    \item{K}{Number of variables.}
    \item{glmtype}{Must be one of \code{logistic}, \code{poisson}, \code{geometric}, \code{exponential}. }
    \item{X}{Data matrix of the explanatory variable, must have \code{N} rows and \code{K} cols. If \code{NULL} then simulated data is used.}
    \item{y}{Vector having the dependent variable (response) corresponging to \code{X}}
}

\value{
  A function suitable for use in \code{sns.run} as a function, gradient, Hessian evaluator.
}

\note{
GLMs are distributions where a linear expression replaces the parameter in some `base' distributions. A general framework to compute the expanded Hessian from that of the base, following the `Log-concavity invariance theorem' (\code{Appendix A} of the preprint \emph{Mahani and Sharabiani (2013)}), is used to generate the Hessian and gradient.

\code{expand.1par.R} has the Hessian and gradient expander code for probability distributions derived from any one paramter base distributions. The derived distributions are guaranteed to be log-concave if the base distribution is log-concave as shown in the referred paper.  
}

\references{
 Mahani, Alireza S. and Sharabiani, Mansour T.A. (2013)
 \emph{Metropolis-Hastings Sampling Using Multivariate Gaussian Tangents}
 \url{http://arxiv.org/pdf/1308.0657v1.pdf}
}


\examples{
 \dontrun{
  # Evaluator for Logistic log-likelihood, gradient, Hessian
  fghEval <- glmfgh(N=100, K=2, glmtype="logistic")
 }
}

back to top

Software Heritage — Copyright (C) 2015–2026, 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