diff options
Diffstat (limited to 'docs/reference/mmkin.html')
-rw-r--r-- | docs/reference/mmkin.html | 63 |
1 files changed, 42 insertions, 21 deletions
diff --git a/docs/reference/mmkin.html b/docs/reference/mmkin.html index 7a01313f..20134030 100644 --- a/docs/reference/mmkin.html +++ b/docs/reference/mmkin.html @@ -75,7 +75,7 @@ datasets specified in its first two arguments." /> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.0.0</span> </span> </div> @@ -124,7 +124,7 @@ datasets specified in its first two arguments." /> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jranke/mkin/"> - <span class="fab fa fab fa-github fa-lg"></span> + <span class="fab fa-github fa-lg"></span> </a> </li> @@ -155,7 +155,7 @@ datasets specified in its first two arguments.</p> <pre class="usage"><span class='fu'>mmkin</span><span class='op'>(</span> models <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span>, <span class='va'>datasets</span>, - cores <span class='op'>=</span> <span class='fu'>detectCores</span><span class='op'>(</span><span class='op'>)</span>, + cores <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>, cluster <span class='op'>=</span> <span class='cn'>NULL</span>, <span class='va'>...</span> <span class='op'>)</span></pre> @@ -210,37 +210,36 @@ plotting.</p></div> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> <span class='co'># \dontrun{</span> -<span class='va'>m_synth_SFO_lin</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='mkinsub.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='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"M2"</span><span class='op'>)</span>, - M2 <span class='op'>=</span> <span class='fu'><a href='mkinsub.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><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> -<span class='va'>m_synth_FOMC_lin</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='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='st'>"M1"</span><span class='op'>)</span>, - M1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"M2"</span><span class='op'>)</span>, - M2 <span class='op'>=</span> <span class='fu'><a href='mkinsub.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><span class='op'>)</span> -</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> +<span class='va'>m_synth_SFO_lin</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='st'>"M2"</span><span class='op'>)</span>, + M2 <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><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> +<span class='va'>m_synth_FOMC_lin</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'>"FOMC"</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='st'>"M2"</span><span class='op'>)</span>, + M2 <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><span class='op'>)</span> +</div><div class='output co'>#> <span class='message'>Temporary DLL for differentials generated and loaded</span></div><div class='input'> <span class='va'>models</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>SFO_lin <span class='op'>=</span> <span class='va'>m_synth_SFO_lin</span>, FOMC_lin <span class='op'>=</span> <span class='va'>m_synth_FOMC_lin</span><span class='op'>)</span> <span class='va'>datasets</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>synthetic_data_for_UBA_2014</span><span class='op'>[</span><span class='fl'>1</span><span class='op'>:</span><span class='fl'>3</span><span class='op'>]</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='va'>datasets</span><span class='op'>)</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Dataset"</span>, <span class='fl'>1</span><span class='op'>:</span><span class='fl'>3</span><span class='op'>)</span> <span class='va'>time_default</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'>fits.0</span> <span class='op'><-</span> <span class='fu'>mmkin</span><span class='op'>(</span><span class='va'>models</span>, <span class='va'>datasets</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span><span class='op'>)</span> <span class='va'>time_1</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'>fits.4</span> <span class='op'><-</span> <span class='fu'>mmkin</span><span class='op'>(</span><span class='va'>models</span>, <span class='va'>datasets</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'>#> <span class='warning'>Warning: Optimisation did not converge:</span> -#> <span class='warning'>false convergence (8)</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0117</span></div><div class='output co'>#> <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0174</span></div><div class='input'> + <span class='va'>time_default</span> </div><div class='output co'>#> user system elapsed -#> 4.828 0.413 1.467 </div><div class='input'><span class='va'>time_1</span> +#> 4.869 0.357 1.415 </div><div class='input'><span class='va'>time_1</span> </div><div class='output co'>#> user system elapsed -#> 5.228 0.000 5.231 </div><div class='input'> +#> 5.502 0.002 5.507 </div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>fits.0</span><span class='op'>[[</span><span class='st'>"SFO_lin"</span>, <span class='fl'>2</span><span class='op'>]</span><span class='op'>]</span><span class='op'>)</span> </div><div class='output co'>#> $ff #> parent_M1 parent_sink M1_M2 M1_sink -#> 0.7340478 0.2659522 0.7505691 0.2494309 +#> 0.7340478 0.2659522 0.7505687 0.2494313 #> #> $distimes -#> DT50 DT90 -#> parent 0.8777688 2.915885 -#> M1 2.3257466 7.725963 -#> M2 33.7200800 112.015681 +#> DT50 DT90 +#> parent 0.877769 2.915885 +#> M1 2.325746 7.725960 +#> M2 33.720083 112.015691 #> </div><div class='input'> <span class='co'># plot.mkinfit handles rows or columns of mmkin result objects</span> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>fits.0</span><span class='op'>[</span><span class='fl'>1</span>, <span class='op'>]</span><span class='op'>)</span> @@ -253,7 +252,29 @@ plotting.</p></div> <span class='co'># Plotting with mmkin (single brackets, extracting an mmkin object) does not</span> <span class='co'># allow to plot the observed variables separately</span> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>fits.0</span><span class='op'>[</span><span class='fl'>1</span>, <span class='fl'>1</span><span class='op'>]</span><span class='op'>)</span> -</div><div class='img'><img src='mmkin-5.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># }</span> +</div><div class='img'><img src='mmkin-5.png' alt='' width='700' height='433' /></div><div class='input'> +<span class='co'># On Windows, we can use multiple cores by making a cluster using the parallel</span> +<span class='co'># package, which gets loaded with mkin, and passing it to mmkin, e.g.</span> +<span class='va'>cl</span> <span class='op'><-</span> <span class='fu'>makePSOCKcluster</span><span class='op'>(</span><span class='fl'>12</span><span class='op'>)</span> +<span class='va'>f</span> <span class='op'><-</span> <span class='fu'>mmkin</span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span>, + <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>A <span class='op'>=</span> <span class='va'>FOCUS_2006_A</span>, B <span class='op'>=</span> <span class='va'>FOCUS_2006_B</span>, C <span class='op'>=</span> <span class='va'>FOCUS_2006_C</span>, D <span class='op'>=</span> <span class='va'>FOCUS_2006_D</span><span class='op'>)</span>, + cluster <span class='op'>=</span> <span class='va'>cl</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/print.html'>print</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>)</span> +</div><div class='output co'>#> <mmkin> object +#> Status of individual fits: +#> +#> dataset +#> model A B C D +#> SFO OK OK OK OK +#> FOMC C OK OK OK +#> DFOP OK OK OK OK +#> +#> OK: No warnings +#> C: Optimisation did not converge: +#> false convergence (8)</div><div class='input'><span class='co'># We get false convergence for the FOMC fit to FOCUS_2006_A because this</span> +<span class='co'># dataset is really SFO, and the FOMC fit is overparameterised</span> +<span class='fu'>stopCluster</span><span class='op'>(</span><span class='va'>cl</span><span class='op'>)</span> +<span class='co'># }</span> </div></pre> </div> |