Title

compare_new_to_rest_via_distance(
  tdmat,
  new_name_id = data.frame(id = "true observation"),
  distance_func = distance_psuedo_density_function,
  ...,
  df_out = T
)

Arguments

tdmat

must be a tidy_dist_mat object

new_name_id

data.frame containing which rownames of the tdmat are associated with the new observations. Note that this data.frame must be of the same format as rownames(tdmat).

distance_func

distance function to calculates some type of ordering between observations with the distance matrix. This package currently provides 3 functions for this:

  • distance_psudeo_density_function

  • distance_depth_function

  • local_distance_depth_function

If you are trying to make your own, please see examples of these methods for the tidy_dist_mat class. It's minimum required parameters are x x_new=NULL, df_out. And get's passed ...

...

additional parameters to be passed to the dist_func

df_out

indicates if one should return a data.frame or a list, by default returns data.frame.

Value

returns either a data.frame with information about quantile score value for new observations, the proportion of the simulations that have more extreme values than it and the observations names (if df_out = T), else it returns a list of quatile scores and proportion of simulations that had more extreme values than it.