summaryrefslogtreecommitdiff
path: root/R/estUtil.R
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-02-12 14:38:11 +0530
committerSuraj Yerramilli2016-02-12 14:38:11 +0530
commit9587c97c75e892191534eb4109a73b05b6022574 (patch)
tree6965a97f120d92a2ff966ca1f8e879fdef43bff8 /R/estUtil.R
parent7d0876037a42fdd11c52e08eae76870752213fcb (diff)
downloadSysID-R-code-9587c97c75e892191534eb4109a73b05b6022574.tar.gz
SysID-R-code-9587c97c75e892191534eb4109a73b05b6022574.tar.bz2
SysID-R-code-9587c97c75e892191534eb4109a73b05b6022574.zip
fixed termination issues
Diffstat (limited to 'R/estUtil.R')
-rw-r--r--R/estUtil.R5
1 files changed, 3 insertions, 2 deletions
diff --git a/R/estUtil.R b/R/estUtil.R
index 26c0fa6..f826d1a 100644
--- a/R/estUtil.R
+++ b/R/estUtil.R
@@ -23,12 +23,13 @@ levbmqdt <- function(...,obj,theta0,N,opt){
g <- t(l$grad)%*%e
termPar <- norm(g,"2")/sumsq0/100
- if(termPar < tol) break
+ theta <- theta0
repeat{
# Update Parameters
H <- t(l$grad)%*%l$grad + d*diag(dim(theta0)[1])
- Hinv <- solve(H);
+ Hinv <- solve(H);
+ if(termPar < tol) break
theta <- theta0 + Hinv%*%g
# Evaulate sum square error