Changelog
Source:NEWS.md
coconots 2.0.5
-
installJuliaPackages()installs or updates Coconots.jl to version 0.2 or newer (an existing 0.1.x installation was previously kept).
Bug fixes
-
cocoReg(julia = TRUE)without covariates passed a user-suppliedstartto Julia in R order (lambdafirst) although the Julia backend expectslambdalast.startis now reordered before the call. Thestartdocumentation states the expected order. -
cocoSim()with covariates takeslambda_tfrom rowtofxreg(previously rowt - order); GP2 start values account foreta. -
cocoPit()evaluates the PIT overt = order + 1, ..., Ton both backends, uses the upper-tail chi-square p-value, and draws the confidence bands at the levelconf.alpha(order 1 previously used the modelalpha). - Densities, the order-2 normalizer
P(y, z)and the order-1 thinning term return the exact limits at zero rates and atalpha = 0andalpha = 1instead of0 * Inf = NaN. - Inverse-transform samplers terminate at the count limit 170.
- Input checks: counts above 170 (factorial overflow), rank-deficient
xreg, series too short for the model order, andlambda_t <= 0now raise informative errors.
Performance
- The default RCPP fit uses L-BFGS-B with gradient and Hessian from C++ forward-mode automatic differentiation and an optimality check (KKT conditions, positive definite reduced Hessian, Newton decrement);
constrOptimNelder-Mead with a polishing step remains the fallback. Starting values for covariate coefficients come from a Poisson GLM. - Faster likelihoods (sized pmf tables, recurrences, factored order-2 convolution),
cocoBoot(),cocoSim()with covariates andpredict(k > 1)(all replicates or paths in one C++ call),cocoScore()andcocoResid()(one pmf per distinct history), and fewer R-Julia round trips incocoReg(julia = TRUE)andcocoScore(julia = TRUE).
coconots 2.0.4
CRAN release: 2026-08-23
Bug fixes
- Fixed a heap buffer over-read reported by CRAN’s valgrind check. The post-hoc log-likelihood for Poisson models with covariates reused the Generalized-Poisson parameter slicing, which drops
eta. Poisson models carry noeta, so the slicing also discarded the first covariate coefficient and passed a coefficient vector one element shorter than the number of covariate columns tolikelihoodGP1cov()/likelihoodGP2cov(), which then read onedoublepast the end of that vector on every observation. The stored$likelihood(and hence AIC/BIC) was wrong for these models; parameter estimates and standard errors were unaffected. -
likelihoodGP2cov()clamped an underflowing per-observation likelihood to1/10^-12 = 1e+12, rewarding the optimizer for entering the degenerate region. It now clamps to1e-12. - The order-2 starting-value shrink loops assigned to a dead variable, so
alpha3never shrank and the loop could fail to terminate. -
cocoReg()with adata.framexregoverwrotedatainstead of coercingxreg. -
cocoSoc()now forwards itsjuliaargument to the internalcocoReg()fits and tococoScore(), instead of hardcodingjulia = TRUEwhen scoring. - Julia result dictionaries are now read by key name rather than by integer position, which depended on Julia’s hash iteration order and could shift silently across Julia versions.
Performance
-
cocoReg()gained a livecoresargument. The order-2 likelihood kernels of the RCPP backend are multithreaded viastd::thread; accumulation stays serial in the original order, so results are bit-identical for any thread count.coresdefaults to the number of physical cores minus one, capped at 2 while_R_CHECK_LIMIT_CORES_is set. - Estimation kernels and the assessment tools (
cocoScore(),cocoPit(),cocoResid(),cocoBoot(),rgenpois()) were rewritten around batched density evaluations, lookup tables and memoization. Numerical results are unchanged (order-1 paths exactly, order-2 paths to ~1 ulp). -
JULIA_NUM_THREADSis now set to the number of physical cores minus one before the firstJuliaConnectoRcall, unless the user already set it. A Julia process otherwise starts single-threaded, leavingCoconots.jl’s threaded likelihood idle.
coconots 2.0.3
CRAN release: 2026-06-14
- Added a
softpluslink function for the conditional mean of the innovation rate incocoReg()(covariate models). Uses a numerically stable formulation, is smooth everywhere, and guarantees a positive rate. - Added S3
summarymethods for forecast objects (cocoForecast,cocoForecastCollection) returning a data frame of point forecasts (mean, median, mode) and prediction intervals per forecast horizon.