Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smooth::auto.ces() failing #191

Closed
alsabtay opened this issue Jan 25, 2022 · 18 comments
Closed

smooth::auto.ces() failing #191

alsabtay opened this issue Jan 25, 2022 · 18 comments
Labels

Comments

@alsabtay
Copy link

I get the following error
Error in costfunc(matvt, matF, matw, yInSample, vecg, h, lagsModel, Etype, :
Mat::operator(): index out of bounds

The code I run :
library(smooth)
install.packages("https://github.com/carlanetto/M4comp2018/releases/download/0.2.0/M4comp2018_0.2.0.tar.gz", repos=NULL)
library(M4comp2018)
y = ts(M4[[95008]]$x, start = start(M4[[95008]]$x), frequency = 52)
fcs2 = smooth::auto.ces(y, h=M4[[95008]]$h, interval="parametric", level=0.95)

Note: 1) R 4.1.2 installed
2) latest CRAN versions of required packages installed
3) M1 Macbook

@config-i1 config-i1 added the bug label Jan 26, 2022
@config-i1
Copy link
Owner

Sorry, but I cannot reproduce this error. Here is the model that I get:

Time elapsed: 1.33 seconds
Model estimated: CES(f)
a0 + ia1: 1.1172+0.9988i
b0 + ib1: 1.35+0.978i
Initial values were produced using backcasting.

Loss function type: likelihood; Loss function value: 13399.8562
Error standard deviation: 933.3974
Sample size: 1623
Number of estimated parameters: 5
Number of degrees of freedom: 1618
Information criteria:
AIC AICc BIC BICc
26809.71 26809.75 26836.67 26836.81

95% parametric prediction interval was constructed

I get this with smooth v3.1.4 and greybox v1.0.2. I work on Linux and cannot try it on Mac right now. If I get access to it and manage to reproduce, I will see how to fix this.

By the way, what version of RcppArmadillo do you have installed?

@alsabtay
Copy link
Author

I have installed RcppArmadillo v0.10.8.1.0, Rcpp v1.0.8, smooth v3.1.4, and greybox v1.0.2.

@alsabtay
Copy link
Author

I have just updated smooth and greybox. Then, I tried it on Win10-64 and M1 MacOs Monterey 12.1, I got same error.

(I have installed RcppArmadillo v0.10.8.1.0, Rcpp v1.0.8, smooth v3.1.5, and greybox v1.0.3)

@config-i1
Copy link
Owner

Thanks! I'll investigate.

@config-i1
Copy link
Owner

Can you please check the most recent version from github by installing it via remotes::install_github("config-i1/smooth")? This should fix it.

@alsabtay
Copy link
Author

It works. Thank you for support.

@alsabtay
Copy link
Author

alsabtay commented Feb 5, 2022

Hello again,

While I was working on M4 Weekly dataset, I got same error:
Error in costfunc(matvt, matF, matw, yInSample, vecg, h, lagsModel, Etype, :
Mat::operator(): index out of bounds

The code I run :
library(smooth)
library(M4comp2018)
y = ts(M4[[95168]]$x, start = start(M4[[95168]]$x), frequency = 52)
fcs2 = smooth::auto.ces(y, h=M4[[95168]]$h, interval="parametric", level=0.95)

I tried it on Win10-64 and M1 MacOs Monterey 12.1, I got same error on both systems.

I have installed RcppArmadillo v0.10.8.1.0, Rcpp v1.0.8, smooth v3.1.6.41001, greybox v1.0.3 and forecast v8.16.

@config-i1
Copy link
Owner

I'll check, thanks.

@config-i1
Copy link
Owner

v3.1.6.41004 (95e1be1) should now fix the issue. Thank you for reporting the bug!

@alsabtay
Copy link
Author

alsabtay commented Feb 7, 2022

Thank you for quick response. However, I got same error for another weekly data. The M4[[95008]] serie didn't fail before while using smooth v3.1.6.41001.

The code I run :
library(smooth)
library(M4comp2018)
y = ts(M4[[95008]]$x, start = start(M4[[95008]]$x), frequency = 52)
smooth::auto.ces(y, h=M4[[95008]]$h, interval="parametric", level=0.95)

I have installed RcppArmadillo v0.10.8.1.0, Rcpp v1.0.8, smooth v3.1.6.41004, greybox v1.0.4 and forecast v8.16.

@config-i1
Copy link
Owner

When I run the code above, I get this:

image

What error do you get? Surely, it cannot be the same one, because I fixed the C++ issue. Also, make sure that you restart R after reinstalling the package.

@config-i1 config-i1 reopened this Feb 7, 2022
@alsabtay
Copy link
Author

alsabtay commented Feb 7, 2022

After I restarted R and reinstalled the packages (smooth and M4comp2018), I got below error message:

M4 with smooth package

@config-i1
Copy link
Owner

I hate errors that are difficult to reproduce!

Can you please provide the output of the command: Sys.info()

config-i1 added a commit that referenced this issue Feb 7, 2022
@config-i1
Copy link
Owner

config-i1 commented Feb 7, 2022

Forget about the previous comment.

This should be fixed in 428cd7d now. I really-really hope that that's it. :)
Thank you for the patience! Let me know if you find any other issues.

Note that in order to install the new version of smooth, you would also need to install new version of greybox.

@alsabtay
Copy link
Author

alsabtay commented Feb 7, 2022

Sys.info()

sysname
"Darwin"
release
"21.2.0"
version
"Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101"
nodename
"alsabtayx-MacBook-Air.local"
machine
"arm64"
login
"root"

@alsabtay
Copy link
Author

alsabtay commented Feb 7, 2022

Forget about the previous comment.

This should be fixed in 428cd7d now. I really-really hope that that's it. :) Thank you for the patience! Let me know if you find any other issues.

Note that in order to install the new version of smooth, you would also need to install new version of greybox.

I'm getting the same error for M4[[95008]] dataset on both Win10-64 and MacOS M1

config-i1 added a commit that referenced this issue Feb 7, 2022
@config-i1
Copy link
Owner

How about now? 38f1f34 This works on my Windows Laptop.

@alsabtay
Copy link
Author

alsabtay commented Feb 7, 2022

It works on both of Win10-64 and M1 macOS. Thank you for support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants