diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2020-10-15 14:55:55 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2020-10-15 14:55:55 +0200 |
commit | a9c7a1a8322567e9406a59ba0a4f910b89bd05e6 (patch) | |
tree | 27803cef655ecbd4c1d40fe8f9fb256c5896f5e6 /docs/dev/reference/saemix.html | |
parent | f4f6cc84d32e135b03300bf78578f1981c489bfe (diff) |
More gentle example for saemix with combined error model
Diffstat (limited to 'docs/dev/reference/saemix.html')
-rw-r--r-- | docs/dev/reference/saemix.html | 88 |
1 files changed, 42 insertions, 46 deletions
diff --git a/docs/dev/reference/saemix.html b/docs/dev/reference/saemix.html index 5b160959..2c4fd2d7 100644 --- a/docs/dev/reference/saemix.html +++ b/docs/dev/reference/saemix.html @@ -237,8 +237,8 @@ variances of the deviations of the parameters from these mean values.</p> #> res <- unlist(res_list) #> return(res) #> } -#> <bytecode: 0x55555c1e7720> -#> <environment: 0x55555c1eff38> +#> <bytecode: 0x555555c89340> +#> <environment: 0x555555c82680> #> Nb of parameters: 4 #> parameter names: parent_0 log_k_parent log_k_A1 f_parent_ilr_1 #> distribution: @@ -271,10 +271,10 @@ variances of the deviations of the parameters from these mean values.</p> nbiter.saemix <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='fl'>200</span>, <span class='fl'>80</span><span class='op'>)</span><span class='op'>)</span> <span class='va'>f_saemix</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/saemix/man/saemix.html'>saemix</a></span><span class='op'>(</span><span class='va'>m_saemix</span>, <span class='va'>d_saemix</span>, <span class='va'>saemix_options</span><span class='op'>)</span> </div><div class='output co'>#> Running main SAEM algorithm -#> [1] "Thu Oct 15 11:55:14 2020" +#> [1] "Thu Oct 15 14:51:26 2020" #> .. #> Minimisation finished -#> [1] "Thu Oct 15 11:57:07 2020"</div><div class='img'><img src='saemix-1.png' alt='' width='700' height='433' /></div><div class='output co'>#> Nonlinear mixed-effects model fit by the SAEM algorithm +#> [1] "Thu Oct 15 14:53:18 2020"</div><div class='img'><img src='saemix-1.png' alt='' width='700' height='433' /></div><div class='output co'>#> Nonlinear mixed-effects model fit by the SAEM algorithm #> ----------------------------------- #> ---- Data ---- #> ----------------------------------- @@ -338,8 +338,8 @@ variances of the deviations of the parameters from these mean values.</p> #> res <- unlist(res_list) #> return(res) #> } -#> <bytecode: 0x55555c1e7720> -#> <environment: 0x55555c1eff38> +#> <bytecode: 0x555555c89340> +#> <environment: 0x555555c82680> #> Nb of parameters: 4 #> parameter names: parent_0 log_k_parent log_k_A1 f_parent_ilr_1 #> distribution: @@ -423,7 +423,7 @@ variances of the deviations of the parameters from these mean values.</p> </div><div class='output co'>#> Plotting convergence plots</div><div class='img'><img src='saemix-2.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># }</span> <span class='co'># Synthetic data with two-component error</span> <span class='va'>sampling_times</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='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>3</span>, <span class='fl'>7</span>, <span class='fl'>14</span>, <span class='fl'>28</span>, <span class='fl'>60</span>, <span class='fl'>90</span>, <span class='fl'>120</span><span class='op'>)</span> -<span class='va'>dt50_sfo_in</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='fl'>800</span>, <span class='fl'>900</span>, <span class='fl'>1000</span>, <span class='fl'>1111.11</span>, <span class='fl'>1250</span><span class='op'>)</span> +<span class='va'>dt50_sfo_in</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='fl'>80</span>, <span class='fl'>90</span>, <span class='fl'>100</span>, <span class='fl'>111.111</span>, <span class='fl'>125</span><span class='op'>)</span> <span class='va'>k_in</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>log</a></span><span class='op'>(</span><span class='fl'>2</span><span class='op'>)</span> <span class='op'>/</span> <span class='va'>dt50_sfo_in</span> <span class='va'>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='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span><span class='op'>)</span> @@ -439,7 +439,9 @@ variances of the deviations of the parameters from these mean values.</p> <span class='fu'><a href='add_err.html'>add_err</a></span><span class='op'>(</span><span class='va'>ds</span>, sdfunc <span class='op'>=</span> <span class='kw'>function</span><span class='op'>(</span><span class='va'>value</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/MathFun.html'>sqrt</a></span><span class='op'>(</span><span class='fl'>1</span><span class='op'>^</span><span class='fl'>2</span> <span class='op'>+</span> <span class='va'>value</span><span class='op'>^</span><span class='fl'>2</span> <span class='op'>*</span> <span class='fl'>0.07</span><span class='op'>^</span><span class='fl'>2</span><span class='op'>)</span>, n <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span><span class='op'>[[</span><span class='fl'>1</span><span class='op'>]</span><span class='op'>]</span> <span class='op'>}</span><span class='op'>)</span> +<span class='co'># \dontrun{</span> <span class='va'>f_mmkin_syn</span> <span class='op'><-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='va'>ds_sfo_syn</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span> +<span class='co'># plot(f_mmkin_syn)</span> <span class='va'>m_saemix_tc</span> <span class='op'><-</span> <span class='fu'>saemix_model</span><span class='op'>(</span><span class='va'>f_mmkin_syn</span>, cores <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span> </div><div class='output co'>#> #> @@ -481,8 +483,8 @@ variances of the deviations of the parameters from these mean values.</p> #> res <- unlist(res_list) #> return(res) #> } -#> <bytecode: 0x55555c1e7720> -#> <environment: 0x55555be5b848> +#> <bytecode: 0x555555c89340> +#> <environment: 0x55555df58cf8> #> Nb of parameters: 2 #> parameter names: parent_0 log_k_parent #> distribution: @@ -493,11 +495,11 @@ variances of the deviations of the parameters from these mean values.</p> #> parent_0 log_k_parent #> parent_0 1 0 #> log_k_parent 0 1 -#> Error model: combined , initial values: a.1=2.4206146215511 b.1=0.03831266409084 +#> Error model: combined , initial values: a.1=1.05209877924905 b.1=0.0586479225303944 #> No covariate in the model. #> Initial values #> parent_0 log_k_parent -#> Pop.CondInit 100.2498 -9.33922</div><div class='input'><span class='va'>d_saemix_tc</span> <span class='op'><-</span> <span class='fu'>saemix_data</span><span class='op'>(</span><span class='va'>f_mmkin_syn</span><span class='op'>)</span> +#> Pop.CondInit 100.315 -4.962075</div><div class='input'><span class='va'>d_saemix_tc</span> <span class='op'><-</span> <span class='fu'>saemix_data</span><span class='op'>(</span><span class='va'>f_mmkin_syn</span><span class='op'>)</span> </div><div class='output co'>#> #> #> The following SaemixData object was successfully created: @@ -508,16 +510,10 @@ variances of the deviations of the parameters from these mean values.</p> #> Structured data: value ~ time + name | ds #> X variable for graphs: time () </div><div class='input'><span class='va'>f_saemix_tc</span> <span class='op'><-</span> <span class='fu'><a href='https://rdrr.io/pkg/saemix/man/saemix.html'>saemix</a></span><span class='op'>(</span><span class='va'>m_saemix_tc</span>, <span class='va'>d_saemix_tc</span>, <span class='va'>saemix_options</span><span class='op'>)</span> </div><div class='output co'>#> Running main SAEM algorithm -#> [1] "Thu Oct 15 11:57:25 2020" +#> [1] "Thu Oct 15 14:53:35 2020" #> .. #> Minimisation finished -#> [1] "Thu Oct 15 11:58:16 2020" -#> Error in solve.default(Fth) : -#> Lapack routine dgesv: system is exactly singular: U[2,2] = 0 -#> Error computing the Fisher Information Matrix: singular system. -#> Error in solve.default(FO) : -#> Lapack routine dgesv: system is exactly singular: U[2,2] = 0 -#> Error computing the Fisher Information Matrix: singular system.</div><div class='output co'>#> Nonlinear mixed-effects model fit by the SAEM algorithm +#> [1] "Thu Oct 15 14:54:25 2020"</div><div class='output co'>#> Nonlinear mixed-effects model fit by the SAEM algorithm #> ----------------------------------- #> ---- Data ---- #> ----------------------------------- @@ -534,14 +530,14 @@ variances of the deviations of the parameters from these mean values.</p> #> ds time name value mdv cens occ ytype #> 1 1 0 parent 105.9 0 0 1 1 #> 2 1 0 parent 98.0 0 0 1 1 -#> 3 1 1 parent 97.4 0 0 1 1 -#> 4 1 1 parent 100.5 0 0 1 1 -#> 5 1 3 parent 115.6 0 0 1 1 -#> 6 1 3 parent 105.6 0 0 1 1 -#> 7 1 7 parent 108.6 0 0 1 1 -#> 8 1 7 parent 117.0 0 0 1 1 -#> 9 1 14 parent 107.0 0 0 1 1 -#> 10 1 14 parent 95.8 0 0 1 1 +#> 3 1 1 parent 96.6 0 0 1 1 +#> 4 1 1 parent 99.8 0 0 1 1 +#> 5 1 3 parent 113.0 0 0 1 1 +#> 6 1 3 parent 103.2 0 0 1 1 +#> 7 1 7 parent 102.9 0 0 1 1 +#> 8 1 7 parent 110.8 0 0 1 1 +#> 9 1 14 parent 95.9 0 0 1 1 +#> 10 1 14 parent 85.9 0 0 1 1 #> ----------------------------------- #> ---- Model ---- #> ----------------------------------- @@ -581,8 +577,8 @@ variances of the deviations of the parameters from these mean values.</p> #> res <- unlist(res_list) #> return(res) #> } -#> <bytecode: 0x55555c1e7720> -#> <environment: 0x55555be5b848> +#> <bytecode: 0x555555c89340> +#> <environment: 0x55555df58cf8> #> Nb of parameters: 2 #> parameter names: parent_0 log_k_parent #> distribution: @@ -593,11 +589,11 @@ variances of the deviations of the parameters from these mean values.</p> #> parent_0 log_k_parent #> parent_0 1 0 #> log_k_parent 0 1 -#> Error model: combined , initial values: a.1=2.4206146215511 b.1=0.03831266409084 +#> Error model: combined , initial values: a.1=1.05209877924905 b.1=0.0586479225303944 #> No covariate in the model. #> Initial values #> parent_0 log_k_parent -#> Pop.CondInit 100.2498 -9.33922 +#> Pop.CondInit 100.315 -4.962075 #> ----------------------------------- #> ---- Key algorithm options ---- #> ----------------------------------- @@ -619,17 +615,17 @@ variances of the deviations of the parameters from these mean values.</p> #> ---------------------------------------------------- #> ----------------- Fixed effects ------------------ #> ---------------------------------------------------- -#> Parameter Estimate SE CV(%) -#> parent_0 97.44 <NA> <NA> -#> log_k_parent -56.97 <NA> <NA> -#> a a.1 -7.12 <NA> <NA> -#> b b.1 0.15 <NA> <NA> +#> Parameter Estimate SE CV(%) +#> parent_0 100.232 1.266 1.3 +#> log_k_parent -4.961 0.089 1.8 +#> a a.1 -0.106 1.211 1142.0 +#> b b.1 0.071 0.017 24.2 #> ---------------------------------------------------- #> ----------- Variance of random effects ----------- #> ---------------------------------------------------- -#> Parameter Estimate SE CV(%) -#> parent_0 omega2.parent_0 2.8 NA NA -#> log_k_parent omega2.log_k_parent 750.3 NA NA +#> Parameter Estimate SE CV(%) +#> parent_0 omega2.parent_0 3.334 5.024 151 +#> log_k_parent omega2.log_k_parent 0.036 0.024 68 #> ---------------------------------------------------- #> ------ Correlation matrix of random effects ------ #> ---------------------------------------------------- @@ -640,16 +636,16 @@ variances of the deviations of the parameters from these mean values.</p> #> --------------- Statistical criteria ------------- #> ---------------------------------------------------- #> Likelihood computed by linearisation -#> -2LL= 623.7744 -#> AIC = 635.7744 -#> BIC = 633.431 +#> -2LL= 575.5586 +#> AIC = 587.5586 +#> BIC = 585.2153 #> #> Likelihood computed by importance sampling -#> -2LL= 621.1909 -#> AIC = 633.1909 -#> BIC = 630.8475 +#> -2LL= 575.7797 +#> AIC = 587.7797 +#> BIC = 585.4364 #> ----------------------------------------------------</div><div class='input'><span class='fu'><a href='https://rdrr.io/pkg/saemix/man/plot-SaemixObject-method.html'>plot</a></span><span class='op'>(</span><span class='va'>f_saemix_tc</span>, plot.type <span class='op'>=</span> <span class='st'>"convergence"</span><span class='op'>)</span> -</div><div class='img'><img src='saemix-3.png' alt='' width='700' height='433' /></div><div class='output co'>#> Plotting convergence plots</div><div class='img'><img src='saemix-4.png' alt='' width='700' height='433' /></div><div class='input'> +</div><div class='img'><img src='saemix-3.png' alt='' width='700' height='433' /></div><div class='output co'>#> Plotting convergence plots</div><div class='img'><img src='saemix-4.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># }</span> </div></pre> </div> <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> |