sampler.LeafVarianceModel
sampler.LeafVarianceModel()
Wrapper around methods / functions for sampling a “leaf scale” model for the variance term of a Gaussian leaf model with inverse gamma prior.
Methods
| sample_one_iteration |
Sample one iteration of a forest leaf model’s variance parameter (assuming a location-scale leaf model, most commonly N(0, tau)) |
sample_one_iteration
sampler.LeafVarianceModel.sample_one_iteration(forest, rng, a, b)
Sample one iteration of a forest leaf model’s variance parameter (assuming a location-scale leaf model, most commonly N(0, tau))
Parameters
| forest |
Forest |
stochtree object storing the “active” forest being sampled |
required |
| rng |
RNG |
stochtree object storing C++ random number generator to be used sampling algorithm |
required |
| a |
float |
Shape parameter for the inverse gamma leaf scale model |
required |
| b |
float |
Scale parameter for the inverse gamma leaf scale model |
required |
Returns
|
float |
One draw from a Gibbs sampler for the leaf scale model, which depends on the rest of the model only through its respective forest. |