summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-02-29 12:56:42 +0530
committerSuraj Yerramilli2016-02-29 12:56:42 +0530
commit95b5ab86ba4c7972e6e3a885412853d0bf7b58f6 (patch)
tree0a1ecfd9e57579e2738020e36f8db4768848c63a
parentb249b416d5960377aa5387bb9d060dc4489d016e (diff)
downloadSysID-R-code-95b5ab86ba4c7972e6e3a885412853d0bf7b58f6.tar.gz
SysID-R-code-95b5ab86ba4c7972e6e3a885412853d0bf7b58f6.tar.bz2
SysID-R-code-95b5ab86ba4c7972e6e3a885412853d0bf7b58f6.zip
adding FIR type to idpoly models
-rw-r--r--R/poly.R4
1 files changed, 3 insertions, 1 deletions
diff --git a/R/poly.R b/R/poly.R
index 67a555f..338ce69 100644
--- a/R/poly.R
+++ b/R/poly.R
@@ -45,7 +45,7 @@ idpoly <- function(A=1,B=1,C=1,D=1,F1=1,ioDelay=0,Ts=1,
typecheck <- function(x){
y <- lapply(x[1:5],checkUnity)
if(y$A){
- out <- if(y$C && y$D) "oe" else "bj"
+ out <- if(y$C && y$D) if(y$F1) "fir" else "oe" else "bj"
} else{
if(y$D && y$F1){
out <- if(y$C) "arx" else "armax"
@@ -64,6 +64,8 @@ print.idpoly <- function(mod,se=NULL,dig=3){
if(mod$type=="arx"){
cat("Discrete-time ARX model: A(z)y[k] = B(z)u[k] + e[k] \n\n")
+ } else if(mod$type=="fir"){
+ cat("Discrete-time FIR model: y[k] = B(z)u[k] + e[k] \n\n")
} else if(mod$type=="armax"){
cat("Discrete-time ARMAX model: A(z)y[k] = B(z)u[k] + C(z)e[k] \n\n")
} else if(mod$type=="oe"){