Skip to content

Add getVariogram - #134

Open
0xMuluh wants to merge 16 commits into
develfrom
temporal-variogram
Open

0xMuluh wants to merge 16 commits into
develfrom
temporal-variogram

Conversation

@0xMuluh

@0xMuluh 0xMuluh commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Adds getVariogram() and addVariogram(), which estimate D(L), the expected within-subject dissimilarity at a stated time lag, from all within-subject sample pairs. Unlike stepwise divergence, D(L) does not depend on the sampling schedule. Lags the design does not support are returned as NA; split.by compares groups by the ratio of D(L), and time.point estimates D(L) at a common time for developing communities.

Also includes the options from #136, #146, #147, #148, #155 and #157.

Closes #140, closes #141, closes #142, closes #154, closes #156.

Estimates D(L), the expected within-subject dissimilarity at a stated time lag, from all within-subject sample pairs with a local quadratic fit in log lag and subject-clustered intervals. Lags the sampling design does not support are reported as NA. split.by compares groups by the ratio of D(L); at.time estimates D(L) at a common time for developing communities.
@antagomir

Copy link
Copy Markdown
Member

Nice - could it be shorter, just getVariogram?

And at.time could be just t ?

@antagomir

antagomir commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Reference is from 1988. Nothing wrong with that but I am wondering if there is (additionally) any more fresh reference related to applications in ecology or microbiomics?

@0xMuluh

0xMuluh commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! Renamed to getVariogram() / addVariogram().

t would mask base::t() inside the function, so how about time.point instead of at.time?

Added Lloyd-Price et al. 2019 (within-subject dissimilarity against time lag in the IBD cohort) and Björk et al. 2022 (gut microbiome similarity against time lag in wild baboons) as microbiome applications.

@0xMuluh 0xMuluh changed the title Add getTemporalVariogram Add getVariogram Oct 21, 2026
@antagomir

Copy link
Copy Markdown
Member

For time point variable at least check what argument name the other miaTime/miaSim functions use to harmonize (and avoid confusion if similar but different parameters in use).

@0xMuluh

0xMuluh commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Renamed at.time to time.point and lags to time.lag.

The subjects' scores sum to zero, so with as many subjects as regression coefficients the sandwich variance is singular. D(L) is now reported only when the lag window holds at least 6 subjects, or 10 with time.point.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants