#general

Title

v

Valeriy

03/14/2023, 5:01 PMHi **@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 PMhey **@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 PMThat’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 PMm

Mariana Menchero

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

m

Max (Nixtla)

03/17/2023, 6:38 PMm

Mariana Menchero

03/17/2023, 6:39 PMsure, will do

v

Valeriy

03/17/2023, 7:45 PMm

Mariana Menchero

03/17/2023, 8:08 PMYes, 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 PMHi **@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 PMOk, 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