Skip to content

Commit

Permalink
Work on #7
Browse files Browse the repository at this point in the history
- Change the way variance explained is computed
  • Loading branch information
Damian-Oswald committed Mar 10, 2024
1 parent a8b5d77 commit da06594
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 89 deletions.
110 changes: 55 additions & 55 deletions docs/data-preparation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/introduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ <h3 class="anchored" data-anchor-id="what-do-the-various-functions-do">What do t
}
return(results)
}
&lt;bytecode: 0x7f7e424ab358&gt;
&lt;bytecode: 0x7f90fb598b58&gt;
&lt;environment: namespace:PRE&gt;</code></pre>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/search.json

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions docs/sensitivity-analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,11 @@ <h2 data-number="6.2" class="anchored" data-anchor-id="running-the-sensitivity-a
<dl class="code-annotation-container-hidden code-annotation-container-grid">
<dt data-target-cell="annotated-cell-4" data-target-annotation="1">1</dt>
<dd>
<span data-code-annotation="1" data-code-cell="annotated-cell-4" data-code-lines="7">Check if the bulk density value <code>BD</code> has changed since the last iteration.</span>
<span data-code-annotation="1" data-code-lines="7" data-code-cell="annotated-cell-4">Check if the bulk density value <code>BD</code> has changed since the last iteration.</span>
</dd>
<dt data-target-cell="annotated-cell-4" data-target-annotation="2">2</dt>
<dd>
<span data-code-annotation="2" data-code-cell="annotated-cell-4" data-code-lines="9,13">Prepare the <code>measurements</code> data with a new bulk density value <code>BD</code>.</span>
<span data-code-annotation="2" data-code-lines="9,13" data-code-cell="annotated-cell-4">Prepare the <code>measurements</code> data with a new bulk density value <code>BD</code>.</span>
</dd>
</dl>
</div>
Expand Down Expand Up @@ -583,83 +583,83 @@ <h3 class="anchored" data-anchor-id="standardized-regression-coefficients">Stand
<tr class="odd">
<td style="text-align: left;">Bulk density</td>
<td style="text-align: right;">-0.31 ± 0.27</td>
<td style="text-align: left;">(14.6%)</td>
<td style="text-align: left;">(12%)</td>
<td style="text-align: right;">0.064 ± 0.41</td>
<td style="text-align: left;">(15.6%)</td>
<td style="text-align: left;">(0.64%)</td>
<td style="text-align: right;">0.51 ± 0.44</td>
<td style="text-align: left;">(34.8%)</td>
<td style="text-align: left;">(50%)</td>
</tr>
<tr class="even">
<td style="text-align: left;"><span class="math inline">\(\eta\;\text{SP}_{\text{diffusion}}\)</span></td>
<td style="text-align: right;">0.048 ± 0.056</td>
<td style="text-align: left;">(2.3%)</td>
<td style="text-align: left;">(0.28%)</td>
<td style="text-align: right;">-0.023 ± 0.031</td>
<td style="text-align: left;">(1.3%)</td>
<td style="text-align: left;">(0.079%)</td>
<td style="text-align: right;">0.0026 ± 0.026</td>
<td style="text-align: left;">(1%)</td>
<td style="text-align: left;">(0.0012%)</td>
</tr>
<tr class="odd">
<td style="text-align: left;"><span class="math inline">\(\eta^{18}\text{O}_\text{diffusion}\)</span></td>
<td style="text-align: right;">-0.013 ± 0.024</td>
<td style="text-align: left;">(0.9%)</td>
<td style="text-align: left;">(0.02%)</td>
<td style="text-align: right;">-0.033 ± 0.052</td>
<td style="text-align: left;">(1.8%)</td>
<td style="text-align: left;">(0.17%)</td>
<td style="text-align: right;">-0.0045 ± 0.061</td>
<td style="text-align: left;">(1.8%)</td>
<td style="text-align: left;">(0.0038%)</td>
</tr>
<tr class="even">
<td style="text-align: left;"><span class="math inline">\(\text{SP}_\text{nitrification}\)</span></td>
<td style="text-align: right;">-0.062 ± 0.077</td>
<td style="text-align: left;">(3.3%)</td>
<td style="text-align: left;">(0.47%)</td>
<td style="text-align: right;">0.06 ± 0.08</td>
<td style="text-align: left;">(3.1%)</td>
<td style="text-align: left;">(0.55%)</td>
<td style="text-align: right;">0.037 ± 0.034</td>
<td style="text-align: left;">(2.5%)</td>
<td style="text-align: left;">(0.26%)</td>
</tr>
<tr class="odd">
<td style="text-align: left;"><span class="math inline">\(\delta\;^18\text{O}_\text{nitrification}\)</span></td>
<td style="text-align: right;">0.047 ± 0.057</td>
<td style="text-align: left;">(2.3%)</td>
<td style="text-align: left;">(0.26%)</td>
<td style="text-align: right;">0.035 ± 0.091</td>
<td style="text-align: left;">(3%)</td>
<td style="text-align: left;">(0.19%)</td>
<td style="text-align: right;">-0.075 ± 0.11</td>
<td style="text-align: left;">(5.8%)</td>
<td style="text-align: left;">(1.1%)</td>
</tr>
<tr class="even">
<td style="text-align: left;"><span class="math inline">\(\text{SP}_\text{denitrification}\)</span></td>
<td style="text-align: right;">-0.57 ± 0.15</td>
<td style="text-align: left;">(26.6%)</td>
<td style="text-align: left;">(39%)</td>
<td style="text-align: right;">0.27 ± 0.11</td>
<td style="text-align: left;">(13.9%)</td>
<td style="text-align: left;">(12%)</td>
<td style="text-align: right;">-0.023 ± 0.1</td>
<td style="text-align: left;">(4.8%)</td>
<td style="text-align: left;">(0.1%)</td>
</tr>
<tr class="odd">
<td style="text-align: left;"><span class="math inline">\(\delta\;^18\text{O}_\text{denitrification}\)</span></td>
<td style="text-align: right;">0.12 ± 0.057</td>
<td style="text-align: left;">(5.9%)</td>
<td style="text-align: left;">(1.9%)</td>
<td style="text-align: right;">0.2 ± 0.082</td>
<td style="text-align: left;">(10.4%)</td>
<td style="text-align: left;">(6.5%)</td>
<td style="text-align: right;">-0.12 ± 0.14</td>
<td style="text-align: left;">(9.3%)</td>
<td style="text-align: left;">(2.6%)</td>
</tr>
<tr class="even">
<td style="text-align: left;"><span class="math inline">\(\eta\;\text{SP}_{\text{reduction}}\)</span></td>
<td style="text-align: right;">0.32 ± 0.16</td>
<td style="text-align: left;">(15.8%)</td>
<td style="text-align: left;">(12%)</td>
<td style="text-align: right;">-0.16 ± 0.086</td>
<td style="text-align: left;">(8.3%)</td>
<td style="text-align: left;">(4.2%)</td>
<td style="text-align: right;">0.014 ± 0.052</td>
<td style="text-align: left;">(2.3%)</td>
<td style="text-align: left;">(0.039%)</td>
</tr>
<tr class="odd">
<td style="text-align: left;"><span class="math inline">\(\eta^{18}\text{O}_\text{reduction}\)</span></td>
<td style="text-align: right;">-0.48 ± 0.25</td>
<td style="text-align: left;">(22.9%)</td>
<td style="text-align: left;">(28%)</td>
<td style="text-align: right;">-0.67 ± 0.36</td>
<td style="text-align: left;">(37%)</td>
<td style="text-align: left;">(71%)</td>
<td style="text-align: right;">0.45 ± 0.43</td>
<td style="text-align: left;">(29.9%)</td>
<td style="text-align: left;">(38%)</td>
</tr>
<tr class="even">
<td style="text-align: left;"></td>
Expand Down
4 changes: 2 additions & 2 deletions sensitivity-analysis.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ Since the coefficients are standardized, they remove the unit dependence that ca
#| tbl-colwidths: [10,30,30,30]
df <- with(results, tapply(SRC, list(Parameter, Process), f))
VarExplained <- with(results, tapply(SRC, list(Parameter, Process), function(x) mean(abs(x), na.rm = TRUE)))
VarExplained <- with(results, tapply(SRC, list(Parameter, Process), function(x) mean(x, na.rm = TRUE)^2))
R2 <- with(results, tapply(R2, Process, mean, na.rm = TRUE))
for (i in 1:3) VarExplained[,i] <- VarExplained[,i]/(sum(VarExplained[,i])/R2[i])
g <- function(x) paste0("(",round(x*100,1),"%)")
g <- function(x) paste0("(",signif(x*100,2),"%)")
df <- cbind(df[,1], g(VarExplained[,1]), df[,2], g(VarExplained[,2]), df[,3], g(VarExplained[,3]))
df <- rbind(df, strrep("",6), adj.R2 = c(with(results, tapply(adjR2, Process, f)),"")[c(1,4,2,4,3,4)])
Expand Down

0 comments on commit da06594

Please sign in to comment.