Auto.Arima not executing as expected

Running R3.3.2 and Knime 3.3

In RStudio, I am able to demonstrate the following behavior:

1) Seasonal Sales through auto.arima chooses model (1,0,1)(0,1,0)[12]

2) Same data after Multiplicative Seasonality ajustment fed into auto.arima then chooses model (0,1,0) only.

This was expected in RStudio.

So, when I attempt the same script in R Snippet using BOTH data files for knime.in both data streams evaluate to (0,1,0) which is expected for the Adjusted Sales (ts_binders2.csv), but not for the Raw Sales (ts_binders.csv).

Anyone have an idea about why the script would evaluate differently in Knime R Snippet than it does in R Studio?

FYI, I've attached RStudio screen shots and exported Knime test workflow and the 2 data files producing different results in RStudio vs. R Snippet in Knime.

Thanks.  Jeff

Script:

library(forecast)

sales <- knime.in$"ORIG_SALES_AMT (formatted)"

salests <- ts(sales, frequency=12, start=c(2013,1))

mod <- auto.arima(salests)

xp <- toString(arimaorder(mod)[1])

xd <- toString(arimaorder(mod)[2])

xq <- toString(arimaorder(mod)[3])

xP <- toString(arimaorder(mod)[4])

xD <- toString(arimaorder(mod)[5])

xQ <- toString(arimaorder(mod)[6])

xperd <- toString(arimaorder(mod)[7])

xdf <- data.frame(vp = character(), 

                  vd = character(), 

                  vq = character(),

                  vP = character(),

                  vD = character(),

                  vQ = character(),

                  vperd = character())

xrow <- data.frame(vp=xp, vd=xd, vq=xq,

                   vP=xP, vD=xD, vQ=xQ,

                   vperd=xperd)

xdf <- rbind(xdf, xrow)

knime.out <- xdf

 

 

 

Any 

Original Post Dec 19, 2016

RESOLVED!

OK, So the ONLY difference in my RStudio vs Knime R Snippet logic was that RStudio was using read.csv to get input data while R Snippet was using knime.in.  Upon further inspection, I had a data type issue on what was passing into knime.in from the workflow.  

As soon as I fixed the type, it now runs as expected: RStudio matches R Snippet.

Jeff

Hi Jeff,

great this is working, this is how it should be :-)

Best, Iris

 

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.