Open FBartos opened 3 years ago
I already checked that the A) issue can be fixed by changing
samples <- samples[, -last_sim]
into
samples <- samples[, -last_sim, drop = FALSE]
on line 411 in bridge_sampler.R
. I didn't add a PR because I'm not sure that the column removal is supposed to be there given the B) issue
Hi, I encountered a few issues when trying to supply simplex type parameters to bridgesampling, mostly due to R converting column matrices to vectors.
A) passing a 2 column matrix with simplex leads to transformation into a vector when omiting the last column in
samples <- samples[, -last_sim]
and error in.transform2Real
when trying to callncol()
on supposed to be a matrix, now a vectortheta
(passed assamples
) down the line:transTypes <- character(ncol(theta))
code for reproducing the bug
B) passing a 2 parameter simplex in general (e.g., adding another parameter to the previous example) crashes the code a bit further down the line in
.transform2Real
becausecs
has [parameters, samples] instead of [samples, parameters] dimensions in this case, crashing onz_k <- (simplex_theta / (1L - cs))
I'm actually a bit confused by the purpose of these lines here:
because the simplex parameters are already passed without the last one, thus they do not sum to one. Because the last parameter has been already removed previously in
bridge_sampler.matrix:
code for reproducing the bug: