# get_dist_df: Convert dissimilarity data into input format for BUDS In nlhuong/buds: Bayesian Unidimensional Scaling (BUDS)

## Description

Function returns distances in a long data.frame format, which is an input to fit_buds function, and for obtaining estimates for distances variances.

## Usage

 1 get_dist_df(D, K) 

## Arguments

 D A square matrix of pairwise dissimilarities K An integer indicating k-nearest neighbours for computing average distance to kNN.

## Details

For each distance d_{ij} = d(x_i, x_j) the function computes the mean and variance defined as the empirical mean and variance of distances in a set \{d(x_i, x_k): x_k \in kNN of x_j\} \cup \{d(x_j, x_l): x_l \in kNN of x_i \}.

## Value

A data frame to be used as input data for BUDS.

nlhuong/buds documentation built on May 17, 2019, 3:13 a.m.