|
StochTree 0.5.0.9000
|
Sampler for ordinal model hyperparameters. More...
#include <ordinal_sampler.h>
Public Member Functions | |
| void | UpdateLatentVariables (ForestDataset &dataset, Eigen::VectorXd &outcome, std::mt19937 &gen) |
| Update truncated exponential latent variables (Z) | |
| void | UpdateGammaParams (ForestDataset &dataset, Eigen::VectorXd &outcome, double alpha_gamma, double beta_gamma, double gamma_0, std::mt19937 &gen) |
| Update gamma cutpoint parameters. | |
| void | UpdateCumulativeExpSums (ForestDataset &dataset) |
| Update cumulative exponential sums (seg) | |
Static Public Member Functions | |
| static double | SampleTruncatedExponential (std::mt19937 &gen, double rate, double low=0.0, double high=1.0) |
| Sample from truncated exponential distribution. | |
Sampler for ordinal model hyperparameters.
This class handles MCMC sampling for ordinal-specific parameters:
|
static |
Sample from truncated exponential distribution.
Samples from exponential distribution truncated to [low,high]
| gen | Random number generator |
| rate | Rate parameter for exponential distribution |
| low | Lower truncation bound |
| high | Upper truncation bound |
| void StochTree::OrdinalSampler::UpdateLatentVariables | ( | ForestDataset & | dataset, |
| Eigen::VectorXd & | outcome, | ||
| std::mt19937 & | gen | ||
| ) |
Update truncated exponential latent variables (Z)
| dataset | Forest dataset containing training data (covariates) and auxiliary data needed for sampling |
| outcome | Vector of outcome values |
| gen | Random number generator |
| void StochTree::OrdinalSampler::UpdateGammaParams | ( | ForestDataset & | dataset, |
| Eigen::VectorXd & | outcome, | ||
| double | alpha_gamma, | ||
| double | beta_gamma, | ||
| double | gamma_0, | ||
| std::mt19937 & | gen | ||
| ) |
Update gamma cutpoint parameters.
| dataset | Forest dataset containing training data (covariates) and auxiliary data needed for sampling |
| outcome | Vector of outcome values |
| alpha_gamma | Shape parameter for log-gamma prior on cutpoints gamma |
| beta_gamma | Rate parameter for log-gamma prior on cutpoints gamma |
| gamma_0 | Fixed value for first cutpoint parameter (for identifiability) |
| gen | Random number generator |
| void StochTree::OrdinalSampler::UpdateCumulativeExpSums | ( | ForestDataset & | dataset | ) |
Update cumulative exponential sums (seg)
| dataset | Forest dataset containing training data (covariates) and auxiliary data needed for sampling |