From 6bf70cb757f6f34934d550c6ec4ae593007ca94d Mon Sep 17 00:00:00 2001 From: joshbalDS Date: Sat, 3 Feb 2024 13:36:17 +0800 Subject: [PATCH] Add "residuals" object --- R/mlp.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/mlp.R b/R/mlp.R index 4c56550..afdf264 100644 --- a/R/mlp.R +++ b/R/mlp.R @@ -250,9 +250,11 @@ mlp <- function(y,m=frequency(y),hd=NULL,reps=20,comb=c("median","mean","mode"), } + resid <- (y - yout) + return(structure(list("net"=net,"hd"=hd,"lags"=lags,"xreg.lags"=xreg.lags,"difforder"=difforder,"sdummy"=sdummy,"ff.det"=ff.det, "det.type"=det.type,"y"=y,"minmax"=sc$minmax,"xreg.minmax"=xreg.minmax,"comb"=comb,"fitted"=yout, - "MSE"=MSE,"MSEH"=mseH),class="mlp")) + "residuals" = resid,"MSE"=MSE,"MSEH"=mseH),class="mlp")) }