From 0ad1c26f00ea7063cdf63eb7c03a412c3cf1eb14 Mon Sep 17 00:00:00 2001 From: Suraj Yerramilli Date: Thu, 12 Feb 2015 11:19:21 +0530 Subject: corrected predicted values of the detrend function --- R/detrend.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/detrend.R b/R/detrend.R index 700b8ff..7f03753 100644 --- a/R/detrend.R +++ b/R/detrend.R @@ -38,7 +38,7 @@ detrend.idframe <- function(data){ input[,i] <- fitted(input_trend[[i]]) } - data_detrend$output <- out;data_detrend$input <- input + data_detrend$output <- data$output - out;data_detrend$input <- data$input - input est <- list(fitted.values=data_detrend,output.trend = output_trend, input.trend = input_trend) @@ -75,7 +75,8 @@ predict.detrend.idframe <- function(object,newdata=NULL,...){ data <- newdata out <- detrend.predict(object$output.trend,data$output) input <- detrend.predict(object$input.trend,data$input) - data$output <- out;data$input <- input + data$output <- data$output - out + data$input <- data$input - input } return(data) } -- cgit