# Probabilistic Decomposition of Archaeological Palimpsests

## Documentation for package ‘palimpsestr’ version 0.24.0

- DESCRIPTION file.
- User guides, package vignettes and other documentation.
- Package NEWS.

## Help Pages

adjusted_rand_index | Adjusted Rand Index
archaeo_sim | Simulate an archaeological palimpsest dataset
as_phase_table | Extract phase probability table
as_plotly | Convert a ggplot to an interactive plotly widget
as_sf_links | Export high-SEI links as an sf LINESTRING layer
as_sf_phase | Convert a fitted model to an sf point layer
bootstrap_sef | Bootstrap confidence intervals for SEF diagnostics
chronology_from_oxcal | Convert OxCal-calibrated dates to date_min/date_max columns
chronology_from_rcarbon | Convert calibrated radiocarbon dates to date_min/date_max columns
compare_k | Compare multiple candidate phase counts
confusion_matrix | Confusion matrix between estimated and true phases
cv_sef | K-fold cross-validation for SEF model
demo_compressed | Demo dataset: compressed palimpsest
demo_easy | Demo dataset: well-separated phases
demo_moderate | Demo dataset: moderate palimpsest
detect_intrusions | Detect potentially intrusive observations
ese | Compute Excavation Stratigraphic Energy
export_results | Export all results to files
export_sef_report | Export a narrated SEF analysis report (PDF / DOCX)
fit_sef | Fit the Stratigraphic Entanglement Field model
gg_bootstrap | Bootstrap confidence interval plot
gg_compare_k | Phase count selection diagnostics
gg_confusion | Confusion matrix heatmap
gg_convergence | EM convergence trace
gg_cv | Cross-validation diagnostic plot
gg_direction | Directional intrusion plot
gg_energy | Excavation Stratigraphic Energy map
gg_entropy | Spatial entropy map
gg_intrusions | Intrusion probability map
gg_longevity | Gantt-style plot of type longevity
gg_map | Overlay SEF results on excavation plan geometries
gg_outliers | Intrusion ranking plot
gg_phasefield | Phase assignment map
gg_phase_composition | Per-phase class composition plot
gg_phase_profile | Vertical phase profile
gg_unit_coherence | Within-unit phase coherence plot
gg_weights | Weight sensitivity heatmap
harris_from_contexts | Generate stratigraphic penalty matrix from context depth ordering
launch_app | Launch the palimpsestr Shiny Dashboard
load_geometries | Load excavation geometries from file or database
local_sei | Compute local SEI values
optimize_weights | Estimate optimal SEI weights via cross-validation
pdi | Compute Palimpsest Dissolution Index
phase_composition | Per-phase class composition
phase_diagnostic_table | Return a compact diagnostic table
phase_transition_matrix | Phase vertical transition matrix
plot_energy | Plot local Excavation Stratigraphic Energy (base R)
plot_entropy | Plot entropy across space (base R)
plot_phasefield | Plot dominant phase assignment (base R)
plot_sei_profile | Plot ordered SEI profile (base R)
predict_phase | Predict phase probabilities
read_db | Read archaeological data from a SQL database
read_harris | Read Harris Matrix from CSV edge list
read_pyarchinit | Read finds from a pyArchInit database for palimpsest analysis
recommend_setup | Inspect a dataset and recommend 'fit_sef()' flags
reorder_phases | Reorder phases by mean depth
report_sef | Generate a textual interpretive report for a SEF model
sef_summary | Compact summary for a fitted SEF model
sei_matrix | Compute the Stratigraphic Entanglement Index matrix
sei_sparse | Compute SEI matrix with automatic sparsification
summary.sef_fit | Summarise a fitted SEF model
type_longevity | Posterior-weighted type longevity
us_summary_table | Summary table per stratigraphic unit
validate_phases_harris | Validate phase assignments against stratigraphic ordering
villa_romana | Poggio Gramignano Roman Villa excavation dataset