Skip to content

Commit

Permalink
skewness index added
Browse files Browse the repository at this point in the history
  • Loading branch information
dicook committed Sep 1, 2024
1 parent fcc470e commit 125e252
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tourr
Title: Tour Methods for Multivariate Data Visualisation
Version: 1.2.1
Version: 1.2.2
Authors@R: c(
person("Hadley", "Wickham", email = "h.wickham@gmail.com", role = c("aut", "ctb"), comment = c(ORCID = "0000-0003-4757-117X")),
person("Dianne", "Cook", email = "dicook@monash.edu", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-3813-7155")),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export(search_better_random)
export(search_geodesic)
export(search_polish)
export(search_posse)
export(skewness)
export(slice_index)
export(sphere_data)
export(splines2d)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# tourr 1.2.2

* New skewness index, as defined in original Cook, Buja, Cabrera paper

# tourr 1.2.1

* anomaly tour is initialised with a random basis
Expand Down
19 changes: 19 additions & 0 deletions R/interesting-indices.r
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,25 @@ cmass <- function() {
}
}

#' Skewness index.
#'
#' Calculates the skewness index. See Cook, Buja and Cabrera (1993)
#' Projection pursuit indexes based on orthonormal function expansions
#' for equations.
#'
#' @keywords hplot
#' @export
skewness <- function() {
function(mat) {
n <- nrow(mat)
d <- ncol(mat)

idx <- mean(rowSums(mat * exp(-0.5 * mat^2)))

idx
}
}

#' LDA projection pursuit index.
#'
#' Calculate the LDA projection pursuit index. See Cook and Swayne (2007)
Expand Down
1 change: 1 addition & 0 deletions man/tourr-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 125e252

Please sign in to comment.