scatterplot_fitted_vs_true {topolow} | R Documentation |
Plot Fitted vs True Distances
Description
Creates diagnostic plots comparing fitted distances from a model against true distances. Generates both a scatter plot with prediction intervals and a residuals plot.
Usage
scatterplot_fitted_vs_true(
distance_matrix,
p_dist_mat,
scenario_name,
ndim,
save_plot = FALSE,
output_dir,
confidence_level = 0.95
)
Arguments
distance_matrix |
Matrix of true distances |
p_dist_mat |
Matrix of predicted/fitted distances |
scenario_name |
Character string for output file naming. Used if |
ndim |
Integer number of dimensions used in the model |
save_plot |
Logical. Whether to save plots to files. Default: TRUE |
output_dir |
Character. Directory for output files. Required if |
confidence_level |
Numeric confidence level for prediction intervals (default: 0.95) |
Value
A list containing the scatter_plot
and residuals_plot
ggplot objects.
Examples
# Create sample data
true_dist <- matrix(runif(100, 1, 10), 10, 10)
pred_dist <- true_dist + rnorm(100)
# Create plots without saving
plots <- scatterplot_fitted_vs_true(true_dist, pred_dist, save_plot = FALSE)
# You can then display a plot, for instance:
# plots$scatter_plot
[Package topolow version 1.0.0 Index]