Skip to content

error in multiSiena: multi_siena function #149

Description

@xingnaqin18-sys

Describe the bug

multi_siena() fails at the first MCMC cycle with
Error in FUN(newX[, i], ...) :
R_ExternalPtrAddr: argument of type NILSXP is not an external pointer

The failure occurs inside maxlikec, where doMLModel dereferences the external pointers to the C++ data and model objects. At least one of them is NULL at that point.

Initialization appears to complete normally — the error only appears once MCMCcycle calls z$FRAN.

The error reproduces with the example code in the ?multi_siena help page, unmodified. It is therefore not specific to my data, effects object, or algorithm settings.

To Reproduce

library(multiSiena) (this also loads RSiena)
Run the example from the ?multi_siena help page, unchanged
See error

traceback()
5: FUN(newX[, i], ...)
4: apply(cbind(callGrid, 1:nrow(callGrid)), 1, doMLModel, z$Deriv,
z$thetaMat, z$nrunMH, z$addChainToStore, z$returnDataFrame,
z$returnDeps, z$returnChains, byGroup, z$theta, returnLoglik,
onlyLoglik)
3: z$FRAN(zsmall, byGroup = TRUE, returnLoglik = FALSE)
2: MCMCcycle(nrunMH = nrunMHBatches, nSampVar = nSampVarying, nSampCons = nSampConst,
nSampRate = nSampRates, bgain = bgain)
1: multi_siena(...)

The same error occurs with my own data.
Things already ruled out

Not a maxlike setting problem. The error occurs identically with set_algorithm_saom(maxlike = TRUE, ...) and with the default maxlike = FALSE.
Not a clustering problem. Occurs with nbrNodes = 1, and also with nbrNodes = 9 (where it surfaces as 9 nodes produced errors; first error: argument of length 0).
Not a namespace split between RSiena and multiSiena. environmentName(environment(multiSiena:::maxlikec)) returns "multiSiena", and after the error both multiSiena:::FRANstore() and RSiena:::FRANstore() return NULL for pData and pModel — not one populated and one empty.
Not data-specific, since the help-page example reproduces it.

Rstudio version: ‘2026.8.2.200’
R version 4.6.1 (2026-06-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)
Matrix products: default
LAPACK version 3.12.1
other attached packages:
[1] multiSiena_1.2.38 RSiena_1.6.11

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions