← Back to all sparks
S

SSN2

ANALYTICS
Velocity0.0

Spatial Modeling on Stream Networks

Stream-network spatial models learning to run on data that no longer fits in memory

spatial-statisticsstream-networkskriginglarge-datahydrologyr-package
Current state
SSN2 fits spatial statistical models on stream networks, where covariance follows flow-connected distance along the network rather than straight-line distance. It is the maintained successor to the original SSN package, published through JOSS in 2024, and leans on spmodel for its underlying model machinery. Recent releases have concentrated on the constraint that binds this class of model hardest: the distance matrix.
Where it's heading
The first year was about establishing credibility and interoperability — a JOSS review, geopackage import support, deprecation of the SSN-to-SSN2 bridge, marginal means through emmeans. The 2025 releases turn to scale, moving distance matrices onto disk via filematrix and routing estimation and prediction through the local approximation. The 0.4.0 default change is the visible consequence: the neighbourhood size rises from 100 to 200, buying accuracy now that the surrounding machinery can afford it.
Prediction
With the large-data path established and its default just retuned, the next work most likely tightens that approximation further or extends it to the model classes the local argument does not yet cover.

Recent moves

  1. 9mo ago

    Local neighbourhood default doubled to 200

    Raises the default local neighbourhood size from 100 to 200 across fitting and prediction, trading some compute for a more accurate approximation. Two new vignettes cover pulling StreamCat covariates and working with large data sets, documenting the capability added in 0.3.0.

    View source ↗
  2. 10mo ago

    partition_factor regression fixed, spmodel floor raised

    Repairs a partition_factor regression introduced in the previous release and pins spmodel to at least 0.7.0 so AUROC methods dispatch correctly. Routine cleanup after a large release.

    View source ↗
  3. 0y ago

    On-disk distance matrices lift the large-data ceiling

    Adds ssn_create_bigdist() to build distance matrices through filematrix rather than in memory, with estimation and prediction routed through the local argument to use them. It lifts the constraint that had capped the size of network these models could handle, and adds emmeans support in the same release.

    View source ↗
  4. 1y ago

    Numeric stability fix for beta-family models

    Improves numeric stability of deviance and pseudo R-squared for beta-family ssn_glm() fits and syncs documentation with spmodel v0.8.0. Narrow correctness work on one model family.

    View source ↗
  5. 2y ago

    Geopackage import support and the JOSS review release

    Adds geopackage support to ssn_import() and an ssn_names() accessor, packaged with the testing and documentation work the JOSS review required. This is where the package established itself as the citable successor to SSN.

    View source ↗
  6. 2y ago

    Snapshot tag marking JOSS acceptance

    A tag capturing the package exactly as accepted by JOSS, published a week before the 0.2.0 release proper. An archival marker rather than a distinct release.

    View source ↗