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/mvtBinaryEP
01 July 2024, 10:59:07 UTC
  • Code
  • Branches (27)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/1.0
    • refs/tags/1.0.1
    • refs/tags/R-2.10.0
    • refs/tags/R-2.10.1
    • refs/tags/R-2.11.0
    • refs/tags/R-2.11.1
    • refs/tags/R-2.12.0
    • refs/tags/R-2.12.1
    • refs/tags/R-2.12.2
    • refs/tags/R-2.13.0
    • refs/tags/R-2.13.1
    • refs/tags/R-2.13.2
    • refs/tags/R-2.14.0
    • refs/tags/R-2.14.1
    • refs/tags/R-2.14.2
    • refs/tags/R-2.15.0
    • refs/tags/R-2.15.1
    • refs/tags/R-2.15.2
    • refs/tags/R-2.15.3
    • refs/tags/R-2.9.0
    • refs/tags/R-2.9.1
    • refs/tags/R-2.9.2
    • refs/tags/R-3.0.0
    • refs/tags/R-3.0.1
    • refs/tags/R-3.0.2
    • refs/tags/R-3.0.3
    No releases to show
  • af72a5d
  • /
  • man
  • /
  • ep.Rd
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:0469c6d2d6a0851db5533120966418684014c055
origin badgedirectory badge
swh:1:dir:6733aa9b23e94d4115397d3d336d8c5953acd5ef
origin badgerevision badge
swh:1:rev:bd876c4c9cc813f7c7b610832fa2793c250504d0
origin badgesnapshot badge
swh:1:snp:861b6d10d3ed147c9e89d73d0c11d4c9501dddff

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: bd876c4c9cc813f7c7b610832fa2793c250504d0 authored by Kunthel By on 25 January 2011, 00:00:00 UTC
version 1.0.1
Tip revision: bd876c4
ep.Rd
\name{ep}
\alias{ep}
\title{ Correlated Binary Data }
\description{
  Generates correlated binary data based on the method of Emrich and Piedmonte (1991)
}
\usage{
ep(mu, R, rho, n, isd = NULL, nRep = 1, seed = NULL, crit = 1e-06,
maxiter = 20)
}

\arguments{
  \item{mu}{ Vector of means.  If \code{rho} is specified then \code{mu} must be of length 1. }
  \item{R}{ Correlation matrix. If \code{rho} is specified then \code{R} is ignored. Only the
            upper part of R is used. }
  \item{rho}{ If common mean and exchangeable correlation is desired, then this correlation parameter must
              be specified. }
  \item{n}{ Cluster size.  If \code{rho} is specified, then this must be specified as well. }
  \item{isd}{ Internal Simulation Descriptor. This is useful for generating more responses 
              based on the parameters used in the prior call to \code{ep}.  This increases
              efficiency since the intermediate quantities need not be recomputed.  \code{isd} is 
              a \bold{list} containing some of the input parameters as well as some intermediate
              quantities.  If this is provided then \code{R} and \code{rho} are ignored. }
  \item{nRep}{ Number of clusters (replications). }
  \item{seed}{ Sets the seed }
  \item{crit}{ Level of precision used in solving for the tetra-choric correlations. }
  \item{maxiter}{ Maximum number of iterations used in solving for the tetra-choric correlations. }
}

\details{ The method relies on simulating multivariate normal vectors and then dichotomizing each 
          coordinate.  The cutpoints are determined by \code{mu}.  The correlation matrix \code{S} 
          (which are the tetra-choric correlations) of the multivariate normal vectors is computed
          in such a way that the resulting binary vectors have correlation matrix \code{R}. One possible
          complication is that this process is not always possible.  Further, when all tetra-choric 
          correlations are computed, the resulting matrix, \code{S}, may not be positive definite.  These
          are two possible failure points in the algorithm; both are detected and reported back by the code.  
}

\value{
  Returns a list with the following two components:
  \item{y }{ Multivariate response of dimension \code{nRep} by \code{length(mu)}}
  \item{isd }{ Internal Simulation Descriptor }
}

\note{ The returned object \bold{isd} is also a list with the following fields:
    \itemize{
    \item{\code{mu} }{ input parameter }
    \item{\code{rho} }{ input parameter }
    \item{\code{n} }{ input parameter }
    \item{\code{R} }{ input parameter }
    \item{\code{rootS} }{ The Cholesky root of the tetrachoric correlation matrix S (if positive definite) }
    \item{\code{S} }{ The tetrachoric correlation matrix S (if NOT positive definite) }
    \item{\code{pd} }{ Flag, TRUE if S is positive definite, FALSE otherwise }
    \item{\code{sp} }{ Flag, TRUE if successful in solving for tetrachoric correlations }
    \item{\code{i} }{ row where solving for the tetrachoric correlation failed, if it did fail }
    \item{\code{j} }{ column where solving for the tetrachoric correlation failed, if it did fail }
    }
}

\seealso{ See Also \code{\link{ranMVN}}, \code{\link{ranMVN2}}, \code{\link{ranMvnXch}} }

\examples{

# Create mean vector
mu=c(0.5, 0.3, 0.20, 0.1)

# Create correlation matrix
R = c(
    1    , 0.2 , 0.15, -0.05,
    0.2  , 1   , 0.25, 0.2  , 
    0.15 , 0.25, 1   , 0.25 ,
    -0.05, 0.2 , 0.25, 1
)
R = matrix(R, ncol=4)


ep0 = ep(mu=mu, R=R, nRep=1000, seed=NULL)
apply(ep0$y, 2, mean); cor(ep0$y)

#Generates more responses based on the parameters provided above.
ep1 = ep(isd = ep0$isd, nRep=1000, seed=NULL)
apply(ep1$y, 2, mean); cor(ep1$y)


# 5-variate based on common mean and exchangeable correlation.
ep2 = ep(mu=0.3, rho=0.2, n=5, nRep=10000)
apply(ep2$y, 2, mean); cor(ep2$y)

}

% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{ datagen }
\keyword{ distribution }
\keyword{ multivariate }


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