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/scModels
28 January 2023, 18:45:53 UTC
  • Code
  • Branches (6)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/1.0.0
    • refs/tags/1.0.1
    • refs/tags/1.0.2
    • refs/tags/1.0.3
    • refs/tags/1.0.4
    No releases to show
  • 71d6ecc
  • /
  • R
  • /
  • pb.R
Raw File Download Save again
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 ...

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
swh:1:cnt:67225d9c6385da31b29f7b08b20ffed960ae6671
origin badgedirectory badge
swh:1:dir:ef5c58ae0a1ea03a560f6611b9de36d674b1209f
origin badgerevision badge
swh:1:rev:6eaddec6ef0bffeedea3b70bece1699cb1c5f66a
origin badgesnapshot badge
swh:1:snp:71aa7a1048a256887a7ca6e4730d9177c0e591ed

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: 6eaddec6ef0bffeedea3b70bece1699cb1c5f66a authored by Lisa Amrhein on 26 February 2021, 13:10:02 UTC
version 1.0.2
Tip revision: 6eaddec
pb.R
#' Poisson-beta Distribution
#'
#' Density, distribution function, quantile function and random generation for the
#' Poisson-beta distribution: a Poisson distribution whose parameter itself follows
#' a beta distribution. Alpha and beta are the parameters of this specific beta
#' distribution which is scaled on (0, c) in contrast to the usual scaling of the
#' standard beta distribution on (0,1).
#'


#' @param x,q  Vector of (non-negative integer) quantiles
#' @param p  Vector of probabilities
#' @param n  Number of observations
#' @param alpha,beta  Non-negative parameters of the beta distribution (shape1 and shape2)
#' @param c  Numeric scaling parameter of the beta distribution. The standard beta is
#'     scaled on (0,1) (default) and can be transformed to (0,c).
#' @param log,log.p  Logical; if TRUE, probabilities p are given as log(p)
#' @param lower.tail  Logical; if TRUE (default), probabilities are \eqn{P[X \le x]}
#'                        otherwise, \eqn{P[X > x]}.
#' @keywords Poisson-beta distribution
#' @name Poisson-beta
#' @useDynLib scModels
#' @importFrom Rcpp evalCpp sourceCpp
#' @export
#' @examples
#'  X <- dpb(x=0:200, alpha=5, beta=3, c=20)
#'  plot(0:200, X, type='l')
#'  Y <- dpb(0:10, seq(10.0,11.0,by=0.1), seq(30.0,31.0,by=0.1), seq(10.2,11.2,by=0.1))
dpb <- function(x, alpha, beta, c = 1, log = FALSE) {
    cpp_dpb(x, alpha, beta, c, log)
}


#' @rdname Poisson-beta
#' @export
#' @examples
#'  Y <- ppb(q= 0 :200, alpha=5, beta= 3, c=20)
#'  plot(0:200, Y, type="l")
ppb <- function(q, alpha, beta, c = 1, lower.tail = TRUE, log.p = FALSE) {
    cpp_ppb(q, alpha, beta, c, lower.tail, log.p)
}


#' @rdname Poisson-beta
#' @export
#' @examples
#'  Z <- qpb(p= seq(0,1, by= 0.01), alpha=5, beta= 3, c=20)
#'  plot(seq(0,1, by= 0.01),Z, type="l")
qpb <- function(p, alpha, beta, c = 1, lower.tail = TRUE, log.p = FALSE) {
    cpp_qpb(p, alpha, beta, c, lower.tail, log.p)
}


#' @rdname Poisson-beta
#' @export
#' @examples
#'  RV <- rpb(n = 1000, alpha=5, beta= 3, c=20)
#'  plot(0 : 200, X, type="l")
#'  lines(density(RV), col="red")
#'  R2 <- rpb(11, seq(10.0,11.0,by=0.1), seq(30.0,31.0,by=0.1), seq(10.2,11.2,by=0.1))
rpb <- function(n, alpha, beta, c = 1) {
    cpp_rpb(n, alpha, beta, c)
}



#' Inverse Gaussian Distribution
#'
#' random generation function for the inverse Gaussian distribution:
#' Mu and lambda are the parameters of this distribution.
#'
#' @param n  Number of observations
#' @param mu,lambda Non-negative parameters of the inverse Gaussian distribution (mean and shape)
#' @keywords Inverse Gaussian distribution
#' @name Inverse Gaussian
#' @useDynLib scModels
#' @importFrom Rcpp evalCpp sourceCpp
#' @export
#' @examples
#'  RV <- rInvGaus(n = 100, mu = 10, lambda = 2)

rInvGaus <- function(n, mu, lambda) {
    cpp_rInvGaus(n, mu, lambda)
}

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