You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by mb...@apache.org on 2018/05/25 18:38:40 UTC
systemml git commit: [SYSTEMML-2342] Fix ARIMA script handling of
zero parameters
Repository: systemml
Updated Branches:
refs/heads/master 03aaec733 -> ba497ba4f
[SYSTEMML-2342] Fix ARIMA script handling of zero parameters
Bugfix: No differncing when d/D = 0
For loops with seq to avoid execution for range of 1:0
Closes #769.
Project: http://git-wip-us.apache.org/repos/asf/systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/ba497ba4
Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/ba497ba4
Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/ba497ba4
Branch: refs/heads/master
Commit: ba497ba4ffe67179af4ffc5ca9a33c94e9bd1625
Parents: 03aaec7
Author: tobiasxschmidt <31...@users.noreply.github.com>
Authored: Fri May 25 11:27:03 2018 -0700
Committer: Matthias Boehm <mb...@gmail.com>
Committed: Fri May 25 11:37:01 2018 -0700
----------------------------------------------------------------------
.../applications/arima_box-jenkins/arima.dml | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/systemml/blob/ba497ba4/src/test/scripts/applications/arima_box-jenkins/arima.dml
----------------------------------------------------------------------
diff --git a/src/test/scripts/applications/arima_box-jenkins/arima.dml b/src/test/scripts/applications/arima_box-jenkins/arima.dml
index 188aaa2..5e3aef6 100644
--- a/src/test/scripts/applications/arima_box-jenkins/arima.dml
+++ b/src/test/scripts/applications/arima_box-jenkins/arima.dml
@@ -39,14 +39,15 @@ arima_css = function(Matrix[Double] w, Matrix[Double] X, Integer pIn, Integer P,
b = X[,2:ncol(X)]%*%w
R = Rand(rows=nrow(X), cols=nrow(X), min=0, max=0)
- for(i7 in 1:qIn){
+
+ for(i7 in seq(1, qIn, 1)){
ma_ind_ns = P+pIn+i7
err_ind_ns = i7
ones_ns = Rand(rows=nrow(R)-err_ind_ns, cols=1, min=1, max=1)
d_ns = ones_ns * as.scalar(w[ma_ind_ns,1])
R[1+err_ind_ns:nrow(R),1:ncol(R)-err_ind_ns] = R[1+err_ind_ns:nrow(R),1:ncol(R)-err_ind_ns] + diag(d_ns)
}
- for(i8 in 1:Q){
+ for(i8 in seq(1, Q, 1)){
ma_ind_s = P+pIn+qIn+i8
err_ind_s = s*i8
ones_s = Rand(rows=nrow(R)-err_ind_s, cols=1, min=1, max=1)
@@ -138,7 +139,7 @@ if(num_rows <= d){
}
Y = X
-for(i in 1:d){
+for(i in seq(1, d, 1)){
n1 = nrow(Y)+0.0
Y = Y[2:n1,] - Y[1:n1-1,]
}
@@ -148,7 +149,7 @@ if(num_rows <= s*D){
print("seasonal differencing order should be larger than number of observations divided by length of season")
}
-for(i in 1:D){
+for(i in seq(1,D, 1)){
n1 = nrow(Y)+0.0
Y = Y[s+1:n1,] - Y[1:n1-s,]
}
@@ -174,16 +175,16 @@ totcols = 1+p+P+Q+q #target col (X), p-P cols, q-Q cols
Z = Rand(rows=n, cols=totcols, min=0, max=0)
Z[,1] = Y #target col
-parfor(i1 in 1:p, check=0){
+parfor(i1 in seq(1, p, 1), check=0){
Z[i1+1:n,1+i1] = Y[1:n-i1,]
}
-parfor(i2 in 1:P, check=0){
+parfor(i2 in seq(1, P, 1), check=0){
Z[s*i2+1:n,1+p+i2] = Y[1:n-s*i2,]
}
-parfor(i5 in 1:q, check=0){
+parfor(i5 in seq(1, q, 1), check=0){
Z[i5+1:n,1+P+p+i5] = Y[1:n-i5,]
}
-parfor(i6 in 1:Q, check=0){
+parfor(i6 in seq(1,Q, 1), check=0){
Z[s*i6+1:n,1+P+p+q+i6] = Y[1:n-s*i6,]
}
@@ -206,6 +207,7 @@ num_func_invoc = num_func_invoc + ncol(simplex)
tol = 1.5 * 10^(-8) * as.scalar(objvals[1,1])
continue = 1
+best_index = 1
while(continue == 1 & num_func_invoc <= max_func_invoc) {
best_index = 1
worst_index = 1