Using ARIMA example dosent work while NumericParam2 is a invalid expression

Feb 12, 2015 at 1:19 PM
Hi.

I try to test the ARIMA example for the RIntegration Pack. When I try to put the Metric:

RScript<_RScriptFile= "C:\Program Files (x86)\R Integration Pack\RScripts\ARIMA.R", _InputNames= "Target", SortBy=(Month), NumericParam1=12, NumericParam2=12, NumericParam3=80, NumericParam4=95>(Target)

in the Input Metric Formula and validat, comes a Invalid Expression for NumericParam2. When I delete NumericParam2 comes the Invalid Expression for NumericParam3....

Error in the DSSErrors is [0x80041A09].

The example for the Seasonal Forecasting works.

Could anyone tell me what I´m doing wrong?
Thank's
Feb 13, 2015 at 5:30 PM
Hi tinote,

That's strange. I'm not exactly sure why that error may be occurring. Are you copying the metric expression from the deployR() utility or the PDF document that accompanies the off-the-shelf ARIMA script?

When I copy from the deployR() utility, I noticed that the utility wraps the SortBy differently (with { brackets). That may be it?

RScript<_RScriptFile="C:\Program Files (x86)\R Integration Pack\RScripts\ARIMA.R", _InputNames="Target", SortBy=({Month}), NumericParam1=12, NumericParam2=12, NumericParam3=80, NumericParam4=95>(Target)
Feb 14, 2015 at 7:52 AM
Hi Erik Miller,

thanks for the answer. I tried is with the { bracket but it dosen't work. I get an error for the bracket in the Input Metric Formula.

When I use the following expression in the Input Metric Formula I get a valid expression but a error in the RScriptErrors and the rows are empty.

RScript<[_RScriptFile]="C:\Program Files (x86)\R Integration Pack\RScripts\ARIMA.R", [_InputNames]="Target", [_Params]="CycleLength=12, Horizon=12, Conf1=80, Conf2=95, ImageName='', FileName=''", SortBy= ([Month Index]) >(Revenue)

2015-02-13 16:19:24 CRFPCommonNNGEN::ExRScript: R script execution failed: missing value where TRUE/FALSE needed.

I don't know what I should do know?
Thank's
Feb 17, 2015 at 1:55 PM
Edited Feb 17, 2015 at 1:58 PM
Hi tinote,

It looks like you are using v2 of the ARIMA script, which uses the Params argument. Can you confirm that you are using v2 of the R Integration Pack? The version number would be the first line of the C:\Program Files (x86)\ R Integration Pack \ ReadMe.txt. I'm still on v1, and so far I haven't found a download on this site for v2, although it maybe be up. The first version of the metric expression you included at the top of this thread looked like the v1 ARIMA script.

That may be the issue. The v1 versions of the scripts can be found here: https://rintegrationpack.codeplex.com/wikipage?title=RShelf-v1

If you do have v2 of the Integration Pack installed, then that error looks like R is saying it needs a Boolean value somewhere, and it isn't getting it. I stepped through both scripts to see if there was a difference, or anywhere that required a Boolean, but couldn't find anything obvious. There is the if(!exists("mstr.ExFlag") line, but I don't think that's the issue.

Looking at the v2 of the metric expression, the Sort by is in a different place than it is in your metric:

RScript<_RScriptFile="ARIMA.R", _InputNames="Target", SortBy=(Month), _Params="CycleLength=12, Horizon=12, Conf1=80, Conf2=95, ImageName='', FileName=''">(Target)

Also, do you have NULLs in your metric that you are passing to R? I used an IF statement and ZeroToNull(0) in the metric I was passing to R in order to set up the report and have enough rows for R to pass back the forecast. R transforms these NULL values into NAs when it reads them in.

For example:

Dec 2014 100
Jan 2015 105
Feb 2015
Mar 2015
Apr 2015

I'm not sure if that would affect this line in the script:

tsObj <- ts(Target[!is.na(Target)],

Hope this helps!
Feb 25, 2015 at 7:23 AM
I had he same issue testing the kMeansClustering example, to avoid the Invalid Expression error, I used the square brackets with the Params names and the quotation marks with the values ([NumericParam1]="4", [NumericParam2]="10"), after that I could validate the formula but the result of the metric was only blank with the error "missing value where TRUE/FALSE needed" in the log file; following the erikmiller's advise I tried the function NullToZero with my input metric and now is working! Thank you erikmiller.
Feb 26, 2015 at 7:36 AM
It works with the following expression:

RScript<[NumericParam1]="12", [NumericParam2]="12", [NumericParam3]="80", [NumericParam4]="95", [_RScriptFile]="C:\Program Files (x86)\R Integration Pack\RScripts\ARIMA.R", [_InputNames]="Target", SortBy= (Month) >(Target)

Thanks erikmiller and mortommy
Feb 26, 2015 at 12:51 PM
Hi tinote, Hi mortommy,

That's great news! Glad we could figure it out together.