Skip to content

new function for SURD of discrete-state data - #107

Merged
SpatLyu merged 20 commits into
stscl:mainfrom
SpatLyu:dev
Oct 31, 2026
Merged

SpatLyu merged 20 commits into
stscl:mainfrom
SpatLyu:dev

Conversation

@SpatLyu

@SpatLyu SpatLyu commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

This PR adds surd_discrete() as a dedicated interface for performing Synergistic-Unique-Redundant Decomposition (SURD) on discrete-state data.

image

Unlike surd(), which accepts raw numeric data and internally handles discretization and temporal or spatial lag construction, surd_discrete() directly accepts user-provided discrete states. This provides greater flexibility for users who have already prepared their state representations using custom discretization methods, clustering algorithms, or predefined categorical classifications.

Design

  • Discrete-state input: Accept data in which each column represents a discrete variable. Integer values are treated as categorical state labels rather than continuous measurements.
  • Flexible state spaces: Allow different variables to have different numbers of discrete states.
  • Consistent outputs: Return the same result structure as surd(), including vars, types, and values.
  • Separation of responsibilities: Keep discretization and temporal or spatial lag construction outside surd_discrete(), allowing users to control data preparation independently.

Compatibility

Retain the existing surd() interface for raw numeric data, including its support for data.frame, sf, and SpatRaster inputs. Both interfaces will share the same underlying SURD computation.

Scope

This PR introduces the discrete-state interface without changing the existing behavior of surd().

@SpatLyu SpatLyu self-assigned this Oct 31, 2026
@SpatLyu
SpatLyu merged commit ca5d7c0 into stscl:main Oct 31, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant