Description Usage Arguments Value Author(s) See Also Examples
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)
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)
|
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 |
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)
Vitalii Kleshchevnikov
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.