---
title: "Temporal and Spatial Process Science"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Temporal and Spatial Process Science}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(collapse = TRUE, comment = "#>", eval = FALSE)
```


Recurrence analysis preserves repeated temporal structure that is lost in total dwell and transition counts.

```{r}
recurrence <- gaze_recurrence(samples, representation = "coordinates")
recurrence_features(recurrence)
plot_recurrence_matrix(recurrence)
plot_diagonal_recurrence_profile(recurrence)
windowed <- windowed_recurrence(recurrence, window = 120, step = 30)
plot_windowed_recurrence(windowed)
cross <- cross_recurrence(samples$pupil_bc, samples$eda, channels = "pupil_eda")
plot_crossmodal_recurrence(cross)
```

The experimental point-process layer models where fixations occur and can add a recent-fixation history term.

```{r}
point_process <- fit_fixation_point_process(
  fixations,
  interaction = "self_exciting",
  x_col = "x_norm",
  y_col = "y_norm",
  time_col = "onset"
)
plot_fixation_intensity(point_process)
plot_spatial_residuals(point_process)
plot_observed_expected_fixations(point_process)
diagnose_gaze_point_process(point_process)
```

These models are experimental until parameter recovery, predictive checks, and external validation are complete.
