Thanks Jeremy.
I interpret what you are saying as wanting a custom distribution for the triplet (mu, sigma, xi) that you have derived from independent distributions for (q1, q2, q3) along with the function relating the two triplets.
Here are two ways you could implement that in NIMBLE, both using user-defined distributions.
Method 1: Define (mu, sigma, xi) as a vector of three parameters, say theta[1:3]. Use
theta[1:3] ~ dMyCustomDistribution(parameters of the distributions of q1, q2, q3)
Then in dMyCustomDistribution, you can write the full pdf of theta[1:3], which will include pieces from the distributions of (q1, q2, q3) as well as the Jacobian, as you have derived. In this method, the distributions for (q1, q2, q3) would not appear in the model code. They would simply appear in dMyCustomDistribution.
Method 2: You could define a dummy data node, whose value need not even matter, in order to build an additional log density term into the graph. That term would be the Jacobian need you. This would look like the following
q1 ~ dgamma( ... )
q2 ~ dgamma( ...)
q3 ~ dgamma( ...)
dummy ~ dMyJacobian(q1, q2, q3, parameters of q1, q2, q3)
Now there will be a node "dummy" in the graph, with parent nodes q1, q2, q3 as well as their parameters. If you write dMyJacobian (again, following our User Manual on how to write your own distribution) to return the log Jacobian term you need, it will be added into the likelihood. For example, let's say you have a "RW" (adaptive random-walk Metropolis-Hastings) sampler on a parameter "alpha" of q1. The stochastic dependencies of alpha will include q1 and dummy. That means that the sum of log probabilities used in the Metropolis-Hastings acceptance ratio will include a term from dgamma for q1 and a term for dummy that provides the Jacobian. When you write dMyJacobian, its first argument will be a deviate "x", which will be passed as "dummy", but you need not use it in the calculation. Other samplers or algorithms should work too, because the graph defined by these declarations include the pieces you need.
Let me know if that gives you enough to move forward or if that was too rough an explanation.
-Perry