diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2021-02-04 11:24:22 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2021-02-04 11:41:06 +0100 |
commit | ac183c732317cf6ede26a2ee127604a407f0a6b3 (patch) | |
tree | 2283709a2e01206af576a9cf324f54fbfab972d0 /docs/reference/confint.mkinfit.html | |
parent | 83798cce97e73ec3bfd11b8cb4e2929e5089aaeb (diff) |
Documentation improvements, mainly fixing example code
The errors in the example code were in the \dontrun sections, so they
were not caught by CRAN checks. In addition, the static help files
generated with pkgdown were cached, so I noticed the errors only
after completely regenerating the documentation for version 1.0.0.
Diffstat (limited to 'docs/reference/confint.mkinfit.html')
-rw-r--r-- | docs/reference/confint.mkinfit.html | 85 |
1 files changed, 43 insertions, 42 deletions
diff --git a/docs/reference/confint.mkinfit.html b/docs/reference/confint.mkinfit.html index 4f7e8872..b71e039a 100644 --- a/docs/reference/confint.mkinfit.html +++ b/docs/reference/confint.mkinfit.html @@ -273,68 +273,69 @@ Profile-Likelihood Based Confidence Intervals, Applied Statistics, 37, <span class='kw'>if</span> <span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/identical.html'>identical</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/Sys.getenv.html'>Sys.getenv</a></span><span class='op'>(</span><span class='st'>"NOT_CRAN"</span><span class='op'>)</span>, <span class='st'>"true"</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span> <span class='va'>n_cores</span> <span class='op'><-</span> <span class='fu'>parallel</span><span class='fu'>::</span><span class='fu'><a href='https://rdrr.io/r/parallel/detectCores.html'>detectCores</a></span><span class='op'>(</span><span class='op'>)</span> <span class='op'>-</span> <span class='fl'>1</span> <span class='op'>}</span> <span class='kw'>else</span> <span class='op'>{</span> - <span class='va'>n_cores</span> <span class='op'><-</span> <span class='fl'>1</span> + <span class='va'>n_cores</span> <span class='op'><-</span> <span class='fl'>1</span> <span class='op'>}</span> <span class='kw'>if</span> <span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/Sys.getenv.html'>Sys.getenv</a></span><span class='op'>(</span><span class='st'>"TRAVIS"</span><span class='op'>)</span> <span class='op'>!=</span> <span class='st'>""</span><span class='op'>)</span> <span class='va'>n_cores</span> <span class='op'>=</span> <span class='fl'>1</span> <span class='kw'>if</span> <span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/Sys.info.html'>Sys.info</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>[</span><span class='st'>"sysname"</span><span class='op'>]</span> <span class='op'>==</span> <span class='st'>"Windows"</span><span class='op'>)</span> <span class='va'>n_cores</span> <span class='op'>=</span> <span class='fl'>1</span> -<span class='va'>SFO_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='va'>SFO_SFO</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, + use_of_ff <span class='op'>=</span> <span class='st'>"min"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> <span class='va'>SFO_SFO.ff</span> <span class='op'><-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"m1"</span><span class='op'>)</span>, m1 <span class='op'>=</span> <span class='fu'><a href='mkinmod.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> <span class='va'>f_d_1</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_D</span>, <span class='va'>value</span> <span class='op'>!=</span> <span class='fl'>0</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/system.time.html'>system.time</a></span><span class='op'>(</span><span class='va'>ci_profile</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"profile"</span>, cores <span class='op'>=</span> <span class='fl'>1</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span><span class='op'>)</span> </div><div class='output co'>#> user system elapsed -#> 3.796 1.056 3.506 </div><div class='input'><span class='co'># Using more cores does not save much time here, as parent_0 takes up most of the time</span> +#> 4.324 0.980 3.960 </div><div class='input'><span class='co'># Using more cores does not save much time here, as parent_0 takes up most of the time</span> <span class='co'># If we additionally exclude parent_0 (the confidence of which is often of</span> -<span class='co'># minor interest), we get a nice performance improvement from about 50</span> -<span class='co'># seconds to about 12 seconds if we use at least four cores</span> +<span class='co'># minor interest), we get a nice performance improvement if we use at least 4 cores</span> <span class='fu'><a href='https://rdrr.io/r/base/system.time.html'>system.time</a></span><span class='op'>(</span><span class='va'>ci_profile_no_parent_0</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"profile"</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"k_parent_sink"</span>, <span class='st'>"k_parent_m1"</span>, <span class='st'>"k_m1_sink"</span>, <span class='st'>"sigma"</span><span class='op'>)</span>, cores <span class='op'>=</span> <span class='va'>n_cores</span><span class='op'>)</span><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Profiling the likelihood</span></div><div class='output co'>#> <span class='warning'>Warning: scheduled cores 2, 1, 3 encountered errors in user code, all values of the jobs will be affected</span></div><div class='output co'>#> <span class='error'>Error in dimnames(x) <- dn: length of 'dimnames' [2] not equal to array extent</span></div><div class='output co'>#> <span class='message'>Timing stopped at: 0 0.043 0.246</span></div><div class='input'><span class='va'>ci_profile</span> -</div><div class='output co'>#> 2.5% 97.5% -#> parent_0 96.456003640 1.027703e+02 -#> k_parent 0.090911032 1.071578e-01 -#> k_m1 0.003892606 6.702775e-03 -#> f_parent_to_m1 0.471328495 5.611550e-01 -#> sigma 2.535612399 3.985263e+00</div><div class='input'><span class='va'>ci_quadratic_transformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Profiling the likelihood</span></div><div class='output co'>#> user system elapsed +#> 1.480 0.109 0.905 </div><div class='input'><span class='va'>ci_profile</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 96.456003640 1.027703e+02 +#> k_parent_sink 0.040762501 5.549764e-02 +#> k_parent_m1 0.046786482 5.500879e-02 +#> k_m1_sink 0.003892605 6.702778e-03 +#> sigma 2.535612399 3.985263e+00</div><div class='input'><span class='va'>ci_quadratic_transformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span><span class='op'>)</span> <span class='va'>ci_quadratic_transformed</span> -</div><div class='output co'>#> 2.5% 97.5% -#> parent_0 96.403833585 102.79311650 -#> k_parent 0.090823771 0.10725430 -#> k_m1 0.004012219 0.00689755 -#> f_parent_to_m1 0.469118824 0.55959615 -#> sigma 2.396089689 3.85491806</div><div class='input'><span class='va'>ci_quadratic_untransformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span>, transformed <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 96.403841640 1.027931e+02 +#> k_parent_sink 0.041033378 5.596269e-02 +#> k_parent_m1 0.046777902 5.511931e-02 +#> k_m1_sink 0.004012217 6.897547e-03 +#> sigma 2.396089689 3.854918e+00</div><div class='input'><span class='va'>ci_quadratic_untransformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/stats/confint.html'>confint</a></span><span class='op'>(</span><span class='va'>f_d_1</span>, method <span class='op'>=</span> <span class='st'>"quadratic"</span>, transformed <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span> <span class='va'>ci_quadratic_untransformed</span> -</div><div class='output co'>#> 2.5% 97.5% -#> parent_0 96.403833589 1.027931e+02 -#> k_parent 0.090491913 1.069035e-01 -#> k_m1 0.003835485 6.685823e-03 -#> f_parent_to_m1 0.469113477 5.598387e-01 -#> sigma 2.396089689 3.854918e+00</div><div class='input'><span class='co'># Against the expectation based on Bates and Watts (1988), the confidence</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 96.403841645 102.79312449 +#> k_parent_sink 0.040485331 0.05535491 +#> k_parent_m1 0.046611582 0.05494364 +#> k_m1_sink 0.003835483 0.00668582 +#> sigma 2.396089689 3.85491806</div><div class='input'><span class='co'># Against the expectation based on Bates and Watts (1988), the confidence</span> <span class='co'># intervals based on the internal parameter transformation are less</span> <span class='co'># congruent with the likelihood based intervals. Note the superiority of the</span> <span class='co'># interval based on the untransformed fit for k_m1_sink</span> <span class='va'>rel_diffs_transformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>abs</a></span><span class='op'>(</span><span class='op'>(</span><span class='va'>ci_quadratic_transformed</span> <span class='op'>-</span> <span class='va'>ci_profile</span><span class='op'>)</span><span class='op'>/</span><span class='va'>ci_profile</span><span class='op'>)</span> <span class='va'>rel_diffs_untransformed</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>abs</a></span><span class='op'>(</span><span class='op'>(</span><span class='va'>ci_quadratic_untransformed</span> <span class='op'>-</span> <span class='va'>ci_profile</span><span class='op'>)</span><span class='op'>/</span><span class='va'>ci_profile</span><span class='op'>)</span> <span class='va'>rel_diffs_transformed</span> <span class='op'><</span> <span class='va'>rel_diffs_untransformed</span> -</div><div class='output co'>#> 2.5% 97.5% -#> parent_0 FALSE FALSE -#> k_parent TRUE TRUE -#> k_m1 FALSE FALSE -#> f_parent_to_m1 TRUE FALSE -#> sigma TRUE FALSE</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/Round.html'>signif</a></span><span class='op'>(</span><span class='va'>rel_diffs_transformed</span>, <span class='fl'>3</span><span class='op'>)</span> -</div><div class='output co'>#> 2.5% 97.5% -#> parent_0 0.000541 0.000222 -#> k_parent 0.000960 0.000900 -#> k_m1 0.030700 0.029100 -#> f_parent_to_m1 0.004690 0.002780 -#> sigma 0.055000 0.032700</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/Round.html'>signif</a></span><span class='op'>(</span><span class='va'>rel_diffs_untransformed</span>, <span class='fl'>3</span><span class='op'>)</span> -</div><div class='output co'>#> 2.5% 97.5% -#> parent_0 0.000541 0.000222 -#> k_parent 0.004610 0.002370 -#> k_m1 0.014700 0.002530 -#> f_parent_to_m1 0.004700 0.002350 -#> sigma 0.055000 0.032700</div><div class='input'> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 FALSE FALSE +#> k_parent_sink TRUE FALSE +#> k_parent_m1 TRUE FALSE +#> k_m1_sink FALSE FALSE +#> sigma FALSE FALSE</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/Round.html'>signif</a></span><span class='op'>(</span><span class='va'>rel_diffs_transformed</span>, <span class='fl'>3</span><span class='op'>)</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 0.000541 0.000222 +#> k_parent_sink 0.006650 0.008380 +#> k_parent_m1 0.000183 0.002010 +#> k_m1_sink 0.030700 0.029100 +#> sigma 0.055000 0.032700</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/Round.html'>signif</a></span><span class='op'>(</span><span class='va'>rel_diffs_untransformed</span>, <span class='fl'>3</span><span class='op'>)</span> +</div><div class='output co'>#> 2.5% 97.5% +#> parent_0 0.000541 0.000222 +#> k_parent_sink 0.006800 0.002570 +#> k_parent_m1 0.003740 0.001180 +#> k_m1_sink 0.014700 0.002530 +#> sigma 0.055000 0.032700</div><div class='input'> <span class='co'># Investigate a case with formation fractions</span> <span class='va'>f_d_2</span> <span class='op'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='va'>SFO_SFO.ff</span>, <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>FOCUS_2006_D</span>, <span class='va'>value</span> <span class='op'>!=</span> <span class='fl'>0</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> |