Skip to contents

A common reporting view of the package's transport comparisons, barycenters, medians and interpolation results. Native results retain their existing classes, values and attributes. The report reads saved information only; it does not compute an objective, repair a candidate, or infer a certificate.

Usage

ot_inspect(x)

Arguments

x

An individual result produced by a supported T4transport computation. For interpolation at several times, use `lapply(results, ot_inspect)`.

Value

A `t4transport_report` list with `problem` (family, target, geometry, feasible set, objective convention and regularization), named numeric `values`, `termination` (status, reason, convergence flag, iterations and scope), a `checks` data frame (quantity, value, norm, tolerance and scope), and lists `approximation`, `history` and `settings`. `settings` includes the producer and available method, controls, initialization and replay information. Histories retain the native saved format. No plan or estimated measure is copied into the report; inspect the native result for those.

Details

The supported families are finite exact and regularized transport, sliced transport, Procrustes transport, Gromov–Wasserstein, and Gaussian comparisons and summaries, including their ECDF, histogram and image interfaces. Constructors, converters, `fiedler()`, `gaussvis2d()` and `wassboot()` are not computational-report inputs. Older saved results without producer metadata and arbitrary lists are not guessed from their field names.

A successful status retains its original stopping reason and scope. It need not certify a global optimum, a metric, or the accuracy of projection or sphere integration. Histogram diagnostics can concern the unprojected estimate, rather than the displayed midpoint measure. Entropy in the final objective, KL proximal steps, median smoothing and display projection are identified separately. An unavailable scalar is typed `NA`; an inapplicable component is empty. Existing `NA`, infinite residuals and failed statuses remain visible. Check norms and tolerances are left unavailable when the saved result does not identify them.

Examples

result <- ot_distance(ot_measure(c(0, 2)), ot_measure(c(1, 3)))
ot_inspect(result)
#> Transport report | finite | unregularized_transport 
#> Producer: ot_distance 
#> Status: SUCCESS ( finite_monotone_transport )
#>             distance       transport_cost  transport_cost_root 
#>                    1                    1                    1 
#> wasserstein_distance 
#>                    1 
#> Scope: reported stopping criterion only; interpret its reason and available checks 
fit <- ot_summary(lapply(c(0, 0, 3), ot_measure), target = "median")
summary(ot_inspect(fit))
#> $problem
#> $problem$family
#> [1] "finite"
#> 
#> $problem$target
#> [1] "median"
#> 
#> $problem$geometry
#> [1] "wasserstein2"
#> 
#> $problem$feasible
#> [1] "unrestricted_1d"
#> 
#> $problem$objective_convention
#> [1] "sum(weights * W2)"
#> 
#> $problem$regularization
#> list()
#> 
#> 
#> $values
#> objective 
#>         1 
#> 
#> $termination
#> $termination$status
#> [1] "success"
#> 
#> $termination$stop_reason
#> [1] "collision_optimality"
#> 
#> $termination$converged
#> [1] TRUE
#> 
#> $termination$iterations
#> [1] 0
#> 
#> $termination$scope
#> [1] "reported stopping criterion only; interpret its reason and available checks"
#> 
#> 
#> $checks
#>                quantity     value
#> 1 stationarity_residual 0.0000000
#> 2             step_norm 0.0000000
#> 3      objective_change 0.0000000
#> 4      collision_weight 0.6666667
#>                                                                  norm tolerance
#> 1 minimum Hilbert subgradient norm on the returned measure refinement     2e-08
#> 2                                                                <NA>        NA
#> 3                                                                <NA>        NA
#> 4                                                                <NA>        NA
#>               scope
#> 1 saved computation
#> 2 saved computation
#> 3 saved computation
#> 4 saved computation
#> 
#> $approximation
#> list()
#> 
#> $history
#> $history$accepted
#> [1] 1
#> 
#> 
#> $settings
#> $settings$producer
#> [1] "ot_summary"
#> 
#> $settings$method_family
#> [1] "quantile"
#> 
#> $settings$control
#> $settings$control$maxiter
#> [1] 1000
#> 
#> $settings$control$atol
#> [1] 1e-08
#> 
#> $settings$control$rtol
#> [1] 1e-08
#> 
#> 
#> $settings$multistart
#> $settings$multistart$nstart
#> [1] 1
#> 
#> $settings$multistart$chosen
#> [1] 1
#> 
#> $settings$multistart$successful
#> [1] TRUE
#> 
#> $settings$multistart$objectives
#> [1] 1
#> 
#> $settings$multistart$statuses
#> [1] "success"
#> 
#> $settings$multistart$stop_reasons
#> [1] "collision_optimality"
#> 
#> $settings$multistart$diagnostics
#> $settings$multistart$diagnostics[[1]]
#> $settings$multistart$diagnostics[[1]]$stationarity_residual
#> [1] 0
#> 
#> $settings$multistart$diagnostics[[1]]$stationarity_tolerance
#> [1] 2e-08
#> 
#> $settings$multistart$diagnostics[[1]]$collision_weight
#> [1] 0.6666667
#> 
#> $settings$multistart$diagnostics[[1]]$step_norm
#> [1] 0
#> 
#> $settings$multistart$diagnostics[[1]]$objective_change
#> [1] 0
#> 
#> $settings$multistart$diagnostics[[1]]$step_norm_scope
#> [1] "last accepted quantile iterate before finite-measure conversion"
#> 
#> $settings$multistart$diagnostics[[1]]$optimization_objective_change
#> [1] 0
#> 
#> $settings$multistart$diagnostics[[1]]$distances
#> [1] 0 0 3
#> 
#> $settings$multistart$diagnostics[[1]]$contributions
#> [1] 0 0 1
#> 
#> $settings$multistart$diagnostics[[1]]$active_measure_indices
#> [1] 1 2 3
#> 
#> $settings$multistart$diagnostics[[1]]$refinement_cells
#> [1] 1
#> 
#> $settings$multistart$diagnostics[[1]]$returned_refinement_cells
#> [1] 1
#> 
#> $settings$multistart$diagnostics[[1]]$selected_input_index
#> [1] 1
#> 
#> $settings$multistart$diagnostics[[1]]$mass_grid_input_index
#> [1] NA
#> 
#> $settings$multistart$diagnostics[[1]]$optimization_objective
#> [1] 1
#> 
#> $settings$multistart$diagnostics[[1]]$representation_objective_change
#> [1] 0
#> 
#> $settings$multistart$diagnostics[[1]]$diagnostic_scope
#> [1] "returned finite measure"
#> 
#> $settings$multistart$diagnostics[[1]]$stationarity_definition
#> [1] "minimum Hilbert subgradient norm on the returned measure refinement"
#> 
#> 
#> 
#> $settings$multistart$initializations
#> $settings$multistart$initializations[[1]]
#> NULL
#> 
#> 
#> 
#> $settings$call
#> ot_summary(measures = lapply(c(0, 0, 3), ot_measure), target = "median")
#> 
#> $settings$package_version
#> [1] "0.2.0.9002"
#> 
#> $settings$representations
#>    measure1    measure2    measure3 
#> "empirical" "empirical" "empirical" 
#> 
#> $settings$weights
#> [1] 0.3333333 0.3333333 0.3333333
#> 
#> $settings$labels
#> [1] "measure1" "measure2" "measure3"
#> 
#>