Skip to content

Commit 9428db5

Browse files
committed
Updated some R and C++ docs
1 parent 68faca8 commit 9428db5

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

R_README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Software for building stochastic tree ensembles (i.e. BART, XBART) for supervise
77
`stochtree` can be installed from CRAN via
88

99
```
10-
install.package("stochtree")
10+
install.packages("stochtree")
1111
```
1212

1313
The development version of stochtree can be installed from github via

include/stochtree/leaf_model.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ namespace StochTree {
7373
* We assign each leaf node parameter a prior
7474
*
7575
* \f[
76-
* \mu \sim \mathcal{N}\left(0, \tau\right)
76+
* \mu \sim N\left(0, \tau\right)
7777
* \f]
7878
*
79-
* Assuming a homoskedastic Gaussian outcome likelihood (i.e. \f$y_i \sim \mathcal{N}\left(f(X_i),\sigma^2\right)\f$),
79+
* Assuming a homoskedastic Gaussian outcome likelihood (i.e. \f$y_i \sim N\left(f(X_i),\sigma^2\right)\f$),
8080
* the log marginal likelihood in this model, for the outcome data in node \f$\ell\f$ of tree \f$j\f$ is given by
8181
*
8282
* \f[
@@ -106,14 +106,14 @@ namespace StochTree {
106106
* node \f$\ell\f$'s leaf parameter is similarly defined as:
107107
*
108108
* \f[
109-
* \mu_{\ell} \mid - \sim \mathcal{N}\left(\frac{\tau s_{y,\ell}}{n_{\ell} \tau + \sigma^2}, \frac{\tau \sigma^2}{n_{\ell} \tau + \sigma^2}\right)
109+
* \mu_{\ell} \mid - \sim N\left(\frac{\tau s_{y,\ell}}{n_{\ell} \tau + \sigma^2}, \frac{\tau \sigma^2}{n_{\ell} \tau + \sigma^2}\right)
110110
* \f]
111111
*
112112
* Now, consider the possibility that each observation carries a unique weight \f$w_i\f$. These could be "case weights" in a survey context or
113113
* individual-level variances ("heteroskedasticity"). These case weights transform the outcome distribution (and associated likelihood) to
114114
*
115115
* \f[
116-
* y_i \mid - \sim \mathcal{N}\left(\mu(X_i), \frac{\sigma^2}{w_i}\right)
116+
* y_i \mid - \sim N\left(\mu(X_i), \frac{\sigma^2}{w_i}\right)
117117
* \f]
118118
*
119119
* This gives a modified log marginal likelihood of
@@ -185,13 +185,13 @@ namespace StochTree {
185185
* and we assign \f$\beta_{\ell}\f$ a prior of
186186
*
187187
* \f[
188-
* \vec{\beta_{\ell}} \sim \mathcal{N}\left(\vec{\beta_0}, \Sigma_0\right)
188+
* \vec{\beta_{\ell}} \sim N\left(\vec{\beta_0}, \Sigma_0\right)
189189
* \f]
190190
*
191191
* where \f$\vec{\beta_0}\f$ is typically a vector of zeros. The outcome likelihood is still
192192
*
193193
* \f[
194-
* y_i \sim \mathcal{N}\left(f(X_i), \sigma^2\right)
194+
* y_i \sim N\left(f(X_i), \sigma^2\right)
195195
* \f]
196196
*
197197
* This gives a reduced log integrated likelihood of
@@ -203,7 +203,7 @@ namespace StochTree {
203203
* where \f$\Omega\f$ is a matrix of bases for every observation in leaf \f$\ell\f$ and \f$p\f$ is the dimension of \f$\Omega\f$. The posterior for \f$\vec{\beta_{\ell}}\f$ is
204204
*
205205
* \f[
206-
* \vec{\beta_{\ell}} \sim \mathcal{N}\left(\left(\Sigma_0^{-1} + \frac{\Omega'\Omega}{\sigma^2}\right)^{-1}\left(\frac{\Omega'y}{\sigma^2}\right),\left(\Sigma_0^{-1} + \frac{\Omega'\Omega}{\sigma^2}\right)^{-1}\right)
206+
* \vec{\beta_{\ell}} \sim N\left(\left(\Sigma_0^{-1} + \frac{\Omega'\Omega}{\sigma^2}\right)^{-1}\left(\frac{\Omega'y}{\sigma^2}\right),\left(\Sigma_0^{-1} + \frac{\Omega'\Omega}{\sigma^2}\right)^{-1}\right)
207207
* \f]
208208
*
209209
* This is an extension of the single-tree model of <a href="https://link.springer.com/article/10.1023/A:1013916107446">Chipman et al (2002)</a>, with:
@@ -226,7 +226,7 @@ namespace StochTree {
226226
* and a posterior for \f$\vec{\beta_{\ell}}\f$ of
227227
*
228228
* \f[
229-
* \vec{\beta_{\ell}} \sim \mathcal{N}\left(\left(\Sigma_{0}^{-1} + \Omega'\Sigma_{y}^{-1}\Omega\right)^{-1}\left(\Omega'\Sigma_{y}^{-1}y\right),\left(\Sigma_{0}^{-1} + \Omega'\Sigma_{y}^{-1}\Omega\right)^{-1}\right)
229+
* \vec{\beta_{\ell}} \sim N\left(\left(\Sigma_{0}^{-1} + \Omega'\Sigma_{y}^{-1}\Omega\right)^{-1}\left(\Omega'\Sigma_{y}^{-1}y\right),\left(\Sigma_{0}^{-1} + \Omega'\Sigma_{y}^{-1}\Omega\right)^{-1}\right)
230230
* \f]
231231
*
232232
* \section gaussian_univariate_regression_leaf_model Gaussian Univariate Regression Leaf Model
@@ -236,7 +236,7 @@ namespace StochTree {
236236
* parameter becomes univariate normal as in \ref gaussian_constant_leaf_model:
237237
*
238238
* \f[
239-
* \beta \sim \mathcal{N}\left(0, \tau\right)
239+
* \beta \sim N\left(0, \tau\right)
240240
* \f]
241241
*
242242
* Allowing for case / variance weights $w_i$ as above, we derive a reduced log marginal likelihood of
@@ -258,7 +258,7 @@ namespace StochTree {
258258
* and a posterior of
259259
*
260260
* \f[
261-
* \beta_{\ell} \mid - \sim \mathcal{N}\left(\frac{\tau s_{wyx,\ell}}{s_{wxx,\ell} \tau + \sigma^2}, \frac{\tau \sigma^2}{s_{wxx,\ell} \tau + \sigma^2}\right)
261+
* \beta_{\ell} \mid - \sim N\left(\frac{\tau s_{wyx,\ell}}{s_{wxx,\ell} \tau + \sigma^2}, \frac{\tau \sigma^2}{s_{wxx,\ell} \tau + \sigma^2}\right)
262262
* \f]
263263
*
264264
* \section inverse_gamma_leaf_model Inverse Gamma Leaf Model
@@ -291,7 +291,7 @@ namespace StochTree {
291291
* Under an outcome model
292292
*
293293
* \f[
294-
* y \sim \mathcal{N}\left(f(X), \sigma_0^2 \sigma^2(X)\right)
294+
* y \sim N\left(f(X), \sigma_0^2 \sigma^2(X)\right)
295295
* \f]
296296
*
297297
* updates to \f$\mu_{\ell}\f$ for a given tree \f$j\f$ are based on a reduced log marginal likelihood of

0 commit comments

Comments
 (0)