Skip to content

Commit

Permalink
style change
Browse files Browse the repository at this point in the history
  • Loading branch information
kingaa committed Jan 24, 2024
1 parent 64258d0 commit d4b1835
Show file tree
Hide file tree
Showing 14 changed files with 206 additions and 178 deletions.
8 changes: 4 additions & 4 deletions vignettes/C_API.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 'pomp C API'
output:
html_document:
theme: null
highlight: haddock
highlight: tango
toc: yes
toc_depth: 3
params:
Expand Down Expand Up @@ -48,7 +48,7 @@ $$\mathbb{E}\left[X\right]=n\,p\qquad\text{and}\qquad\mathrm{Var}\left[X\right]=
double dmultinom(int m, const double *prob, double *x, int give_log);
```

The **R** C API provides a simulator for the multinomial distribution, `rmultinom`.
The [**R** C API](https://CRAN.R-project.org/doc/manuals/r-release/R-exts.html#The-R-API) provides a [simulator for the multinomial distribution, `rmultinom`](https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Distribution-functions).
See the "Rmath.h" header file for information on this facility.
**pomp** provides an evaluator for the probability mass function (`dmultinom`) for this distribution.

Expand Down Expand Up @@ -83,7 +83,7 @@ Input:

On return, `trans[0]`, ..., `trans[m-1]` will be the numbers of individuals making each of the respective transitions.

See [`?reulermultinom`](https://kingaa.github.io/manuals/pomp/html/distributions.html) and [FAQ 3.6](./FAQ.html#eulermultinomial-approximation) for more on the Euler-multinomial distributions.
See [`?reulermultinom`](https://kingaa.github.io/manuals/pomp/html/eulermultinom.html) and [FAQ 3.6](./FAQ.html#eulermultinomial-approximation) for more on the Euler-multinomial distributions.

**NB:** `reulermultinom` does not call `GetRNGstate()` or `PutRNGstate()` internally.
This must be done by the calling program.
Expand All @@ -110,7 +110,7 @@ Input:

The value returned is the probability or log probability (as requested).

See [`?deulermultinom`](https://kingaa.github.io/manuals/pomp/html/distributions.html) and [FAQ 3.6](./FAQ.html#eulermultinomial-approximation) for more on the Euler-multinomial distributions.
See [`?deulermultinom`](https://kingaa.github.io/manuals/pomp/html/eulermultinom.html) and [FAQ 3.6](./FAQ.html#eulermultinomial-approximation) for more on the Euler-multinomial distributions.


### Gamma white noise
Expand Down
56 changes: 30 additions & 26 deletions vignettes/C_API.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,34 +93,38 @@
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
{ background-color: #f8f8f8; }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; } /* Alert */
code span.an { color: #008000; } /* Annotation */
code span.at { } /* Attribute */
code span.bu { } /* BuiltIn */
code span.cf { color: #0000ff; } /* ControlFlow */
code span.ch { color: #008080; } /* Char */
code span.cn { } /* Constant */
code span.co { color: #008000; } /* Comment */
code span.cv { color: #008000; } /* CommentVar */
code span.do { color: #008000; } /* Documentation */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.al { color: #ef2929; } /* Alert */
code span.an { color: #8f5902; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #c4a000; } /* Attribute */
code span.bn { color: #0000cf; } /* BaseN */
code span.cf { color: #204a87; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4e9a06; } /* Char */
code span.cn { color: #000000; } /* Constant */
code span.co { color: #8f5902; font-style: italic; } /* Comment */
code span.cv { color: #8f5902; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #8f5902; font-weight: bold; font-style: italic; } /* Documentation */
code span.dt { color: #204a87; } /* DataType */
code span.dv { color: #0000cf; } /* DecVal */
code span.er { color: #a40000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #0000cf; } /* Float */
code span.fu { color: #000000; } /* Function */
code span.im { } /* Import */
code span.in { color: #008000; } /* Information */
code span.kw { color: #0000ff; } /* Keyword */
code span.op { } /* Operator */
code span.ot { color: #ff4000; } /* Other */
code span.pp { color: #ff4000; } /* Preprocessor */
code span.sc { color: #008080; } /* SpecialChar */
code span.ss { color: #008080; } /* SpecialString */
code span.st { color: #008080; } /* String */
code span.va { } /* Variable */
code span.vs { color: #008080; } /* VerbatimString */
code span.wa { color: #008000; font-weight: bold; } /* Warning */
code span.in { color: #8f5902; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #204a87; font-weight: bold; } /* Keyword */
code span.op { color: #ce5c00; font-weight: bold; } /* Operator */
code span.ot { color: #8f5902; } /* Other */
code span.pp { color: #8f5902; font-style: italic; } /* Preprocessor */
code span.sc { color: #000000; } /* SpecialChar */
code span.ss { color: #4e9a06; } /* SpecialString */
code span.st { color: #4e9a06; } /* String */
code span.va { color: #000000; } /* Variable */
code span.vs { color: #4e9a06; } /* VerbatimString */
code span.wa { color: #8f5902; font-weight: bold; font-style: italic; } /* Warning */

</style>
<script>
Expand Down Expand Up @@ -228,7 +232,7 @@ <h3>Beta-binomial distribution</h3>
<div id="multinomial-distribution" class="section level3">
<h3>Multinomial distribution</h3>
<div class="sourceCode" id="cb2"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true"></a><span class="dt">double</span> dmultinom(<span class="dt">int</span> m, <span class="dt">const</span> <span class="dt">double</span> *prob, <span class="dt">double</span> *x, <span class="dt">int</span> give_log);</span></code></pre></div>
<p>The <strong>R</strong> C API provides a simulator for the multinomial distribution, <code>rmultinom</code>. See the “Rmath.h” header file for information on this facility. <strong>pomp</strong> provides an evaluator for the probability mass function (<code>dmultinom</code>) for this distribution.</p>
<p>The <a href="https://CRAN.R-project.org/doc/manuals/r-release/R-exts.html#The-R-API"><strong>R</strong> C API</a> provides a <a href="https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Distribution-functions">simulator for the multinomial distribution, <code>rmultinom</code></a>. See the “Rmath.h” header file for information on this facility. <strong>pomp</strong> provides an evaluator for the probability mass function (<code>dmultinom</code>) for this distribution.</p>
<p>Input:</p>
<ul>
<li><code>m</code> is a positive integer, is the dimension of the random variable.</li>
Expand Down Expand Up @@ -257,7 +261,7 @@ <h4>Simulate Euler-multinomial transitions</h4>
<li><code>trans</code> is a pointer to the vector that will hold the random deviate.</li>
</ul>
<p>On return, <code>trans[0]</code>, …, <code>trans[m-1]</code> will be the numbers of individuals making each of the respective transitions.</p>
<p>See <a href="https://kingaa.github.io/manuals/pomp/html/distributions.html"><code>?reulermultinom</code></a> and <a href="./FAQ.html#eulermultinomial-approximation">FAQ 3.6</a> for more on the Euler-multinomial distributions.</p>
<p>See <a href="https://kingaa.github.io/manuals/pomp/html/eulermultinom.html"><code>?reulermultinom</code></a> and <a href="./FAQ.html#eulermultinomial-approximation">FAQ 3.6</a> for more on the Euler-multinomial distributions.</p>
<p><strong>NB:</strong> <code>reulermultinom</code> does not call <code>GetRNGstate()</code> or <code>PutRNGstate()</code> internally. This must be done by the calling program. But note that when <code>reulermultinom</code> is called inside a <strong>pomp</strong> rprocess, there is no need to call either <code>GetRNGState()</code> or <code>PutRNGState()</code>; this is handled by <strong>pomp</strong>.</p>
</div>
<div id="compute-probabilities-of-euler-multinomial-transitions" class="section level4">
Expand All @@ -278,7 +282,7 @@ <h4>Compute probabilities of Euler-multinomial transitions</h4>
</ul></li>
</ul>
<p>The value returned is the probability or log probability (as requested).</p>
<p>See <a href="https://kingaa.github.io/manuals/pomp/html/distributions.html"><code>?deulermultinom</code></a> and <a href="./FAQ.html#eulermultinomial-approximation">FAQ 3.6</a> for more on the Euler-multinomial distributions.</p>
<p>See <a href="https://kingaa.github.io/manuals/pomp/html/eulermultinom.html"><code>?deulermultinom</code></a> and <a href="./FAQ.html#eulermultinomial-approximation">FAQ 3.6</a> for more on the Euler-multinomial distributions.</p>
</div>
</div>
<div id="gamma-white-noise" class="section level3">
Expand Down
2 changes: 1 addition & 1 deletion vignettes/FAQ.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ params:
output:
html_document:
theme: null
highlight: haddock
highlight: tango
toc: yes
toc_depth: 4
number_sections: true
Expand Down
50 changes: 27 additions & 23 deletions vignettes/FAQ.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,34 +93,38 @@
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
{ background-color: #f8f8f8; }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; } /* Alert */
code span.an { color: #008000; } /* Annotation */
code span.at { } /* Attribute */
code span.bu { } /* BuiltIn */
code span.cf { color: #0000ff; } /* ControlFlow */
code span.ch { color: #008080; } /* Char */
code span.cn { } /* Constant */
code span.co { color: #008000; } /* Comment */
code span.cv { color: #008000; } /* CommentVar */
code span.do { color: #008000; } /* Documentation */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.al { color: #ef2929; } /* Alert */
code span.an { color: #8f5902; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #c4a000; } /* Attribute */
code span.bn { color: #0000cf; } /* BaseN */
code span.cf { color: #204a87; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4e9a06; } /* Char */
code span.cn { color: #000000; } /* Constant */
code span.co { color: #8f5902; font-style: italic; } /* Comment */
code span.cv { color: #8f5902; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #8f5902; font-weight: bold; font-style: italic; } /* Documentation */
code span.dt { color: #204a87; } /* DataType */
code span.dv { color: #0000cf; } /* DecVal */
code span.er { color: #a40000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #0000cf; } /* Float */
code span.fu { color: #000000; } /* Function */
code span.im { } /* Import */
code span.in { color: #008000; } /* Information */
code span.kw { color: #0000ff; } /* Keyword */
code span.op { } /* Operator */
code span.ot { color: #ff4000; } /* Other */
code span.pp { color: #ff4000; } /* Preprocessor */
code span.sc { color: #008080; } /* SpecialChar */
code span.ss { color: #008080; } /* SpecialString */
code span.st { color: #008080; } /* String */
code span.va { } /* Variable */
code span.vs { color: #008080; } /* VerbatimString */
code span.wa { color: #008000; font-weight: bold; } /* Warning */
code span.in { color: #8f5902; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #204a87; font-weight: bold; } /* Keyword */
code span.op { color: #ce5c00; font-weight: bold; } /* Operator */
code span.ot { color: #8f5902; } /* Other */
code span.pp { color: #8f5902; font-style: italic; } /* Preprocessor */
code span.sc { color: #000000; } /* SpecialChar */
code span.ss { color: #4e9a06; } /* SpecialString */
code span.st { color: #4e9a06; } /* String */
code span.va { color: #000000; } /* Variable */
code span.vs { color: #4e9a06; } /* VerbatimString */
code span.wa { color: #8f5902; font-weight: bold; font-style: italic; } /* Warning */

</style>
<script>
Expand Down
2 changes: 1 addition & 1 deletion vignettes/He2010.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ output:
collapsed: TRUE
smooth_scroll: TRUE
code_folding: show
highlight: haddock
highlight: tango
number_sections: FALSE
df_print: kable
includes:
Expand Down
50 changes: 27 additions & 23 deletions vignettes/He2010.html
Original file line number Diff line number Diff line change
Expand Up @@ -1419,34 +1419,38 @@
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
{ background-color: #f8f8f8; }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; } /* Alert */
code span.an { color: #008000; } /* Annotation */
code span.at { } /* Attribute */
code span.bu { } /* BuiltIn */
code span.cf { color: #0000ff; } /* ControlFlow */
code span.ch { color: #008080; } /* Char */
code span.cn { } /* Constant */
code span.co { color: #008000; } /* Comment */
code span.cv { color: #008000; } /* CommentVar */
code span.do { color: #008000; } /* Documentation */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.al { color: #ef2929; } /* Alert */
code span.an { color: #8f5902; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #c4a000; } /* Attribute */
code span.bn { color: #0000cf; } /* BaseN */
code span.cf { color: #204a87; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4e9a06; } /* Char */
code span.cn { color: #000000; } /* Constant */
code span.co { color: #8f5902; font-style: italic; } /* Comment */
code span.cv { color: #8f5902; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #8f5902; font-weight: bold; font-style: italic; } /* Documentation */
code span.dt { color: #204a87; } /* DataType */
code span.dv { color: #0000cf; } /* DecVal */
code span.er { color: #a40000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #0000cf; } /* Float */
code span.fu { color: #000000; } /* Function */
code span.im { } /* Import */
code span.in { color: #008000; } /* Information */
code span.kw { color: #0000ff; } /* Keyword */
code span.op { } /* Operator */
code span.ot { color: #ff4000; } /* Other */
code span.pp { color: #ff4000; } /* Preprocessor */
code span.sc { color: #008080; } /* SpecialChar */
code span.ss { color: #008080; } /* SpecialString */
code span.st { color: #008080; } /* String */
code span.va { } /* Variable */
code span.vs { color: #008080; } /* VerbatimString */
code span.wa { color: #008000; font-weight: bold; } /* Warning */
code span.in { color: #8f5902; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #204a87; font-weight: bold; } /* Keyword */
code span.op { color: #ce5c00; font-weight: bold; } /* Operator */
code span.ot { color: #8f5902; } /* Other */
code span.pp { color: #8f5902; font-style: italic; } /* Preprocessor */
code span.sc { color: #000000; } /* SpecialChar */
code span.ss { color: #4e9a06; } /* SpecialString */
code span.st { color: #4e9a06; } /* String */
code span.va { color: #000000; } /* Variable */
code span.vs { color: #4e9a06; } /* VerbatimString */
code span.wa { color: #8f5902; font-weight: bold; font-style: italic; } /* Warning */

.sourceCode .row {
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion vignettes/R_v_C.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 'Coding POMP models: R vs C snippets'
output:
html_document:
theme: null
highlight: haddock
highlight: tango
toc: yes
toc_depth: 3
---
Expand Down
58 changes: 31 additions & 27 deletions vignettes/R_v_C.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,34 +93,38 @@
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
{ background-color: #f8f8f8; }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; } /* Alert */
code span.an { color: #008000; } /* Annotation */
code span.at { } /* Attribute */
code span.bu { } /* BuiltIn */
code span.cf { color: #0000ff; } /* ControlFlow */
code span.ch { color: #008080; } /* Char */
code span.cn { } /* Constant */
code span.co { color: #008000; } /* Comment */
code span.cv { color: #008000; } /* CommentVar */
code span.do { color: #008000; } /* Documentation */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.al { color: #ef2929; } /* Alert */
code span.an { color: #8f5902; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #c4a000; } /* Attribute */
code span.bn { color: #0000cf; } /* BaseN */
code span.cf { color: #204a87; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4e9a06; } /* Char */
code span.cn { color: #000000; } /* Constant */
code span.co { color: #8f5902; font-style: italic; } /* Comment */
code span.cv { color: #8f5902; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #8f5902; font-weight: bold; font-style: italic; } /* Documentation */
code span.dt { color: #204a87; } /* DataType */
code span.dv { color: #0000cf; } /* DecVal */
code span.er { color: #a40000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #0000cf; } /* Float */
code span.fu { color: #000000; } /* Function */
code span.im { } /* Import */
code span.in { color: #008000; } /* Information */
code span.kw { color: #0000ff; } /* Keyword */
code span.op { } /* Operator */
code span.ot { color: #ff4000; } /* Other */
code span.pp { color: #ff4000; } /* Preprocessor */
code span.sc { color: #008080; } /* SpecialChar */
code span.ss { color: #008080; } /* SpecialString */
code span.st { color: #008080; } /* String */
code span.va { } /* Variable */
code span.vs { color: #008080; } /* VerbatimString */
code span.wa { color: #008000; font-weight: bold; } /* Warning */
code span.in { color: #8f5902; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #204a87; font-weight: bold; } /* Keyword */
code span.op { color: #ce5c00; font-weight: bold; } /* Operator */
code span.ot { color: #8f5902; } /* Other */
code span.pp { color: #8f5902; font-style: italic; } /* Preprocessor */
code span.sc { color: #000000; } /* SpecialChar */
code span.ss { color: #4e9a06; } /* SpecialString */
code span.st { color: #4e9a06; } /* String */
code span.va { color: #000000; } /* Variable */
code span.vs { color: #4e9a06; } /* VerbatimString */
code span.wa { color: #8f5902; font-weight: bold; font-style: italic; } /* Warning */

</style>
<script>
Expand Down Expand Up @@ -273,16 +277,16 @@ <h2>Comparing the implementations</h2>
<p>Using each implementation, we’ll now run a number of simulations and compare the amount of time required.</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true"></a><span class="kw">system.time</span>(<span class="kw">simulate</span>(gompertz,<span class="dt">nsim=</span><span class="dv">10000</span>,<span class="dt">format=</span><span class="st">&quot;arrays&quot;</span>))</span></code></pre></div>
<pre><code>## user system elapsed
## 7.962 0.010 7.972</code></pre>
## 7.787 0.015 7.803</code></pre>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true"></a><span class="kw">system.time</span>(<span class="kw">simulate</span>(Gompertz,<span class="dt">nsim=</span><span class="dv">10000</span>,<span class="dt">format=</span><span class="st">&quot;arrays&quot;</span>))</span></code></pre></div>
<pre><code>## user system elapsed
## 0.175 0.008 0.184</code></pre>
## 0.173 0.004 0.177</code></pre>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true"></a><span class="kw">system.time</span>(<span class="kw">pfilter</span>(gompertz,<span class="dt">Np=</span><span class="dv">10000</span>))</span></code></pre></div>
<pre><code>## user system elapsed
## 6.820 0.012 6.832</code></pre>
## 6.837 0.010 6.847</code></pre>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true"></a><span class="kw">system.time</span>(<span class="kw">pfilter</span>(Gompertz,<span class="dt">Np=</span><span class="dv">10000</span>))</span></code></pre></div>
<pre><code>## user system elapsed
## 0.203 0.004 0.207</code></pre>
## 0.22 0.00 0.22</code></pre>
<hr />
<p>This document was produced using <strong>pomp</strong> version 5.5.2.0 and <strong>R</strong> version 4.3.2.</p>
</div>
Expand Down
Loading

0 comments on commit d4b1835

Please sign in to comment.