Qlik Community

Qlik Server Side Extensions Discussions

Discussion Board for collaboration on Server-Side Extensions and Advanced Analytics Integration.

aineth77
New Contributor II

Not able to run Holt-Winters

I downloaded the example app R_TimeSeriesAnalysis, however, I have not been able to run the script for the Holt-Winters method. I get the message: "Client Specified an Invalid Argument". I was able to run the example for moving averages but not this one. I also tried with a different dataset but it didn´t work.

The code, as included in the app is the following:

R.ScriptEval('library(TTR);library(forecast);forecast(HoltWinters(q$sumRain, beta=FALSE, gamma=FALSE), h=$(RainNumberOfYears))$fitted', Sum([rain]) as sumRain)

Has anyone experienced a similar issue?

What are the conditions that the data should meet?

Please help!

Tags (2)
Labels (1)
5 Replies
maura_baltazar
New Contributor

Re: Not able to run Holt-Winters

Hello, Try to change the R code

'Rainfall London Forecast' sheet:

'library("TTR"); library("forecast"); forecast:::forecast.HoltWinters(HoltWinters(q$sumRain, beta=FALSE, gamma=FALSE),h=8)$fitted'

'Annual rainfall London 1813-1912' sheet:

'library(TTR);library(forecast);data.frame(forecast(HoltWinters(q$sumRain, beta=FALSE, gamma=FALSE), h=$(RainNumberOfYears)))[,1]'

Hope that helps

aineth77
New Contributor II

Re: Not able to run Holt-Winters

Unfortunately, this didn´t work for me!

I am a little bit frustrated after trying to make this work.

Thanks in any case!

Aineth

2018-02-16 8:13 GMT-06:00 Maura Baltazar <qcwebmaster@qlikview.com>:

mjones87
New Contributor III

Re: Not able to run Holt-Winters

Hi Aineth,

Your R code looks the same as mine and mine is working ok.

Do the other visualisations in the qvf work ok?

Have you installed the requisite R packages (TTR, forecast)?

yannick_c
New Contributor III

Re: Not able to run Holt-Winters

Hi,


You forgot 2 semicolons after the function forecast() and at the end of the script.


R.ScriptEval('library(TTR);library(forecast);forecast(HoltWinters(q$sumRain, beta=FALSE, gamma=FALSE)

;  <--

h=$(RainNumberOfYears))$fitted

;  <--

', Sum([rain]) as sumRain)

asiic999
New Contributor II

Re: Not able to run Holt-Winters

Hello, I also have that detail, but I found a possible solution, I do not know if it is the same result.


1.- update the version of R, the forecast library works from the version 3.5.1


2.- I guess this function has to predict, but as it is up to the same year known, I think it is not the original result

R.ScriptEval('library("TTR"); library("forecast"); HoltWinters(q$sumRain, beta=FALSE, gamma=FALSE)$fitted', Sum([rain]) as sumRain)                                                


3.- The link shows how to use the predict functions using the same library
Método Holt-Winters para Predicciones en R



Community Browser