summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-01-02 12:50:31 +0530
committerSuraj Yerramilli2016-01-02 12:50:31 +0530
commitdab87b1d1e834dc6aa1d97e445e5c44c6ff278a3 (patch)
tree6d91f8dde79b41e1da485b3afdfc5baa76574a65
parent47b9857016644833e0e9086f13ad30d6a59afdcb (diff)
downloadSysID-R-code-dab87b1d1e834dc6aa1d97e445e5c44c6ff278a3.tar.gz
SysID-R-code-dab87b1d1e834dc6aa1d97e445e5c44c6ff278a3.tar.bz2
SysID-R-code-dab87b1d1e834dc6aa1d97e445e5c44c6ff278a3.zip
improving quality of initial ARMAX parameters
-rw-r--r--R/estUtil.R2
-rw-r--r--R/estpoly.R4
2 files changed, 3 insertions, 3 deletions
diff --git a/R/estUtil.R b/R/estUtil.R
index e791417..9b3c10b 100644
--- a/R/estUtil.R
+++ b/R/estUtil.R
@@ -124,7 +124,7 @@ armaxGrad <- function(theta,e,dots){
if(!is.null(e)){
filt1 <- signal::Arma(b=1,a=c(1,theta[(na+nb+1:nc)]))
- grad <- apply(X,2,filter,filt=filt1)
+ grad <- apply(X,2,signal::filter,filt=filt1)
l$grad <- grad
}
diff --git a/R/estpoly.R b/R/estpoly.R
index c678f6b..7c2bc3d 100644
--- a/R/estpoly.R
+++ b/R/estpoly.R
@@ -268,7 +268,7 @@ armax <- function(x,order=c(0,1,1,0),options=optimOptions()){
yout <- apply(y,2,padZeros,n=n)
uout <- apply(u,2,padZeros,n=n)
- theta0 <- matrix(rnorm(na+nb+nc)) # current parameters
+ theta0 <- matrix(runif(na+nb+nc,min=-0.3,max=0.3)) # current parameters
l <- levbmqdt(yout,uout,order,obj=armaxGrad,theta0=theta0,N=N,
opt=options)
@@ -339,7 +339,7 @@ armax <- function(x,order=c(0,1,1,0),options=optimOptions()){
#' @examples
#' data(oesim)
#' z <- dataSlice(data,end=1533) # training set
-#' mod_oe <- oe(z,c(2,1,2),optimOptions(tol=1e-04,LMinit=0.01))
+#' mod_oe <- oe(z,c(2,1,2))
#' mod_oe
#' plot(mod_oe) # plot the predicted and actual responses
#'