2N+2 parameter inference: sampling all parameters as one?

Can you provide the functions f,g,h or even better a full sample code with simulated data