Sampler for ordinal model hyperparameters.
More...
#include <ordinal_sampler.h>
|
| 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:
- Truncated exponential latent variables (Z)
- Cutpoint parameters (gamma)
- Cumulative sum of exp(gamma) (seg) [derived parameter]
◆ SampleTruncatedExponential()
| static double StochTree::OrdinalSampler::SampleTruncatedExponential |
( |
std::mt19937 & |
gen, |
|
|
double |
rate, |
|
|
double |
low = 0.0, |
|
|
double |
high = 1.0 |
|
) |
| |
|
static |
Sample from truncated exponential distribution.
Samples from exponential distribution truncated to [low,high]
- Parameters
-
| gen | Random number generator |
| rate | Rate parameter for exponential distribution |
| low | Lower truncation bound |
| high | Upper truncation bound |
- Returns
- Sampled value from truncated exponential
◆ UpdateLatentVariables()
| void StochTree::OrdinalSampler::UpdateLatentVariables |
( |
ForestDataset & |
dataset, |
|
|
Eigen::VectorXd & |
outcome, |
|
|
std::mt19937 & |
gen |
|
) |
| |
Update truncated exponential latent variables (Z)
- Parameters
-
| dataset | Forest dataset containing training data (covariates) and auxiliary data needed for sampling |
| outcome | Vector of outcome values |
| gen | Random number generator |
◆ UpdateGammaParams()
| 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.
- 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 |
◆ UpdateCumulativeExpSums()
| void StochTree::OrdinalSampler::UpdateCumulativeExpSums |
( |
ForestDataset & |
dataset | ) |
|
Update cumulative exponential sums (seg)
- Parameters
-
| dataset | Forest dataset containing training data (covariates) and auxiliary data needed for sampling |
The documentation for this class was generated from the following file: