I am trying to define a function ‘bart_rng’ in STAN that can generate samples from Bayesian Additive Regression Trees (BART) prior and a function ‘dbart’ that gives me probability density at a point given the parameters of BART. Does Stan have any in-built functions or can you help me in building one?