Calculate the similarity between two trajectory models.

One use case for these metrics is to calculate the accuracy of a certain prediction compared to a reference trajectory. However, these metrics can also be used for other purposes, such as clustering of trajectories.

calculate_metrics(dataset, model, metrics = dyneval::metrics$metric_id,
  expression_source = dataset$expression)



The first trajectory, in most cases a gold standard trajectory


The second trajectory, in most cases a predicted trajectory


Which metrics to evaluate. Check dyneval::metrics for a list of possible metrics. Passing a custom metric function with format function(dataset, model) { 1 } is also supported. The name of this function within the list will be used as the name of the metric.


The expression data matrix, with features as columns.

  • If a matrix is provided, it is used as is.

  • If a character is provided, dataset[[expression_source]] should contain the matrix.

  • If a function is provided, that function will be called in order to obtain the expression (useful for lazy loading).


Some metrics are asymmetric (see dyneval::metrics$symmetric), in which case the order of the dataset and model parameters matters.