Skip to content

Commit

Permalink
merged v. 1.0.1 onto master
Browse files Browse the repository at this point in the history
  • Loading branch information
paciorek committed Jun 16, 2023
2 parents 3b6f35d + 04fbfdd commit 41e769e
Show file tree
Hide file tree
Showing 45 changed files with 326 additions and 167 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -100,8 +100,9 @@ and depends on additional third-party libraries with compatible licenses.
The development of NIMBLE has been funded by:

* an NSF Advances in Biological Informatics grant (DBI-1147230) to P. de Valpine, C. Paciorek, and D. Temple Lang;
* an NSF SI2-SSI grant (ACI-1550488) to P. de Valpine, C. Paciorek, and D. Temple Lang; and
* an NSF Collaborative Research grant (DMS-1622444) to P. de Valpine, A. Rodriguez, and C. Paciorek.
* an NSF SI2-SSI grant (ACI-1550488) to P. de Valpine, C. Paciorek, and D. Temple Lang;
* an NSF Collaborative Research grant (DMS-1622444) to P. de Valpine, A. Rodriguez, and C. Paciorek; and
* an NSF Collaborative Research grant (DMS-2152860) to P. de Valpine, C. Paciorek, and D. Turek.

with additional support provided by postdoctoral funding for D. Turek from the Berkeley Institute for Data Science and Google Summer of Code fellowships for N. Michaud (2015) and C. Lewis-Beck (2017).

Expand Down
Binary file modified UserManual/NimbleUserManual_files/figure-html/plotPump-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions UserManual/cha-RCfunctions.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down Expand Up @@ -1574,14 +1574,14 @@ <h4><span class="header-section-number">11.3.2.7</span> Understanding dimensions
<h4><span class="header-section-number">11.3.2.8</span> Size warnings and the potential for crashes<a href="cha-RCfunctions.html#sec:size-warn-potent" class="anchor-section" aria-label="Anchor link to header"></a></h4>
<p>For matrix algebra, NIMBLE cannot ensure perfect behavior because
sizes are not known until run time. Therefore, it is possible for you
to write code that will crash your R session. In Version 1.0.0, NIMBLE
to write code that will crash your R session. In Version 1.0.1, NIMBLE
attempts to issue a warning if sizes are not compatible, but it does not
halt execution. Therefore, if you execute <code>A &lt;- M1 %*% M2</code>, and <code>M1</code> and <code>M2</code> are not compatible for matrix multiplication,
NIMBLE will output a warning that the number of rows of <code>M1</code> does not
match the number of columns of <code>M2</code>. After that warning the statement
will be executed and may result in a crash. Another easy way to write
code that will crash is to do things like <code>Y[5:10, 20:30] &lt;- x</code> without ensuring Y is at least 10x30. In the future we hope to
prevent crashes, but in Version 1.0.0 we limit ourselves to trying to provide
prevent crashes, but in Version 1.0.1 we limit ourselves to trying to provide
useful information.</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion UserManual/cha-algos-provided.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down
2 changes: 1 addition & 1 deletion UserManual/cha-bnp.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down
9 changes: 6 additions & 3 deletions UserManual/cha-building-models.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down Expand Up @@ -555,7 +555,7 @@ <h4><span class="header-section-number">6.1.1.1</span> Data and constants<a href
which case NIMBLE handles values for stochastic nodes as data and
everything else as constants.</p>
<p>Values for nodes that appear only on the right-hand side of BUGS
declarations (e.g., covariates/predictors) can be provided as constants or as data or initial values. There is no real difference between providing as data or initial values and the values can be added after building a model via <code>setInits</code> or <code>setData</code>.</p>
declarations (e.g., covariates/predictors) can be provided as constants or as data or initial values. There is no real difference between providing as data or initial values and the values can be added after building a model via <code>setInits</code> or <code>setData</code>. However if provided as data, calls to <code>setInits</code> will not overwrite those values (though direct assignment of values will overwrite those values).</p>
</div>
<div id="providing-or-changing-data-and-initial-values-for-an-existing-model" class="section level4 hasAnchor" number="6.1.1.2">
<h4><span class="header-section-number">6.1.1.2</span> Providing (or changing) data and initial values for an existing model<a href="cha-building-models.html#providing-or-changing-data-and-initial-values-for-an-existing-model" class="anchor-section" aria-label="Anchor link to header"></a></h4>
Expand All @@ -575,7 +575,10 @@ <h4><span class="header-section-number">6.1.1.2</span> Providing (or changing) d
by using the <code>resetData</code> method, e.g. <code>pump$resetData()</code>.</p>
<p>Data nodes cannot be deterministic, and using <code>setData</code> on
deterministic nodes (or passing values for deterministic nodes
via the <code>data</code> argument to <code>nimbleModel</code>) will produce an error.</p>
via the <code>data</code> argument to <code>nimbleModel</code>) will not flag those
nodes as containing data. It will set the values of those nodes,
but that will presumably be overwritten as soon as the nodes
are deterministically calculated.</p>
<p>To change data values without any modification of which nodes are
flagged as containing data, simply use R’s usual assignment syntax
to assign values in a compiled (or, more rarely, an uncompiled) model, e.g.,</p>
Expand Down
2 changes: 1 addition & 1 deletion UserManual/cha-data-structures.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down
2 changes: 1 addition & 1 deletion UserManual/cha-installing-nimble.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down
2 changes: 1 addition & 1 deletion UserManual/cha-lightning-intro.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down
18 changes: 9 additions & 9 deletions UserManual/cha-mcmc.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down Expand Up @@ -1394,7 +1394,7 @@ <h4><span class="header-section-number">7.11.2.1</span> HMC example<a href="cha-
<span id="cb192-2"><a href="cha-mcmc.html#cb192-2" aria-hidden="true" tabindex="-1"></a><span class="co"># The compiled HMC will use the compiled model.</span></span>
<span id="cb192-3"><a href="cha-mcmc.html#cb192-3" aria-hidden="true" tabindex="-1"></a>samples <span class="ot">&lt;-</span> <span class="fu">runMCMC</span>(CHMC, <span class="at">niter =</span> <span class="dv">1000</span>, <span class="at">nburnin =</span> <span class="dv">500</span>) <span class="co"># short run for illustration</span></span></code></pre></div>
<pre><code>## [Note] HMC sampler (nodes: intercept, beta, sigma, ran_eff[1], ran_eff[2], ran_eff[3], ran_eff[4], ran_eff[5], ran_eff[6], r...) is using 500 warmup iterations.
## [Note] HMC sampler (nodes: intercept, beta, sigma, ran_eff[1], ran_eff[2], ran_eff[3], ran_eff[4], ran_eff[5], ran_eff[6], r...) encountered 7 divergent paths.</code></pre>
## [Note] HMC sampler (nodes: intercept, beta, sigma, ran_eff[1], ran_eff[2], ran_eff[3], ran_eff[4], ran_eff[5], ran_eff[6], r...) encountered 8 divergent paths.</code></pre>
<p>We will not investigate results in detail, but here is a summary to see that reasonable results were generated.</p>
<div class="sourceCode" id="cb194"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb194-1"><a href="cha-mcmc.html#cb194-1" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(coda<span class="sc">::</span><span class="fu">as.mcmc</span>(samples))</span></code></pre></div>
<pre><code>##
Expand All @@ -1407,16 +1407,16 @@ <h4><span class="header-section-number">7.11.2.1</span> HMC example<a href="cha-
## plus standard error of the mean:
##
## Mean SD Naive SE Time-series SE
## beta 0.1822 0.1424 0.006367 0.007605
## intercept -0.1752 0.3022 0.013513 0.026437
## sigma 0.7336 0.2792 0.012484 0.022891
## beta 0.1901 0.1422 0.006358 0.006358
## intercept -0.1865 0.2983 0.013341 0.026606
## sigma 0.7460 0.2691 0.012036 0.020029
##
## 2. Quantiles for each variable:
##
## 2.5% 25% 50% 75% 97.5%
## beta -0.1068 0.08895 0.1836 0.281308 0.4543
## intercept -0.8498 -0.34765 -0.1668 0.003649 0.4021
## sigma 0.3107 0.50522 0.6993 0.909613 1.4183</code></pre>
## 2.5% 25% 50% 75% 97.5%
## beta -0.08399 0.08895 0.1893 0.30176 0.4595
## intercept -0.79899 -0.38862 -0.1843 0.01333 0.3963
## sigma 0.31865 0.55724 0.7078 0.88552 1.3849</code></pre>
</div>
<div id="automatic-parameter-transformation" class="section level4 hasAnchor" number="7.11.2.2">
<h4><span class="header-section-number">7.11.2.2</span> Automatic parameter transformation<a href="cha-mcmc.html#automatic-parameter-transformation" class="anchor-section" aria-label="Anchor link to header"></a></h4>
Expand Down
4 changes: 2 additions & 2 deletions UserManual/cha-more-introduction.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down Expand Up @@ -606,7 +606,7 @@ <h2><span class="header-section-number">3.2</span> nimbleFunctions for writing a
</div>
<div id="sec:nimble-algor-libr" class="section level2 hasAnchor" number="3.3">
<h2><span class="header-section-number">3.3</span> The NIMBLE algorithm library<a href="cha-more-introduction.html#sec:nimble-algor-libr" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>In Version 1.0.0, the NIMBLE algorithm library includes:</p>
<p>In Version 1.0.1, the NIMBLE algorithm library includes:</p>
<ol style="list-style-type: decimal">
<li><p>MCMC with samplers including conjugate (Gibbs), slice, adaptive
random walk (with options for reflection or sampling on a log
Expand Down
4 changes: 2 additions & 2 deletions UserManual/cha-progr-with-models.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down Expand Up @@ -1084,7 +1084,7 @@ <h3><span class="header-section-number">15.4.8</span> Virtual nimbleFunctions an
<code>nimbleFunctionVirtual</code>. Other nimbleFunctions can inherit from
virtual nimbleFunctions, which in R is called ‘containing’ them.
Readers familiar with object oriented programming will recognize this
as a simple class inheritance system. In Version 1.0.0 it is limited to
as a simple class inheritance system. In Version 1.0.1 it is limited to
simple, single-level inheritance.</p>
<p>Here is how it works:</p>
<div class="sourceCode" id="cb452"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb452-1"><a href="cha-progr-with-models.html#cb452-1" aria-hidden="true" tabindex="-1"></a>baseClass <span class="ot">&lt;-</span> <span class="fu">nimbleFunctionVirtual</span>(</span>
Expand Down
2 changes: 1 addition & 1 deletion UserManual/cha-spatial.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down
2 changes: 1 addition & 1 deletion UserManual/cha-user-defined.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down
2 changes: 1 addition & 1 deletion UserManual/cha-using-models.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down
4 changes: 2 additions & 2 deletions UserManual/cha-welcome-nimble.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down Expand Up @@ -492,7 +492,7 @@ <h1><span class="header-section-number">Chapter 1</span> Welcome to NIMBLE<a hre
computationally-intensive methods. While NIMBLE is embedded in R, it
goes beyond R by supporting separate programming of models and
algorithms along with compilation for fast execution.</p>
<p>As of version 1.0.0, NIMBLE has been around for a while and is reasonably
<p>As of version 1.0.1, NIMBLE has been around for a while and is reasonably
stable, but we have a lot of plans to expand and improve it. The
algorithm library provides MCMC with a lot of user control and ability
to write new samplers easily. Other algorithms include particle
Expand Down
2 changes: 1 addition & 1 deletion UserManual/cha-writing-models.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down
2 changes: 1 addition & 1 deletion UserManual/overview.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down
2 changes: 1 addition & 1 deletion UserManual/references.html
Expand Up @@ -159,7 +159,7 @@
<ul class="summary">
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>

Expand Down
2 changes: 1 addition & 1 deletion UserManual/search_index.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion UserManual/src/_output.yml
Expand Up @@ -5,7 +5,7 @@ bookdown::gitbook:
before: |
<img src="./nimble-icon.png"
width=100>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.0</a></li>
<li><a href="./cha-welcome-nimble.html">NIMBLE User Manual, Version 1.0.1</a></li>
<li><a href="https://github.com/nimble-dev/nimble">NIMBLE Development Team</a></li>
<li><a href="https://R-nimble.org">https://R-nimble.org</a></li>
after: |
Expand Down
7 changes: 5 additions & 2 deletions UserManual/src/chapter_BuildingModels.Rmd
Expand Up @@ -74,7 +74,7 @@ which case NIMBLE handles values for stochastic nodes as data and
everything else as constants.

Values for nodes that appear only on the right-hand side of BUGS
declarations (e.g., covariates/predictors) can be provided as constants or as data or initial values. There is no real difference between providing as data or initial values and the values can be added after building a model via `setInits` or `setData`.
declarations (e.g., covariates/predictors) can be provided as constants or as data or initial values. There is no real difference between providing as data or initial values and the values can be added after building a model via `setInits` or `setData`. However if provided as data, calls to `setInits` will not overwrite those values (though direct assignment of values will overwrite those values).

#### Providing (or changing) data and initial values for an existing model

Expand All @@ -96,7 +96,10 @@ by using the `resetData` method, e.g. `pump$resetData()`.

Data nodes cannot be deterministic, and using `setData` on
deterministic nodes (or passing values for deterministic nodes
via the `data` argument to `nimbleModel`) will produce an error.
via the `data` argument to `nimbleModel`) will not flag those
nodes as containing data. It will set the values of those nodes,
but that will presumably be overwritten as soon as the nodes
are deterministically calculated.

To change data values without any modification of which nodes are
flagged as containing data, simply use R's usual assignment syntax
Expand Down
2 changes: 1 addition & 1 deletion UserManual/src/title.tex
Expand Up @@ -4,7 +4,7 @@
\vspace{0.2in}
{\large NIMBLE Development Team}\\
\vspace{0.2in}
{\large Version 1.0.0}\\
{\large Version 1.0.1}\\
\vspace{3in}
\includegraphics[width=1.5in]{../nimble-icon.png}\\
{\large
Expand Down
2 changes: 1 addition & 1 deletion install_revDeps.R
Expand Up @@ -8,7 +8,7 @@ revDeps <- c(
## Note that if don't specify repos, the RStudio repo seems to install from
## Linux binary (that is what the .tar.gz is?) and doesn't install tests.
for (package in revDeps) {
install.packages(package, type = 'source', INSTALL_opts = '--install-tests', repos = 'https://cran.us.r-project.org')
install.packages(package, type = 'source', INSTALL_opts = '--install-tests', repos = 'https://cran.r-project.org')
}
print(list.files(system.file('tests','testthat', package='nimbleSMC')))
print(list.files(system.file('', package='nimbleSMC')))
Expand Down

0 comments on commit 41e769e

Please sign in to comment.