Skip to content

Commit

Permalink
update style
Browse files Browse the repository at this point in the history
  • Loading branch information
kingaa committed Jan 23, 2024
1 parent 3f80fbb commit 64258d0
Show file tree
Hide file tree
Showing 12 changed files with 557 additions and 568 deletions.
20 changes: 13 additions & 7 deletions _includes/pompstyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body {

code {
font-family: monospace;
font-size: 1.125em;
font-size: 125%;
}

h1, h2, h3, h4 {
Expand Down Expand Up @@ -48,10 +48,12 @@ a:link, a:visited {
color: #0000ff;
text-decoration: none;
}

a:hover, a:active {
color: #cc3333;
color: #cc3333;
text-decoration: none;
}

a.activated {
text-decoration: underline;
}
Expand Down Expand Up @@ -81,20 +83,24 @@ dt {
}

.emph {
color: #cc3333;
color: #cc3333;
font-weight: bold;
}

.emph1 {
color: #3333ff;
color: #3333ff;
font-weight: bold;
}

.firstcharacter {
float: left;
color: #3333ff;
.firstcharacter {
float: left;
color: #3333ff;
font-size: 2.5em;
line-height: 0.8em;
vertical-align: top;
padding-right: 5px;
}

.sourceCode, .language-r, .language-c, .language-sh {
color: #000066;
}
2 changes: 1 addition & 1 deletion blog.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: pomp
id: blog
id: news
title: pomp news blog
---
<h1>News blog</h1>
Expand Down
30 changes: 16 additions & 14 deletions install.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,45 @@ layout: pomp

# Installation instructions

## From CRAN:
### From CRAN:

Source and binaries for the [CRAN version are available on CRAN](http://cran.r-project.org/package=pomp){:target="_blank"}.

Install **pomp** from CRAN just like any other **R** package:
```
```r
install.packages("pomp")
```

## From Github:
### From Github:

The Github version is usually several weeks ahead of the version on CRAN.
You can install it from the Github repository by executing the following in an **R** session:
```
```r
install.packages("pomp",repos="https://kingaa.github.io/")
```
On Windows and MacOS systems, this will cause a precompiled version of the latest release of **pomp** to be installed, if one is available, and will install from source if a binary is not available.

### Download and install locally

You can also [download the latest release](https://github.com/kingaa/pomp/releases/) and install it locally as you would any **R** package.

---------------------------

## Testing your installation
### Testing your installation

To make use of **pomp**'s facilities for accelerated computation using compiled C code, and to compile the package from source, you will want the ability to compile C code and dynamically link it into an **R** session.
To test this, run the following in an **R** session:
```
```r
source("https://kingaa.github.io/scripts/helloC.R",echo=TRUE)
```
This script attempts to compile a simple C program.
Upon success, you'll see a "Hello!" message.

If this fails, consult the instructions below, according to your operating system.
<i>If this fails, consult the instructions below, according to your operating system.</i>

--------------------------

## Important note for Windows users
### Important note for Windows users

To use **pomp**'s compilation facility, you need to have the **Rtools** suite installed.
This can be [downloaded from CRAN](http://cran.r-project.org/bin/windows/Rtools){:target="_blank"}.
Expand All @@ -51,36 +53,36 @@ This can be [downloaded from CRAN](http://cran.r-project.org/bin/windows/Rtools)
A video tutorial on installing **Rtools** is [available here](https://youtu.be/lmIhiT_QsPE){:target="_blank"}.

To test your **Rtools** installation, run the following in an **R** session:
```
```r
source("https://kingaa.github.io/scripts/hello.R",echo=TRUE)
```
On success, you will see two "Hello!" messages.

------------------------

## Important note for Mac OS users
### Important note for Mac OS users

To use **pomp**'s compilation facility, you need to have the <code>Xcode</code> app installed.
<code>Xcode</code> is free and can be installed according to [these instructions](https://mac.r-project.org/tools/){:target="_blank"}.

In addition, some users report problems installing **pomp** from source due to lack of an appropriate **gfortran** installation, which is not included by default in all versions of **Xcode**.
If you have this problem, see [these instructions](https://mac.r-project.org/tools/){:target="_blank"}.
To test your <code>Xcode</code> and Fortran installations, run the following in an **R** session:
```
```r
source("https://kingaa.github.io/scripts/hello.R",echo=TRUE)
```
On success, you will see two "Hello!" messages.

------------------------

## Important note for Linux users
### Important note for Linux users

To install **pomp** from source, you will need the `gfortran` compiler on your machine and will therefore may need to install it.
To do so on a Debian-based system (e.g., Ubuntu), for example, run:
```
```sh
sudo apt install gfortran
```
On an RPM-based system, run:
```
```sh
sudo yum install gcc-gfortran
```
22 changes: 4 additions & 18 deletions vignettes/C_API.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,13 @@ title: 'pomp C API'
output:
html_document:
theme: null
highlight: kate
highlight: haddock
toc: yes
toc_depth: 3
params:
prefix: "c_api"
---

```{css echo=FALSE}
a:link, a:visited {
color: #0000ff;
text-decoration: none;
}
a:hover, a:active {
color: #cc3333;
text-decoration: none;
}
code {
font-size: 110%;
}
```

```{r knitr-opts,include=FALSE,purl=FALSE,cache=FALSE}
source("setup.R", local = knitr::knit_global())
```
Expand Down Expand Up @@ -189,16 +175,16 @@ void to_log_barycentric(double *xt, const double *x, int n);
void from_log_barycentric(double *xt, const double *x, int n);
```

The log-barycentric transformation takes a vector $X_i\in\mathbb{R}^n_+$, $i=1,\dots,n$, to a vector $Y_i\in\mathbb{R}^n$, where
The log-barycentric transformation takes a vector $X\in\mathbb{R}^n_+$ to a vector $Y\in\mathbb{R}^n$, where
$$Y_i = \log\frac{X_i}{\sum_j\!X_j}.$$
The log-barycentric transformation takes every simplex defined by $\sum_i\!X_i = c$, $c$ constant, to $n$-dimensional Euclidean space $\mathbb{R}^n$.
For every $c>0$, this transformation maps the simplex $\{X\in\mathbb{R}^n_+\;\vert\;\sum_i\!X_i = c\}$ bijectively onto $\mathbb{R}^n$.

The pseudo-inverse transformation takes $\mathbb{R}^n$ to the unit simplex $S=\{X\in\mathbb{R}^n_+\;\vert\;\sum_i\!X_i=1\}$.
Specifically,
$$X_i = \frac{e^{Y_i}}{\sum_j\!e^{Y_j}}.$$

Note that if $T:\mathbb{R}^n_+\to\mathbb{R}^n$ is the log-barycentric transformation so defined, $U$ is the pseudo-inverse, and $Id$ denotes the identity map, then $T\circ U=Id:\mathbb{R}^n\to\mathbb{R}^n$ but $U\circ T\ne Id$.
However, if $T$ is restricted to the unit simplex, then $U\circ T=Id:S\to S$.
However, if $T$ is restricted to the unit simplex S, then $U\circ{T\vert_{S}}=Id:S\to S$.

Input:

Expand Down
79 changes: 29 additions & 50 deletions vignettes/C_API.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,46 +89,38 @@
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
background-color: #ffffff;
color: #a0a0a0;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #a0a0a0; padding-left: 4px; }
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ color: #1f1c1b; background-color: #ffffff; }
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span { color: #1f1c1b; } /* Normal */
code span.al { color: #bf0303; background-color: #f7e6e6; font-weight: bold; } /* Alert */
code span.an { color: #ca60ca; } /* Annotation */
code span.at { color: #0057ae; } /* Attribute */
code span.bn { color: #b08000; } /* BaseN */
code span.bu { color: #644a9b; font-weight: bold; } /* BuiltIn */
code span.cf { color: #1f1c1b; font-weight: bold; } /* ControlFlow */
code span.ch { color: #924c9d; } /* Char */
code span.cn { color: #aa5500; } /* Constant */
code span.co { color: #898887; } /* Comment */
code span.cv { color: #0095ff; } /* CommentVar */
code span.do { color: #607880; } /* Documentation */
code span.dt { color: #0057ae; } /* DataType */
code span.dv { color: #b08000; } /* DecVal */
code span.er { color: #bf0303; text-decoration: underline; } /* Error */
code span.ex { color: #0095ff; font-weight: bold; } /* Extension */
code span.fl { color: #b08000; } /* Float */
code span.fu { color: #644a9b; } /* Function */
code span.im { color: #ff5500; } /* Import */
code span.in { color: #b08000; } /* Information */
code span.kw { color: #1f1c1b; font-weight: bold; } /* Keyword */
code span.op { color: #1f1c1b; } /* Operator */
code span.ot { color: #006e28; } /* Other */
code span.pp { color: #006e28; } /* Preprocessor */
code span.re { color: #0057ae; background-color: #e0e9f8; } /* RegionMarker */
code span.sc { color: #3daee9; } /* SpecialChar */
code span.ss { color: #ff5500; } /* SpecialString */
code span.st { color: #bf0303; } /* String */
code span.va { color: #0057ae; } /* Variable */
code span.vs { color: #bf0303; } /* VerbatimString */
code span.wa { color: #bf0303; } /* Warning */
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.ex { } /* Extension */
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 */

</style>
<script>
Expand Down Expand Up @@ -218,19 +210,6 @@ <h1 class="title toc-ignore">pomp C API</h1>
</ul>
</div>

<style type="text/css">
a:link, a:visited {
color: #0000ff;
text-decoration: none;
}
a:hover, a:active {
color: #cc3333;
text-decoration: none;
}
code {
font-size: 110%;
}
</style>
<hr />
<div id="overview" class="section level2">
<h2>Overview</h2>
Expand Down Expand Up @@ -337,9 +316,9 @@ <h3>Logit transformation</h3>
<h3>Log-barycentric transformation</h3>
<div class="sourceCode" id="cb8"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true"></a><span class="dt">void</span> to_log_barycentric(<span class="dt">double</span> *xt, <span class="dt">const</span> <span class="dt">double</span> *x, <span class="dt">int</span> n);</span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true"></a><span class="dt">void</span> from_log_barycentric(<span class="dt">double</span> *xt, <span class="dt">const</span> <span class="dt">double</span> *x, <span class="dt">int</span> n);</span></code></pre></div>
<p>The log-barycentric transformation takes a vector <span class="math inline">\(X_i\in\mathbb{R}^n_+\)</span>, <span class="math inline">\(i=1,\dots,n\)</span>, to a vector <span class="math inline">\(Y_i\in\mathbb{R}^n\)</span>, where <span class="math display">\[Y_i = \log\frac{X_i}{\sum_j\!X_j}.\]</span> The log-barycentric transformation takes every simplex defined by <span class="math inline">\(\sum_i\!X_i = c\)</span>, <span class="math inline">\(c\)</span> constant, to <span class="math inline">\(n\)</span>-dimensional Euclidean space <span class="math inline">\(\mathbb{R}^n\)</span>.</p>
<p>The log-barycentric transformation takes a vector <span class="math inline">\(X\in\mathbb{R}^n_+\)</span> to a vector <span class="math inline">\(Y\in\mathbb{R}^n\)</span>, where <span class="math display">\[Y_i = \log\frac{X_i}{\sum_j\!X_j}.\]</span> For every <span class="math inline">\(c&gt;0\)</span>, this transformation maps the simplex <span class="math inline">\(\{X\in\mathbb{R}^n_+\;\vert\;\sum_i\!X_i = c\}\)</span> bijectively onto <span class="math inline">\(\mathbb{R}^n\)</span>.</p>
<p>The pseudo-inverse transformation takes <span class="math inline">\(\mathbb{R}^n\)</span> to the unit simplex <span class="math inline">\(S=\{X\in\mathbb{R}^n_+\;\vert\;\sum_i\!X_i=1\}\)</span>. Specifically, <span class="math display">\[X_i = \frac{e^{Y_i}}{\sum_j\!e^{Y_j}}.\]</span></p>
<p>Note that if <span class="math inline">\(T:\mathbb{R}^n_+\to\mathbb{R}^n\)</span> is the log-barycentric transformation so defined, <span class="math inline">\(U\)</span> is the pseudo-inverse, and <span class="math inline">\(Id\)</span> denotes the identity map, then <span class="math inline">\(T\circ U=Id:\mathbb{R}^n\to\mathbb{R}^n\)</span> but <span class="math inline">\(U\circ T\ne Id\)</span>. However, if <span class="math inline">\(T\)</span> is restricted to the unit simplex, then <span class="math inline">\(U\circ T=Id:S\to S\)</span>.</p>
<p>Note that if <span class="math inline">\(T:\mathbb{R}^n_+\to\mathbb{R}^n\)</span> is the log-barycentric transformation so defined, <span class="math inline">\(U\)</span> is the pseudo-inverse, and <span class="math inline">\(Id\)</span> denotes the identity map, then <span class="math inline">\(T\circ U=Id:\mathbb{R}^n\to\mathbb{R}^n\)</span> but <span class="math inline">\(U\circ T\ne Id\)</span>. However, if <span class="math inline">\(T\)</span> is restricted to the unit simplex S, then <span class="math inline">\(U\circ{T\vert_{S}}=Id:S\to S\)</span>.</p>
<p>Input:</p>
<ul>
<li><code>x</code> is a pointer to vector of parameters to be tranformed either to or from log barycentric coordinates.</li>
Expand Down
Loading

0 comments on commit 64258d0

Please sign in to comment.