We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 730bc55 commit 264fbcfCopy full SHA for 264fbcf
R/growth_rate.R
@@ -240,8 +240,6 @@ growth_rate <- function(
240
}
241
} else { # Trend filtering
242
params <- parse_trendfilter_params(params)
243
- sdy <- stats::sd(y) # speeds computation significantly
244
- y <- y / sdy
245
if (params$cv) {
246
obj <- trendfilter::cv_trendfilter(
247
y, x,
@@ -262,7 +260,7 @@ growth_rate <- function(
262
260
)
263
261
single_lambda <- length(obj$lambda) == 1L
264
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
+ f <- stats::predict(obj, newx = x0, lambda = lam)
266
267
268
d <- diff(f) / diff(x0)
0 commit comments