inconsistency in pbmclapply/mclapply....

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

inconsistency in pbmclapply/mclapply....

akshay kulkarni
dear members,
                              I am using pbmclapply in pbmcapply package, to do parallel processing in my R function. Below is the line that is malfunctioning:

> LYG1b <- pbmclapply(lygh171, FUN = auto.arima, mc.cores = detectCores())

auto.arima is a function from the "forecast" package. The length of lygh171 is 2435.

NOW:

> LYG1b[[1]]
[1] "Error in ts(x) : 'ts' object must have one or more observations\n"
attr(,"class")
[1] "try-error"
attr(,"condition")
<simpleError in ts(x): 'ts' object must have one or more observations>

AND:

> auto.arima(lygh171[[1]])
Series: lygh171[[1]]
ARIMA(0,1,0)

sigma^2 estimated as 2.303:  log likelihood=-66.1
AIC=134.2   AICc=134.31   BIC=135.78

AND:

> LYG1ba <- pbmclapply(lygh171[1:9], FUN = auto.arima, mc.cores = detectCores())

> LYG1ba[[1]]
Series: X[[i]]
ARIMA(0,1,0)

sigma^2 estimated as 2.303:  log likelihood=-66.1
AIC=134.2   AICc=134.31   BIC=135.78

Why is LYG1b[[1]] not welldefined  but  LYG1ba[[1]] is eventhough the function(auto.arima) is the same in both cases? And why is the direct application of auto.arima on lygh171[[1]] successful, but not when auto.arima is iterated through pbmclapply on lygh171?
 here is the output of dput:
lygh171[1:9] <-  list(c(0.699999999999999, 0.399999999999999, 0.300000000000001,
0.149999999999999, 0.25, 0.949999999999999, 1, 0.300000000000001,
0.65, 0.199999999999999, 0.6, 0.0999999999999996, 0.00141287284144427,
1.55, 0.15, 0.300000000000001, 0.449999999999999, 0.350000000000001,
0.149999999999999, 2.35, 0.25, 0.100000000000001, 3.7, 3.95,
3.05, 0.899999999999999, 0.399999999999999, 1.05, 1.1, 1.95,
2, 0.649999999999999, 0.699999999999999, 0.25, 5.25, 0.800000000000001,
0.00141287284144427), c(0, 0.199999999999999, 1.3, 2, 1.9, 1.6
), c(0.699999999999999, 0.399999999999999, 0.300000000000001,
0.149999999999999, 0.25, 1, 0.300000000000001, 0.65, 0.199999999999999,
0.0999999999999996, 0.300000000000001, 0.15, 0.25, 0.15, 0.300000000000001,
0.449999999999999, 0.800000000000001, 0.25, 0.350000000000001,
0.149999999999999, 2.35, 0.25, 0.100000000000001, 3.7, 3.95,
3.05, 0.899999999999999, 0.399999999999999, 1.05, 1.1, 1.95,
2, 0.649999999999999, 0.699999999999999, 0.25, 5.25, 0.800000000000001,
0.699999999999999, 0.449999999999999, 0.800000000000001, 0.800000000000001
), c(0.0500000000000007, 0.25, 0.100000000000001, 1.25, 1, 0.65,
0.65, 0.9, 0.4, 0.0500000000000007, 0.0500000000000007, 0.450000000000001,
1.2, 0.5, 0.15, 0.35, 0.0500000000000007, 0.300000000000001,
1.1, 0.0999999999999996, 0.950000000000001, 0.25, 0.75, 0.199999999999999,
0.5, 0.5, 0.25, 2, 0.699999999999999, 2.75, 1.65, 0.149999999999999,
0.200000000000003, 2, 1.25, 4.3, 0.600000000000001, 0.75, 0.549999999999997,
0.5, 3.6, 4.1, 0.899999999999999, 0.100000000000001, 1, 0.25,
0.100000000000001, 0.399999999999999, 0.149999999999999, 1.7,
0.949999999999999, 0.150000000000002), c(0.0500000000000007,
0.25, 0.15, 0.0999999999999996, 0.5, 0.15, 0.600000000000001,
1, 0.149999999999999, 0.600000000000001, 3.05, 0.100000000000001,
0.199999999999999, 1.3), c(0.5, 0.5, 0.0999999999999996, 1.2,
3.75, 1.9), c(0.000770416024653313, 0.550000000000001, 1.2, 3
), 1, 0.25)

very many thanks for your time and effort....
yours sincerely,

AKSHAY M KULKARNI

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.