Skip to content

Commit 264fbcf

Browse files
committed
remove scaling by sd (now done internally by the method)
1 parent 730bc55 commit 264fbcf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

R/growth_rate.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,6 @@ growth_rate <- function(
240240
}
241241
} else { # Trend filtering
242242
params <- parse_trendfilter_params(params)
243-
sdy <- stats::sd(y) # speeds computation significantly
244-
y <- y / sdy
245243
if (params$cv) {
246244
obj <- trendfilter::cv_trendfilter(
247245
y, x,
@@ -262,7 +260,7 @@ growth_rate <- function(
262260
)
263261
single_lambda <- length(obj$lambda) == 1L
264262
lam <- ifelse(single_lambda, obj$lambda, obj$lambda[which.min(abs(params$df - obj$dof))])
265-
f <- stats::predict(obj, newx = x0, lambda = lam) * sdy
263+
f <- stats::predict(obj, newx = x0, lambda = lam)
266264
}
267265

268266
d <- diff(f) / diff(x0)

0 commit comments

Comments
 (0)