Re: [R] error in arfima...
>>>>> akshay kulkarni >>>>> on Mon, 5 Jun 2023 14:11:12 + writes: > Dear Martin, > Sad that the bug is beyond your ken... well, that's not exactly what I tried to say (and I did ask you for more output from your R session and also asked about what happens if you try things several time in a row, etc). At the moment, it looks to me that nobody can reproduce the problem with what you've given, and my personal guess is that something is "bad" only on your computer, i.e., your combination of hardware, software, your R installation, your installation of the forecast package and its many dependencies (other R packages), etc. .. > Fortunately, the error happens only rarely...The length of LYGH was 719 and there were only two such errors..I will just replace them with NA and make do. > By the by, what if I send LYGH as an attachment to your actual mail ( not the r-help mail)? Will it help? Can you then pinpoint the cause? Yes, please do that. Make the file "LYGH.rds" available (on the web or send to me) which you get after saveRDS(LYGH, file="LYGH.rds") > Or should I raise a bug report? If yes, how( I never raised one)? We don't know yet if there is any bug, see above. Martin > THanking you, > Yours sincerely, > AKSHAY M KULKARNI > > From: Martin Maechler > Sent: Monday, June 5, 2023 3:19 PM > To: akshay kulkarni > Cc: Martin Maechler ; R help Mailing list > Subject: Re: [R] error in arfima... >> Dear Martin, >> REgrets to reply this late >> I am staring at a conundrum never before encountered in my experience with R: >> LYGH[[201]] >> [1] 45.40 3.25 6.50 2.15 >> > arfima(LYGH[[201]]) >> Error in .fdcov(x, fdf$d, h, nar = nar, nma = nma, hess = hess, fdf.work = fdf$w) : >> NA/NaN/Inf in foreign function call (arg 5) >> > arfima(c(45.40,3.25,6.50,2.15)) >> Call: >> arfima(y = c(45.4, 3.25, 6.5, 2.15)) >> Coefficients: >> d >> 4.583013e-05 >> sigma[eps] = 18.01252 >> a list with components: >> [1] "log.likelihood" "n" "msg" "d" "ar" >> [6] "ma" "covariance.dpq" "fnormMin""sigma" "stderror.dpq" >> [11] "correlation.dpq" "h" "d.tol" "M" "hessian.dpq" >> [16] "length.w""residuals" "fitted" "call" "x" >> [21] "series" >> Please note that the index of LYGH has changed from 202 to 201 due to some randomness in one of my function. >> PLEASE HELP. >> Output of dput LYGH[[201]]: >> > dput(LYGH[[201]]) >> c(45.4, 3.25, 6.5, 2.149998) >> output of session info() >> sessionInfo() >> R version 4.1.2 (2021-11-01) >> Platform: x86_64-w64-mingw32/x64 (64-bit) >> Running under: Windows Server x64 (build 14393) >> Matrix products: default >> locale: >> [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 >> [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C >> [5] LC_TIME=English_United States.1252 >> attached base packages: >> [1] parallel stats graphics grDevices utils datasets methods base >> other attached packages: >> [1] pbmcapply_1.5.1 imputeTS_3.3forecast_8.17.0 >> loaded via a namespace (and not attached): >> [1] Rcpp_1.0.7urca_1.3-3pillar_1.9.0 compiler_4.1.2 tseries_0.10-51 >> [6] tools_4.1.2 xts_0.12.1nlme_3.1-153 lifecycle_1.0.3 tibble_3.2.1 >> [11] gtable_0.3.3 lattice_0.20-45 pkgconfig_2.0.3 rlang_1.1.0 cli_3.6.1 >> [16] rstudioapi_0.14 curl_4.3.2xml2_1.3.3dplyr_1.1.1 generics_0.1.3 >> [21] vctrs_0.6.1 gridtext_0.1.5ggtext_0.1.2 lmtest_0.9-40 grid_4.1.2 >> [26] nnet_7.3-16 tidyselect_1.2.0 glue_1.6.2R6_2.5.1 fansi_1.0.4 >> [31] ggplot2_3.4.2 TTR_0.24.3magrittr_2.0.3scales_1.2.1 quantmod_0.4.20 >> [36] timeDate_4021.106 colorspace_2.1-0 fracdiff_1.5-1 quadprog_1.5-8utf8_1.2.3 >> [41] stinepack_1.4 munsell_0.5.0 zoo_1.8-10 >> PLease Also note: >> arfima
Re: [R] error in arfima...
Dear Martin, Sad that the bug is beyond your ken... Fortunately, the error happens only rarely...The length of LYGH was 719 and there were only two such errors..I will just replace them with NA and make do. By the by, what if I send LYGH as an attachment to your actual mail ( not the r-help mail)? Will it help? Can you then pinpoint the cause? Or should I raise a bug report? If yes, how( I never raised one)? THanking you, Yours sincerely, AKSHAY M KULKARNI From: Martin Maechler Sent: Monday, June 5, 2023 3:19 PM To: akshay kulkarni Cc: Martin Maechler ; R help Mailing list Subject: Re: [R] error in arfima... > Dear Martin, > REgrets to reply this late > I am staring at a conundrum never before encountered in my experience with R: > LYGH[[201]] > [1] 45.40 3.25 6.50 2.15 > > arfima(LYGH[[201]]) > Error in .fdcov(x, fdf$d, h, nar = nar, nma = nma, hess = hess, fdf.work = > fdf$w) : > NA/NaN/Inf in foreign function call (arg 5) > > arfima(c(45.40,3.25,6.50,2.15)) > Call: > arfima(y = c(45.4, 3.25, 6.5, 2.15)) > Coefficients: >d > 4.583013e-05 > sigma[eps] = 18.01252 > a list with components: > [1] "log.likelihood" "n" "msg" "d" > "ar" > [6] "ma" "covariance.dpq" "fnormMin""sigma" > "stderror.dpq" > [11] "correlation.dpq" "h" "d.tol" "M" > "hessian.dpq" > [16] "length.w""residuals" "fitted" "call" > "x" > [21] "series" > Please note that the index of LYGH has changed from 202 to 201 due to some > randomness in one of my function. > PLEASE HELP. > Output of dput LYGH[[201]]: > > dput(LYGH[[201]]) > c(45.4, 3.25, 6.5, 2.149998) > output of session info() > sessionInfo() > R version 4.1.2 (2021-11-01) > Platform: x86_64-w64-mingw32/x64 (64-bit) > Matrix products: default > locale: > [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 > [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C > [5] LC_TIME=English_United States.1252 > attached base packages: > [1] parallel stats graphics grDevices utils datasets methods base > other attached packages: > [1] pbmcapply_1.5.1 imputeTS_3.3forecast_8.17.0 > loaded via a namespace (and not attached): > [1] Rcpp_1.0.7urca_1.3-3pillar_1.9.0 compiler_4.1.2 > tseries_0.10-51 > [6] tools_4.1.2 xts_0.12.1nlme_3.1-153 lifecycle_1.0.3 > tibble_3.2.1 > [11] gtable_0.3.3 lattice_0.20-45 pkgconfig_2.0.3 rlang_1.1.0 > cli_3.6.1 > [16] rstudioapi_0.14 curl_4.3.2xml2_1.3.3dplyr_1.1.1 > generics_0.1.3 > [21] vctrs_0.6.1 gridtext_0.1.5ggtext_0.1.2 lmtest_0.9-40 > grid_4.1.2 > [26] nnet_7.3-16 tidyselect_1.2.0 glue_1.6.2R6_2.5.1 > fansi_1.0.4 > [31] ggplot2_3.4.2 TTR_0.24.3magrittr_2.0.3scales_1.2.1 > quantmod_0.4.20 > [36] timeDate_4021.106 colorspace_2.1-0 fracdiff_1.5-1quadprog_1.5-8 > utf8_1.2.3 > [41] stinepack_1.4 munsell_0.5.0 zoo_1.8-10 > PLease Also note: > arfima(c(45.4, 3.25, 6.5, 2.149998)) > Call: > arfima(y = c(45.4, 3.25, 6.5, 2.149998)) > Coefficients: >d > 4.583013e-05 > sigma[eps] = 18.01252 > a list with components: > [1] "log.likelihood" "n" "msg" "d" > "ar" > [6] "ma" "covariance.dpq" "fnormMin""sigma" > "stderror.dpq" > [11] "correlation.dpq" "h" "d.tol" "M" > "hessian.dpq" > [16] "length.w""residuals" "fitted" "call" > "x" > [21] "series" > Many thanks in advance > Thanking you, > Yours sincerely, > AKSHAY M KULKARNI Hmm... indeed, "conundrum" may be a euphemism for the situation. which clearly points to a bug *somewhere*. As your dput() shows, the argument *is* a simple vector .. and even if the default dput() may loose a few bits in precison... you did show that with (possibly only almost) identical argument, the error did not happen. I really have no idea what's going on, So
Re: [R] error in arfima...
he difference. I think you should consider let your 'Windows Server' provider update R on that server. Notably the Windows version of R has had problems fixed in the mean time .. and at least there's a hope the problem disappears. Lastly (but probably not helping more), you could use dput() with control="digits" and even .Internal(inspect( * )) magic on your LYGH[[201]] When I use simple numeric vectors "like" your LYGH[..], I get > dput(c(45.4, 3.25, 6.5, 2.15), control="digits") c(45.399, 3.25, 6.5, 2.1499) > .Internal(inspect(c(45.4, 3.25, 6.5, 2.15)) + ) @9874728 14 REALSXP g0c3 [] (len=4, tl=0) 45.4,3.25,6.5,2.15 > Martin > > From: Martin Maechler > Sent: Thursday, June 1, 2023 1:28 PM > To: akshay kulkarni > Cc: R help Mailing list > Subject: Re: [R] error in arfima... > >>>>> akshay kulkarni > >>>>> on Wed, 31 May 2023 20:55:33 + writes: > > dear members, > > I am using arfima() from forecast package to model a time > > series. The following is the code: > >> LYGH[[202]] > > [1] 45.40 3.25 6.50 2.15 > >> arfima(LYGH[[202]]) > > Error in .fdcov(x, fdf$d, h, nar = nar, nma = nma, hess = hess, > fdf.work = fdf$w) : > > NA/NaN/Inf in foreign function call (arg 5) > > I tried viewing .fdcov() with the following code: > > View(environment(fracdiff)$.fdcov) > > but I see no stop() with the above mentioned error message. > > Can you please help? > Well, as I am the maintainer of the *fracdiff* package, > I'm trying. OTOH, as we will see below, you did not give us enough > information to really help you... > > THanking you, > > Yours sincerely, > > AKSHAY M KULKARNI > Your problem is not (yet) reproducible (*) > I've done the following in an "empty" (i.e. freshly started) R > session, R 4.3.0: > begin_R_transcript___save_as__arfima-ex.Rout__-- > > > > lN <- loadedNamespaces() > > library(forecast) > Registered S3 method overwritten by 'quantmod': > methodfrom > as.zoo.data.frame zoo > > options(width=75) > > setdiff(loadedNamespaces(), lN) # -- see all the *!^@...! forecast loads: > [1] "gtable" "dplyr" "tidyselect" "Rcpp" "parallel" > [6] "scales" "lattice""ggplot2""R6" "generics" > [11] "curl" "lmtest" "tibble" "munsell""nnet" > [16] "forecast" "timeDate" "pillar" "rlang" "quantmod" > [21] "utf8" "urca" "quadprog" "cli""magrittr" > [26] "xts""grid" "nlme" "lifecycle" "fracdiff" > [31] "vctrs" "glue" "tseries""zoo""fansi" > [36] "colorspace" "TTR""pkgconfig" > > arfima(c(45.40, 3.25, 6.50, 2.15)) > Call: > arfima(y = c(45.4, 3.25, 6.5, 2.15)) > Coefficients: >d > 4.583013e-05 > sigma[eps] = 18.01252 > a list with components: > [1] "log.likelihood" "n" "msg" > [4] "d" "ar" "ma" > [7] "covariance.dpq" "fnormMin""sigma" > [10] "stderror.dpq""correlation.dpq" "h" > [13] "d.tol" "M" "hessian.dpq" > [16] "length.w""residuals" "fitted" > [19] "call""x" "series" > > > > sessionInfo() > R version 4.3.0 (2023-04-21) > Platform: x86_64-pc-linux-gnu (64-bit) > Running under: Fedora Linux 36 (Thirty Six) > Matrix products: default > BLAS: /usr/local64.sfs/app/R/R-4.3.0-inst/lib/libRblas.so > LAPACK: /usr/lib64/liblapack.so.3.10.1 > locale: > [1] LC_CTYPE=de_CH.UTF-8 LC_NUMERIC=C > [3] LC_TIME=en_US.UTF-8LC_COLLATE=de_CH.UTF-8 > [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=de_CH.UTF-8 > [7] LC_PAPER=de_CH.UTF-8 LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=de_CH.UTF-8 LC_IDENTIFICATION=C > time zone: Europe/Zurich > tzcode source: system (glibc) > attached base packages: >
Re: [R] error in arfima...
Dear Martin, REgrets to reply this late I am staring at a conundrum never before encountered in my experience with R: LYGH[[201]] [1] 45.40 3.25 6.50 2.15 > arfima(LYGH[[201]]) Error in .fdcov(x, fdf$d, h, nar = nar, nma = nma, hess = hess, fdf.work = fdf$w) : NA/NaN/Inf in foreign function call (arg 5) > arfima(c(45.40,3.25,6.50,2.15)) Call: arfima(y = c(45.4, 3.25, 6.5, 2.15)) Coefficients: d 4.583013e-05 sigma[eps] = 18.01252 a list with components: [1] "log.likelihood" "n" "msg" "d" "ar" [6] "ma" "covariance.dpq" "fnormMin""sigma" "stderror.dpq" [11] "correlation.dpq" "h" "d.tol" "M" "hessian.dpq" [16] "length.w""residuals" "fitted" "call""x" [21] "series" Please note that the index of LYGH has changed from 202 to 201 due to some randomness in one of my function. PLEASE HELP. Output of dput LYGH[[201]]: > dput(LYGH[[201]]) c(45.4, 3.25, 6.5, 2.149998) output of session info() sessionInfo() R version 4.1.2 (2021-11-01) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows Server x64 (build 14393) Matrix products: default locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] parallel stats graphics grDevices utils datasets methods base other attached packages: [1] pbmcapply_1.5.1 imputeTS_3.3forecast_8.17.0 loaded via a namespace (and not attached): [1] Rcpp_1.0.7urca_1.3-3pillar_1.9.0 compiler_4.1.2 tseries_0.10-51 [6] tools_4.1.2 xts_0.12.1nlme_3.1-153 lifecycle_1.0.3 tibble_3.2.1 [11] gtable_0.3.3 lattice_0.20-45 pkgconfig_2.0.3 rlang_1.1.0 cli_3.6.1 [16] rstudioapi_0.14 curl_4.3.2xml2_1.3.3dplyr_1.1.1 generics_0.1.3 [21] vctrs_0.6.1 gridtext_0.1.5ggtext_0.1.2 lmtest_0.9-40 grid_4.1.2 [26] nnet_7.3-16 tidyselect_1.2.0 glue_1.6.2R6_2.5.1 fansi_1.0.4 [31] ggplot2_3.4.2 TTR_0.24.3magrittr_2.0.3scales_1.2.1 quantmod_0.4.20 [36] timeDate_4021.106 colorspace_2.1-0 fracdiff_1.5-1quadprog_1.5-8 utf8_1.2.3 [41] stinepack_1.4 munsell_0.5.0 zoo_1.8-10 PLease Also note: arfima(c(45.4, 3.25, 6.5, 2.149998)) Call: arfima(y = c(45.4, 3.25, 6.5, 2.149998)) Coefficients: d 4.583013e-05 sigma[eps] = 18.01252 a list with components: [1] "log.likelihood" "n" "msg" "d" "ar" [6] "ma" "covariance.dpq" "fnormMin""sigma" "stderror.dpq" [11] "correlation.dpq" "h" "d.tol" "M" "hessian.dpq" [16] "length.w""residuals" "fitted" "call""x" [21] "series" Many thanks in advance Thanking you, Yours sincerely, AKSHAY M KULKARNI From: Martin Maechler Sent: Thursday, June 1, 2023 1:28 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] error in arfima... >>>>> akshay kulkarni >>>>> on Wed, 31 May 2023 20:55:33 + writes: > dear members, > I am using arfima() from forecast package to model a time > series. The following is the code: >> LYGH[[202]] > [1] 45.40 3.25 6.50 2.15 >> arfima(LYGH[[202]]) > Error in .fdcov(x, fdf$d, h, nar = nar, nma = nma, hess = hess, fdf.work = fdf$w) : > NA/NaN/Inf in foreign function call (arg 5) > I tried viewing .fdcov() with the following code: > View(environment(fracdiff)$.fdcov) > but I see no stop() with the above mentioned error message. > Can you please help? Well, as I am the maintainer of the *fracdiff* package, I'm trying. OTOH, as we will see below, you did not give us enough information to really help you... > THanking you, > Yours sincerely, > AKSHAY M KULKARNI Your problem is not (yet) reproducible (*) I've done the following in an "empty" (i.e. freshly started) R session, R 4.3.0: begin_R_transcript___save_as__arfima-ex.Rout__-- > > lN <- loadedNamespaces() > library(forecast) Registered S3 method overwritten by 'quantmod': method
Re: [R] error in arfima...
> akshay kulkarni > on Wed, 31 May 2023 20:55:33 + writes: > dear members, > I am using arfima() from forecast package to model a time > series. The following is the code: >> LYGH[[202]] > [1] 45.40 3.25 6.50 2.15 >> arfima(LYGH[[202]]) > Error in .fdcov(x, fdf$d, h, nar = nar, nma = nma, hess = hess, fdf.work = fdf$w) : > NA/NaN/Inf in foreign function call (arg 5) > I tried viewing .fdcov() with the following code: > View(environment(fracdiff)$.fdcov) > but I see no stop() with the above mentioned error message. > Can you please help? Well, as I am the maintainer of the *fracdiff* package, I'm trying. OTOH, as we will see below, you did not give us enough information to really help you... > THanking you, > Yours sincerely, > AKSHAY M KULKARNI Your problem is not (yet) reproducible (*) I've done the following in an "empty" (i.e. freshly started) R session, R 4.3.0: begin_R_transcript___save_as__arfima-ex.Rout__-- > > lN <- loadedNamespaces() > library(forecast) Registered S3 method overwritten by 'quantmod': methodfrom as.zoo.data.frame zoo > options(width=75) > setdiff(loadedNamespaces(), lN) # -- see all the *!^@...! forecast loads: [1] "gtable" "dplyr" "tidyselect" "Rcpp" "parallel" [6] "scales" "lattice""ggplot2""R6" "generics" [11] "curl" "lmtest" "tibble" "munsell""nnet" [16] "forecast" "timeDate" "pillar" "rlang" "quantmod" [21] "utf8" "urca" "quadprog" "cli""magrittr" [26] "xts""grid" "nlme" "lifecycle" "fracdiff" [31] "vctrs" "glue" "tseries""zoo""fansi" [36] "colorspace" "TTR""pkgconfig" > arfima(c(45.40, 3.25, 6.50, 2.15)) Call: arfima(y = c(45.4, 3.25, 6.5, 2.15)) Coefficients: d 4.583013e-05 sigma[eps] = 18.01252 a list with components: [1] "log.likelihood" "n" "msg" [4] "d" "ar" "ma" [7] "covariance.dpq" "fnormMin""sigma" [10] "stderror.dpq""correlation.dpq" "h" [13] "d.tol" "M" "hessian.dpq" [16] "length.w""residuals" "fitted" [19] "call""x" "series" > > sessionInfo() R version 4.3.0 (2023-04-21) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Fedora Linux 36 (Thirty Six) Matrix products: default BLAS: /usr/local64.sfs/app/R/R-4.3.0-inst/lib/libRblas.so LAPACK: /usr/lib64/liblapack.so.3.10.1 locale: [1] LC_CTYPE=de_CH.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=de_CH.UTF-8 [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=de_CH.UTF-8 [7] LC_PAPER=de_CH.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=de_CH.UTF-8 LC_IDENTIFICATION=C time zone: Europe/Zurich tzcode source: system (glibc) attached base packages: [1] graphics grDevices datasets stats utils methods base other attached packages: [1] forecast_8.21 fortunes_1.5-4 sfsmisc_1.1-15 loaded via a namespace (and not attached): [1] gtable_0.3.3 dplyr_1.1.2 compiler_4.3.0 [4] tidyselect_1.2.0 Rcpp_1.0.10 parallel_4.3.0 [7] scales_1.2.1 lattice_0.21-8ggplot2_3.4.2 [10] R6_2.5.1 generics_0.1.3curl_5.0.0 [13] lmtest_0.9-40 tibble_3.2.1 munsell_0.5.0 [16] nnet_7.3-19 timeDate_4022.108 pillar_1.9.0 [19] rlang_1.1.1 quantmod_0.4.22 utf8_1.2.3 [22] urca_1.3-3quadprog_1.5-8cli_3.6.1 [25] magrittr_2.0.3xts_0.13.1grid_4.3.0 [28] nlme_3.1-162 lifecycle_1.0.3 fracdiff_1.5-2 [31] vctrs_0.6.2 glue_1.6.2tseries_0.10-54 [34] zoo_1.8-12fansi_1.0.4 colorspace_2.1-0 [37] TTR_0.24.3tools_4.3.0 pkgconfig_2.0.3 > ##---end__R_transcript--- Note that your error message pointed me to my (old, but still fine) package {fracdiff} with its principal function fracdiff() around which arfima() is a user-friendly and generalization wrapper. In other words arfima() calls fracdiff::fracdiff() and the error happens there --- for you, but not for me, if I try to use the same data as you. I see that you must have found that too, because you mentioned View(environment(fracdiff)$.fdcov) Maybe you need to update.packages() {which should re-install R packages you have installed but which have become outdated in the mean time} If the error persists, please send us the output of 1) dput(LYGH[[202]]) so we get your exact data 2) sessionInfo() so we get much info about your R "setup" last but not least: If you are really calling ar
[R] error in arfima...
dear members, I am using arfima() from forecast package to model a time series. The following is the code: > LYGH[[202]] [1] 45.40 3.25 6.50 2.15 > arfima(LYGH[[202]]) Error in .fdcov(x, fdf$d, h, nar = nar, nma = nma, hess = hess, fdf.work = fdf$w) : NA/NaN/Inf in foreign function call (arg 5) I tried viewing .fdcov() with the following code: View(environment(fracdiff)$.fdcov) but I see no stop() with the above mentioned error message. Can you please help? THanking you, Yours sincerely, AKSHAY M KULKARNI [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.