Learn R Programming

Overview

GeomArchetypal is a package that performs Geometrical Archetypal Analysis after creating Grid Archetypes which are the Cartesian Product of all minimum, maximum variable values. Since the archetypes are fixed now, we have the ability to compute the convex composition coefficients for all our available data points much faster by using the half part of Principal Convex Hull Archetypal method. Additionally we can decide to keep as archetypes the closer to the Grid Archetypes ones. Finally the number of archetypes is always 2 to the power of the dimension of our data points if we consider them as a vector space.

Basic functions are:

  • grid_archetypal() performs Geometrical Archetypal Analysis (GAA) or Grid Archetypal in short.
  • closer_grid_archetypal() finds the closer to the Grid Archetypes points and proceed to GAA.
  • fast_archetypal() the generic function for computing the A-matrix given the rows of archetypes.
  • points_inside_convex_hull() computes the percentage of points that lie inside the Convex Hull which is created by a set of vectors (archetypes in general).
  • BLB_archetypal() performs GAA after using the bag of little bootstraps as the resampling approach.

Install the archetypal package and then read vignette("GeomArchetypal", package = "GeomArchetypal").

Installation

# Install with dependencies:
install.packages("GeomArchetypal",dependencies=TRUE)

Usage

# Load package
library(GeomArchetypal)  
# Create random data
vseed = 20140519
set.seed(vseed)
df=matrix(runif(90) , nrow = 30, ncol=3) 
# Grid Archetypal
gaa=grid_archetypal(df, diag_less = 1e-6, 
                    niter = 50, use_seed = vseed)
# Print
print(gaa)
# Summary
summary(gaa)
plot(gaa)
# Closer Grid Archetypal
cga=closer_grid_archetypal(df, diag_less = 1e-3, 
                           niter = 200, use_seed = vseed)
# Print
print(cga)
# Summary
summary(cga)
# Plot
plot(cga)
# Fast Archetypal: 
# we use as archetypal rows the closer to the Grid Archetypes
# as they were find by closer_grid_archetypal() function
fa=fast_archetypal(df, irows = cga$grid_rows, diag_less = 1e-3, 
                    niter = 200, use_seed = vseed)
# Print
print(fa)
# Summary
summary(fa)
# Plot
plot(fa)

Contact

Issues:

https://github.com/dchristop/GeomArchetypal/issues

Please send comments and suggestions to dchristop@econ.uoa.gr or dem.christop@gmail.com

Copy Link

Version

Install

install.packages('GeomArchetypal')

Monthly Downloads

151

Version

1.0.3

License

GPL (>= 2)

Maintainer

Demetris Christopoulos

Last Published

October 20th, 2024

Functions in GeomArchetypal (1.0.3)

GeomArchetypal-package

Finds the Geometrical Archetypal Analysis of a Data Frame
plot.closer_grid_archetypal

Plot an Object of the Class closer_grid_archetypal
plot.grid_archetypal

Plot an Object of the class grid_archetypal
points_inside_convex_hull

Computes the Percentage of Points that Lie Inside the Convex Hull which is Created by a Set of Vectors
BLB_archetypal

Archetypal Analysis using the Bag of Little Bootstraps
print.BLB_archetypal

Print an Object of the Class BLB_archetypal
fast_archetypal

Performs the Archetypal Analysis of a Data Frame by using a Given Set of Archetypes
closer_grid_archetypal

Performs the Archetypal Analysis of a Data Frame by using as Archetypes the Closer to The Archetypal Grid Data Points
grid_archetypal

Performs the Archetypal Analysis of a Data Frame by using as Archetypes the Archetypal Grid
summary.grid_archetypal

Summary of an Object of the Class grid_archetypal
print.grid_archetypal

Print an Object of the Class grid_archetypal
print.closer_grid_archetypal

Print an Object of the closer_grid_archetypal
summary.closer_grid_archetypal

Summary of an Object of the Class closer_grid_archetypal
summary.BLB_archetypal

Summarize an Object of the Class BLB_archetypal
gallupGPS6

Gallup Global Preferences Study processed data set of six variables