0

I have one last question, but I really need help on this one. The very last thing for my project is that I have to make ARIMA, to work under JRI. All everything is working, but one little piece of code is not working properly. Here's the code:

                            re.eval("library(forecast);");
            re.assign("y", arrayStr);
                re.eval("datats<-y;");


                    re.eval("arima<-auto.arima(datats);");
                    re.eval("fcast<-forecast(arima);");
                REXP fs = re.eval("summary(fcast);");

                    double[] forecast = fs.asDoubleArray();
                    for(int i=0; i<forecast.length; i++)
                    System.out.println(forecast[i]);

I've tried this one too, but it's not working too.

re.eval("sensor<-ts(y,frequency=365)");
            re.eval("library(forecast);");
            //re.eval("sink(\"sink-examp.txt\");");
            //re.eval("is.ts(datats);");
            //re.eval("sink()");
            re.eval("fit <- auto.arima(sensor,D=1);");
            re.eval("LH.pred <- forecast(fit,h=20)");
            //re.eval("sink(\"sink-examp.txt\");");
            //re.eval("sink(summary(test1))");
            REXP result = re.eval("summary(LH.pred)");
            System.out.println(result.asString());

Any advice will be appreciated. Thanks in advance!

  • I have a clue: when I (the first code): REXP fs = re.eval("summary(fcast);"); to REXP fs = re.eval("summary(datats);"); it returns something bizarre: [REAL* (9.1, 18.06, 25.16, 42.09, 62.7, 144.0)] And my series is over 6000 elements. Someone? – Milena Georgieva Nov 29 '13 at 20:32

1 Answers1

1

The reason why this is happening is: You CANNOT transfer a lot of data between both languages. I was supposed to use Oracle DB to move the data without any lost pieces of information.