generate_arc: Generate random data within specified archetypes

Description Usage Arguments Value Author(s) See Also Examples

View source: R/generate_arc.R

Description

generate_arc() generates the matrix of archetypes using specified coordinates (some noise added).

generate_data() produces matrix of random data that fits a polytope defined by archetypes by multiplying position of archetypes by random weigths (that sum to 1)

Usage

1
2
3
4
generate_arc(arc_coord = list(c(5, 0), c(-10, 15), c(-30, -20)),
  mean = 0, sd = 1)

generate_data(archetypes, N_examples = 10000, jiiter = 0.1, size = 1)

Arguments

arc_coord

list of archetype coordinates, one numeric vector (length of N dimensions) per each archetype.

mean

mean of random distribution added to arc_coord

sd

standard deviationn of random distribution added to arc_coord

archetypes

matrix of archetypes of dim(dimensions, archetypes)

N_examples

number of examples to be generated

jiiter

add noise to weigth so that data is not a perfect polytope (e.g. triangle, see examples)

size

scale the data within a polytope

Value

generate_arc() object of class "random_arc" (similar to "pch_fit"), element XC is a matrix of archetypes of dim(dimensions, archetypes)

generate_data() matrix of archetypes of dim(dimensions, examples)

Author(s)

Vitalii Kleshchevnikov

See Also

fit_pch, arch_dist

Examples

1
2
3
4
5
6
7
8
9
# Random data that fits into the triangle
set.seed(4355)
archetypes = generate_arc(arc_coord = list(c(5, 0), c(-10, 15), c(-30, -20)),
                          mean = 0, sd = 1)
data = generate_data(archetypes$XC, N_examples = 1e4, jiiter = 0.04, size = 0.9)
# Find Euclidian distance between data points and archetypes
distance = arch_dist(data, archetypes)
# Find Euclidian distance between archetypes
arc_distance = arch_dist(archetypes, archetypes)

vitkl/ParetoTI documentation built on Feb. 11, 2020, 1:36 a.m.