Skip to content

Conversation

@jangorecki
Copy link
Member

@jangorecki jangorecki commented Oct 13, 2025

closes #2778

library(roll)
library(data.table)
set.seed(108)
x = rnorm(1e8)
n = 1e3
system.time(ans1 <- roll_var(x, n))
#   user  system elapsed 
#  3.296   0.561   3.858 
system.time(ans2 <- frollvar(x, n))
#   user  system elapsed 
#  1.421   0.230   1.652 
all.equal(ans1, ans2) && all.equal(ans1, ans3)
#[1] TRUE

@codecov
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.12%. Comparing base (55b0de6) to head (c2c5bde).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #7361    +/-   ##
========================================
  Coverage   99.11%   99.12%            
========================================
  Files          85       85            
  Lines       16443    16589   +146     
========================================
+ Hits        16298    16444   +146     
  Misses        145      145            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jangorecki

This comment was marked as resolved.

@Anirban166

This comment was marked as resolved.

@ben-schwen
Copy link
Member

LGTM but I would either move CLAMP0(x) to data.table.h or use MAX(0,x) (which is also defined in data.table.h)

@jangorecki jangorecki merged commit 3ad93f7 into master Oct 19, 2025
11 of 12 checks passed
@jangorecki jangorecki deleted the froll-var-sd branch October 19, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rolling functions, rolling aggregates, sliding window, moving average

3 participants