euclidean_distance | R Documentation |
Function to construct the euclidean distance matrix with the two input matrices.
euclidean_distance(input1, input2)
input1 |
A matrix of input with the number of rows being the number of observations and the number of columns being the number of variables |
input2 |
A matrix of input with the number of rows being the number of observations and the number of columns being the number of variables |
The euclidean distance matrix with the number of rows and the number of columns being the number of rows in the first and second input matrices.
Mengyang Gu [aut, cre], Jesus Palomo [aut], James Berger [aut]
Maintainer: Mengyang Gu <mengyang@pstat.ucsb.edu>
# dimensional of the inputs
dim_inputs <- 8
# number of the inputs
num_obs <- 30
# uniform samples of design
input <-matrix(runif(num_obs*dim_inputs), num_obs,dim_inputs)
# the Euclidean distance matrix
R0=euclidean_distance(input, input)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.