https://github.com/nixtla logo
#general
Title
# general
v

Valeriy

03/14/2023, 5:01 PM
Hi @fede I have a question about https://nixtla.github.io/statsforecast/models.html#simpleexponentialsmoothingoptimized. Is this function a replica of HoltWinters in R or somewhat different. Is there a way to access optimized alpha from the function run like in R? I am trying to run HoltWinters in R on the same data to match the R output, is sesopt the best choice to match R output?
f

fede (nixtla) (they/them)

03/14/2023, 8:12 PM
hey @Valeriy! The easiest way to recover R’s simple exponential smoothing (ses) is to call
AutoETS
with only additive errors (
model='ANN'
). Here’s an example of how to recover the parameters (the first one corresponds to
alpha
)
👍 1
v

Valeriy

03/14/2023, 8:16 PM
That’s great many thanks @fede (nixtla) (they/them)
Hi @fede (nixtla) (they/them) I am trying to replicate R result for this real time series [5,6,3,2,6,3,9] the alpha produced by HoltWinters from R is 6.610696e-05 and this is the result of fit in R [5.0000, 5.0001, 4.9999, 4.9997, 4.9998, 4.9997, 4.9999]. Using the suggested code I am getting a different alpha 1.00000000e-04 and I guess different result. Do you reckon exact replication is possible using one of Nixtla models? Also how does one obtain predictions in sample for the above example? I have tried predict_in_sample() that i used for SimpleExponentialSmoothingOptimized but for AutoETS it did not seem to work
m

Max (Nixtla)

03/17/2023, 6:26 PM
@Mariana Menchero: could you try to replicate?
m

Mariana Menchero

03/17/2023, 6:27 PM
Sure, I'm on it.
m

Max (Nixtla)

03/17/2023, 6:38 PM
@Mariana Menchero: while you figure this out, could yo create a github issue so we have track of this.
m

Mariana Menchero

03/17/2023, 6:39 PM
sure, will do
v

Valeriy

03/17/2023, 7:45 PM
@Mariana Menchero @fede (nixtla) (they/them) @Max (Nixtla) I wonder if there is a way to extract alpha from SES Optimized similar to what Fede shared for ANN model. Getting alpha back from all exponential smoothing is very important. Our devs say currently there doesn’t seem that it is able to return alpha at the moment.
m

Mariana Menchero

03/17/2023, 8:08 PM
Yes, that's correct. And I agree. Getting the alpha is an important feature worth including in the exponential smoothing models.
Hi @Valeriy I started to review this issue, but I haven't been able to replicate your result. Using the forecast R package v 8.16, the Holt-Winters function hw( ) returns an error (it says that frequency should be greater than one) and the Holt function Holt( ) returns alpha = 0.6075. Hence, - Is the frequency of the time series 1? - What function did you use to obtain the values you mentioned before?
v

Valeriy

03/21/2023, 6:41 PM
Hi @Mariana Menchero HoltWinters in R, frequency 52, both beta and gamma set to False
Our devs used this setup which should reproduce the numbers
If difficult, don’t spend time on it please, we put Nixtla one as replacement for now but would be great to have alpha returned added to future functionality releases if possible please
m

Mariana Menchero

03/21/2023, 6:48 PM
Ok, thank you. I was using the Holt-Winters function from the forecast package, but now I see that it should the Holt-Winters function from stats. And yes, we're looking into returning the alpha because we agree that it's an important functionality to have.
👍 2