summaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
Diffstat (limited to 'R')
-rw-r--r--R/idframe.R2
-rw-r--r--R/nonparam.R6
2 files changed, 4 insertions, 4 deletions
diff --git a/R/idframe.R b/R/idframe.R
index 9b79245..5a0b338 100644
--- a/R/idframe.R
+++ b/R/idframe.R
@@ -35,7 +35,7 @@ idframe <- function(output=NULL,input=NULL,Ts = 1,start=0,end=NULL,
l3 <- lapply(l,ts,start=start,deltat=Ts)
# Object Constructor
- dat <- list(output=l3[[1]],input=l3[[1]],unit=unit)
+ dat <- list(output=l3[[1]],input=l3[[2]],unit=unit)
class(dat) <- "idframe"
return(dat)
}
diff --git a/R/nonparam.R b/R/nonparam.R
index f3faa26..cebc1ab 100644
--- a/R/nonparam.R
+++ b/R/nonparam.R
@@ -42,15 +42,15 @@ impulseest <- function(x,M=30,K=NULL,regul=F,lambda=1){
for(j in seq(nInputSeries(x))){
index <- (i-1)*nInputSeries(x)+j
out[[index]] <- impulsechannel(outputData(x)[,i,drop=F],
- inputData(x)[,j,drop=F],N,K(index),
- regul,lambda)
+ inputData(x)[,j,drop=F],N,M,
+ K[index],regul,lambda)
}
}
class(out) <- "impulseest"
return(out)
}
-impulsechannel <- function(y,u,N,K=0,regul=F,lambda=1){
+impulsechannel <- function(y,u,N,M,K=0,regul=F,lambda=1){
ind <- (M+K+1):N
z_reg <- function(i) u[(i-K):(i-M-K),]
Z <- t(sapply(ind,z_reg))