Quantcast
Channel: SCN : All Content - SAP BusinessObjects Predictive Analytics
Viewing all articles
Browse latest Browse all 836

Custom R component behaving strangely

$
0
0

Hello,

 

I'm using a custom R component in PA 2.4 to forecast hourly power consumption data for multiple customers (cannot use the built in algorithms because they do not allow me to segment the data per customer and they do an aggregated forecast).

 

I'm using a fourier decomposition to use as an regressor for my time series (variable xreg1):

 

ts3 <- msts(cust1$POWER,seasonal.periods=c(24,168))

z <- fourier(ts3,K=c(5,5))

zfall <- fourierf(ts3,K=c(5,5),h=nr)

xreg1 <- cbind(z,cust1$CDD,cust1$BankHoliday)

 

The problem is that if I use auto.arima it works, if I use arima (as I know the parameters to use) I get an error that xreg1 does not exist.

 

So the following code works:

 

     fit <- auto.arima(ts3, xreg=xreg1, seasonal = FALSE)

 

But the following code gives me an error (that object xreg1 does not exist - "Error in eval(expr, envir,enclos) : object 'xreg1' not found"):

   

     fit <- arima(ts3, order=c(4,1,3), xreg=xreg1)

 

My code works in the R console so I don't understand what PA needs in order for this to work.

 

If you have any ideas, please let me know.

 

Regards,

Dan


Viewing all articles
Browse latest Browse all 836

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>