Function to apply a transformation to the samples from the output of an XDNUTS model.
Function to apply a transformation to the samples from the output of an XDNUTS model.
xdtransform( X, FUN =NULL,..., which =NULL, which_chains =NULL, new.names =NULL, thin =NULL, burn =NULL)
Arguments
X: an object of class XDNUTS.
FUN: a function object which takes one or more components of an MCMC iteration and any other possible arguments.
...: optional arguments for FUN.
which: a vector of indices indicating which parameter the transformation should be applied to. If NULL, the function is applied to all of them.
which_chains: a numerical vector indicating the index of the chains of interest.
new.names: a character vector containing the parameter names in the new parameterization. If only one value is provided, but the transformation involves more, the name is iterated with an increasing index.
thin: an integer value indicating how many samples should be discarded before returning an iteration of the chain.
burn: an integer value indicating how many initial samples for each chain to discard.
Returns
an object of class XDNUTS with the specified transformation applied to each chain.