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/PPCI
30 March 2023, 14:15:34 UTC
  • Code
  • Branches (7)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/0.1.0
    • refs/tags/0.1.1
    • refs/tags/0.1.2
    • refs/tags/0.1.3
    • refs/tags/0.1.4
    • refs/tags/0.1.5
    No releases to show
  • 17343e2
  • /
  • R
  • /
  • multi_var_projections.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:e37431bba07ffac333ac6ffc415e4cc1b4727363
origin badgedirectory badge
swh:1:dir:30296303457c13ed29284e041ce0e44c333d8a55
origin badgerevision badge
swh:1:rev:3dd117a24674216a58f0cf1a8cd28fd383eeccb7
origin badgesnapshot badge
swh:1:snp:9ace04b2c94432796421fb717e13808d1f8eab89

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
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 3dd117a24674216a58f0cf1a8cd28fd383eeccb7 authored by David Hofmeyr on 06 March 2020, 09:10:01 UTC
version 0.1.5
Tip revision: 3dd117a
multi_var_projections.R
mddr <- function(X, p, minsize = NULL, v0 = NULL, bandwidth = NULL, alphamin = NULL, alphamax = NULL, verb = NULL, labels = NULL, maxit = NULL, ftol = NULL){

  if(is.data.frame(X)) X <- as.matrix(X)

  if(is.null(verb)) verb = 0
  # set parameters for projection pursuit

  n <- nrow(X)
  d <- ncol(X)

  # stores hyperplane separators for each node, v and b

  vs <- matrix(0, d, p)

  # repeatedly identify the next projection dimension, based on orthogonalising the data to the projections already found

  for(it in 1:p){
    if(it==1) proj <- mdh(X, v0, minsize, bandwidth, alphamin, alphamax, verb, labels, maxit, ftol)
    else proj <- mdh(X-X%*%vs[,1:(it-1)]%*%t(vs[,1:(it-1)]), v0, minsize, bandwidth, alphamin, alphamax, verb, labels, maxit, ftol)
    vs[,it] <- proj$v
  }

  output <- list(projection = vs, fitted = X%*%vs, data = X, method = 'MDH', args = list(v0 = v0, minsize = minsize, bandwidth = bandwidth, alphamin = alphamin, alphamax = alphamax, maxit = maxit, ftol = ftol))

  class(output) <- 'ppci_projection_solution'

  output
}


mcdr <- function(X, p, minsize = NULL, v0 = NULL, verb = NULL, labels = NULL, maxit = NULL, ftol = NULL){

  if(is.data.frame(X)) X <- as.matrix(X)

  if(is.null(verb)) verb = 0
  # set parameters for projection pursuit

  n <- nrow(X)
  d <- ncol(X)

  # stores hyperplane separators for each node, v and b

  vs <- matrix(0, d, p)

  # repeatedly identify the next projection dimension, based on orthogonalising the data to the projections already found

  for(it in 1:p){
    if(it==1) proj <- mch(X, v0, minsize, verb, labels, maxit, ftol)
    else proj <- mch(X-X%*%vs[,1:(it-1)]%*%t(vs[,1:(it-1)]), v0, minsize, verb, labels, maxit, ftol)
    vs[,it] <- proj$v
  }

  output <- list(projection = vs, fitted = X%*%vs, data = X, method = 'MCDC', args = list(v0 = v0, minsize = minsize, maxit = maxit, ftol = ftol))

  class(output) <- 'ppci_projection_solution'

  output
}



ncutdr <- function(X, p, v0 = NULL, s = NULL, minsize = NULL, verb = NULL, labels = NULL, maxit = NULL, ftol = NULL){

  if(is.data.frame(X)) X <- as.matrix(X)

  if(is.null(verb)) verb = 0
  # set parameters for projection pursuit

  n <- nrow(X)
  d <- ncol(X)

  # stores hyperplane separators for each node, v and b

  vs <- matrix(0, d, p)

  # repeatedly identify the next projection dimension, based on orthogonalising the data to the projections already found

  for(it in 1:p){
    if(it==1) proj <- ncuth(X, v0, s, minsize, verb, labels, maxit, ftol)
    else proj <- ncuth(X-X%*%vs[,1:(it-1)]%*%t(vs[,1:(it-1)]), v0, s, minsize, verb, labels, maxit, ftol)
    vs[,it] <- proj$v
  }

  output <- list(projection = vs, fitted = X%*%vs, data = X, method = 'NCutH', args = list(v0 = v0, s=s, minsize = minsize, maxit = maxit, ftol = ftol))

  class(output) <- 'ppci_projection_solution'

  output
}

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