Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Quarto GHA Workflow Runner committed Sep 17, 2024
1 parent 7afbde1 commit 4e6670b
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e2e0ddd0
a16ad7ed
75 changes: 71 additions & 4 deletions autoregression/arr2.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,27 @@
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>
/* CSS for citations */
div.csl-bib-body { }
div.csl-entry {
clear: both;
margin-bottom: 0em;
}
.hanging-indent div.csl-entry {
margin-left:2em;
text-indent:-2em;
}
div.csl-left-margin {
min-width:2em;
float:left;
}
div.csl-right-inline {
margin-left:2em;
padding-left:1em;
}
div.csl-indent {
margin-left: 2em;
}</style>


<script src="../site_libs/quarto-nav/quarto-nav.js"></script>
Expand Down Expand Up @@ -464,7 +484,7 @@ <h1 class="title">ARR2</h1>

<section id="description" class="level2">
<h2 class="anchored" data-anchor-id="description">Description</h2>
<p>Like the R2-D2 prior <span class="citation" data-cites="r2d2">(<a href="#ref-r2d2" role="doc-biblioref"><strong>r2d2?</strong></a>)</span> but for autoregression.</p>
<p>Developed by <span class="citation" data-cites="kohnsARR2PriorFlexible2024a">(<a href="#ref-kohnsARR2PriorFlexible2024a" role="doc-biblioref">Kohns et al. 2024</a>)</span>, it is similar to the R2-D2 prior <span class="citation" data-cites="zhangBayesianRegressionUsing2022a">(<a href="#ref-zhangBayesianRegressionUsing2022a" role="doc-biblioref">Zhang et al. 2022</a>)</span> but for autoregression.</p>
</section>
<section id="definition" class="level2">
<h2 class="anchored" data-anchor-id="definition">Definition</h2>
Expand All @@ -488,12 +508,59 @@ <h2 class="anchored" data-anchor-id="things-to-specify">Things to specify</h2>
</section>
<section id="stan-code" class="level2">
<h2 class="anchored" data-anchor-id="stan-code">Stan code</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode stan code-with-copy"><code class="sourceCode stan"></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode stan code-with-copy"><code class="sourceCode stan"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="kw">data</span> {</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span>&lt;<span class="kw">lower</span>=<span class="dv">1</span>&gt; T; <span class="co">// number of time points</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">vector</span>[T] Y; <span class="co">// observations</span></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span>&lt;<span class="kw">lower</span>=<span class="dv">0</span>&gt; p; <span class="co">// AR order</span></span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a> <span class="co">// concentration vector of the Dirichlet prior</span></span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a> <span class="dt">vector</span>&lt;<span class="kw">lower</span>=<span class="dv">0</span>&gt;[p] cons;</span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a> <span class="co">// data for the R2D2 prior</span></span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a> <span class="dt">real</span>&lt;<span class="kw">lower</span>=<span class="dv">0</span>&gt; mean_R2; <span class="co">// mean of the R2 prior</span></span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a> <span class="dt">real</span>&lt;<span class="kw">lower</span>=<span class="dv">0</span>&gt; prec_R2; <span class="co">// precision of the R2 prior</span></span>
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a> <span class="dt">real</span>&lt;<span class="kw">lower</span>=<span class="dv">0</span>&gt; sigma_sd; <span class="co">// sd of sigma prior</span></span>
<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a> <span class="co">// variance estimates of y</span></span>
<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a> <span class="dt">real</span>&lt;<span class="kw">lower</span>=<span class="dv">0</span>&gt; var_y;</span>
<span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a>}</span>
<span id="cb1-14"><a href="#cb1-14" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-15"><a href="#cb1-15" aria-hidden="true" tabindex="-1"></a><span class="kw">parameters</span> {</span>
<span id="cb1-16"><a href="#cb1-16" aria-hidden="true" tabindex="-1"></a> <span class="dt">vector</span>[p] phi; <span class="co">// AR coefficients</span></span>
<span id="cb1-17"><a href="#cb1-17" aria-hidden="true" tabindex="-1"></a> <span class="dt">simplex</span>[p] psi; <span class="co">// decomposition simplex</span></span>
<span id="cb1-18"><a href="#cb1-18" aria-hidden="true" tabindex="-1"></a> <span class="dt">real</span>&lt;<span class="kw">lower</span>=<span class="dv">0</span>, <span class="kw">upper</span>=<span class="dv">1</span>&gt; R2; <span class="co">// coefficient of determination</span></span>
<span id="cb1-19"><a href="#cb1-19" aria-hidden="true" tabindex="-1"></a> <span class="dt">real</span>&lt;<span class="kw">lower</span>=<span class="dv">0</span>&gt; sigma; <span class="co">// observation model sd</span></span>
<span id="cb1-20"><a href="#cb1-20" aria-hidden="true" tabindex="-1"></a>}</span>
<span id="cb1-21"><a href="#cb1-21" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-22"><a href="#cb1-22" aria-hidden="true" tabindex="-1"></a><span class="kw">transformed parameters</span> {</span>
<span id="cb1-23"><a href="#cb1-23" aria-hidden="true" tabindex="-1"></a> <span class="dt">real</span>&lt;<span class="kw">lower</span>=<span class="dv">0</span>&gt; tau2 = R2 / (<span class="dv">1</span> - R2); <span class="co">// Equation 18</span></span>
<span id="cb1-24"><a href="#cb1-24" aria-hidden="true" tabindex="-1"></a> <span class="dt">vector</span>[T] mu = rep_vector(<span class="fl">0.0</span>, T);</span>
<span id="cb1-25"><a href="#cb1-25" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> (t <span class="cf">in</span> (p+<span class="dv">1</span>):T) {</span>
<span id="cb1-26"><a href="#cb1-26" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> (i <span class="cf">in</span> <span class="dv">1</span>:p) {</span>
<span id="cb1-27"><a href="#cb1-27" aria-hidden="true" tabindex="-1"></a> mu[t] += phi[i] * Y[t-i]; <span class="co">// Equation 16</span></span>
<span id="cb1-28"><a href="#cb1-28" aria-hidden="true" tabindex="-1"></a> }</span>
<span id="cb1-29"><a href="#cb1-29" aria-hidden="true" tabindex="-1"></a> }</span>
<span id="cb1-30"><a href="#cb1-30" aria-hidden="true" tabindex="-1"></a>}</span>
<span id="cb1-31"><a href="#cb1-31" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-32"><a href="#cb1-32" aria-hidden="true" tabindex="-1"></a><span class="kw">model</span> {</span>
<span id="cb1-33"><a href="#cb1-33" aria-hidden="true" tabindex="-1"></a> <span class="co">// priors</span></span>
<span id="cb1-34"><a href="#cb1-34" aria-hidden="true" tabindex="-1"></a> phi ~ normal(<span class="dv">0</span>, sqrt(sigma^<span class="dv">2</span>/var_y * tau2 * psi)); <span class="co">// Equation 17</span></span>
<span id="cb1-35"><a href="#cb1-35" aria-hidden="true" tabindex="-1"></a> R2 ~ beta(mean_R2 * prec_R2, (<span class="dv">1</span> - mean_R2) * prec_R2); <span class="co">// Equation 19</span></span>
<span id="cb1-36"><a href="#cb1-36" aria-hidden="true" tabindex="-1"></a> sigma ~ normal(<span class="dv">0</span>, sigma_sd); <span class="co">// Equation 20</span></span>
<span id="cb1-37"><a href="#cb1-37" aria-hidden="true" tabindex="-1"></a> psi ~ dirichlet(cons); <span class="co">// Equation 21</span></span>
<span id="cb1-38"><a href="#cb1-38" aria-hidden="true" tabindex="-1"></a> <span class="co">// likelihood</span></span>
<span id="cb1-39"><a href="#cb1-39" aria-hidden="true" tabindex="-1"></a> Y ~ normal_lpdf(mu, sigma); <span class="co">// Equation 15</span></span>
<span id="cb1-40"><a href="#cb1-40" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>



</section>

</main> <!-- /main -->
<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" role="doc-bibliography" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0" role="list">
<div id="ref-kohnsARR2PriorFlexible2024a" class="csl-entry" role="listitem">
Kohns, David, Noa Kallioinen, Yann McLatchie, and Aki Vehtari. 2024. <span>“The <span>ARR2</span> Prior: Flexible Predictive Prior Definition for <span>Bayesian</span> Auto-Regressions.”</span> May 31, 2024. <a href="http://arxiv.org/abs/2405.19920">http://arxiv.org/abs/2405.19920</a>.
</div>
<div id="ref-zhangBayesianRegressionUsing2022a" class="csl-entry" role="listitem">
Zhang, Yan Dora, Brian P. Naughton, Howard D. Bondell, and Brian J. Reich. 2022. <span>“Bayesian <span>Regression Using</span> a <span>Prior</span> on the <span>Model Fit</span>: <span>The R2-D2 Shrinkage Prior</span>.”</span> <em>Journal of the American Statistical Association</em> 117 (538): 862–74. <a href="https://doi.org/10.1080/01621459.2020.1825449">https://doi.org/10.1080/01621459.2020.1825449</a>.
</div>
</div></section></div></main> <!-- /main -->
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
const toggleBodyColorMode = (bsSheetEl) => {
Expand Down
6 changes: 3 additions & 3 deletions search.json
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@
"href": "autoregression/arr2.html",
"title": "ARR2",
"section": "",
"text": "Like the R2-D2 prior (r2d2?) but for autoregression.",
"text": "Developed by (Kohns et al. 2024), it is similar to the R2-D2 prior (Zhang et al. 2022) but for autoregression.",
"crumbs": [
"Autoregression",
"ARR2"
Expand All @@ -992,7 +992,7 @@
"href": "autoregression/arr2.html#description",
"title": "ARR2",
"section": "",
"text": "Like the R2-D2 prior (r2d2?) but for autoregression.",
"text": "Developed by (Kohns et al. 2024), it is similar to the R2-D2 prior (Zhang et al. 2022) but for autoregression.",
"crumbs": [
"Autoregression",
"ARR2"
Expand Down Expand Up @@ -1025,7 +1025,7 @@
"href": "autoregression/arr2.html#stan-code",
"title": "ARR2",
"section": "Stan code",
"text": "Stan code",
"text": "Stan code\ndata {\n int&lt;lower=1&gt; T; // number of time points\n vector[T] Y; // observations\n int&lt;lower=0&gt; p; // AR order\n // concentration vector of the Dirichlet prior\n vector&lt;lower=0&gt;[p] cons;\n // data for the R2D2 prior\n real&lt;lower=0&gt; mean_R2; // mean of the R2 prior\n real&lt;lower=0&gt; prec_R2; // precision of the R2 prior\n real&lt;lower=0&gt; sigma_sd; // sd of sigma prior\n // variance estimates of y\n real&lt;lower=0&gt; var_y;\n}\n\nparameters {\n vector[p] phi; // AR coefficients\n simplex[p] psi; // decomposition simplex\n real&lt;lower=0, upper=1&gt; R2; // coefficient of determination\n real&lt;lower=0&gt; sigma; // observation model sd\n}\n\ntransformed parameters {\n real&lt;lower=0&gt; tau2 = R2 / (1 - R2); // Equation 18\n vector[T] mu = rep_vector(0.0, T);\n for (t in (p+1):T) {\n for (i in 1:p) {\n mu[t] += phi[i] * Y[t-i]; // Equation 16\n }\n }\n}\n\nmodel {\n // priors\n phi ~ normal(0, sqrt(sigma^2/var_y * tau2 * psi)); // Equation 17\n R2 ~ beta(mean_R2 * prec_R2, (1 - mean_R2) * prec_R2); // Equation 19\n sigma ~ normal(0, sigma_sd); // Equation 20\n psi ~ dirichlet(cons); // Equation 21\n // likelihood\n Y ~ normal_lpdf(mu, sigma); // Equation 15\n}",
"crumbs": [
"Autoregression",
"ARR2"
Expand Down
60 changes: 30 additions & 30 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,122 +2,122 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://n-kall.github.io/priorDB/tools.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/hierarchical_regression/r2d2m2.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/about.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.485Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/autoregression/minnesota.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/autoregression/pc_ar.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/index.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/CONTRIBUTING.html</loc>
<lastmod>2024-09-17T11:12:32.136Z</lastmod>
<lastmod>2024-09-17T12:11:25.485Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/bernoulli_logit.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/conway_maxwell_poisson.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/student_t.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/l1_ball.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/cumulative.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/rhs.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/gr2.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/r2d2.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/normal.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/binomial.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/poisson.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/ordinal.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/gen_linear_regression_overview.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/beta.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/negative_binomial.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/linear_regression_comparison.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/gen_linear_regression/scaled_default.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/prior_template.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/autoregression/autoregression_overview.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.485Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/autoregression/arr2.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.485Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/autoregression/autoregression_comparison.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.485Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/hierarchical_regression/hierarchical_regression_overview.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
<url>
<loc>https://n-kall.github.io/priorDB/contributors.html</loc>
<lastmod>2024-09-17T11:12:32.140Z</lastmod>
<lastmod>2024-09-17T12:11:25.489Z</lastmod>
</url>
</urlset>

0 comments on commit 4e6670b

Please sign in to comment.