aboutsummaryrefslogtreecommitdiff
path: root/R/mkinfit.R
AgeCommit message (Collapse)AuthorFilesLines
2022-11-16We get about 25% performance gainJohannes Ranke1-2/+15
with the custom lsoda call, avoiding repeated getNativeSymbolInfo calls. It's just that we should not be calling foreign functions from different packages, because the may change without notice. Using getNativeSymbolInfo for "call_lsoda" avoids the CRAN note, and a similar call could probably be used for "unlock_solver", avoiding the NOTE in checks for cran, but we should not do this in a CRAN package.
2022-10-18Don't fail if one of the Hessians can't be computedJohannes Ranke1-1/+8
2022-07-08Use inherits() instead of comparing class to stringJohannes Ranke1-1/+1
2022-03-01Avoid using cat() for default output, testsJohannes Ranke1-2/+2
2021-02-13Update for gmkin 0.6.12v1.0.2Johannes Ranke1-2/+9
mkinfit: Keep model names stored in mkinmod objects, avoiding their loss in gmkin
2021-02-04Documentation improvements, mainly fixing example codeJohannes Ranke1-0/+2
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.
2021-01-11Rebuild docsJohannes Ranke1-1/+1
2020-12-08mixed.mmkin and test coverageJohannes Ranke1-2/+2
2020-11-12mkindsg class to hold groups of datasetsJohannes Ranke1-1/+1
- D24_2014 dataset on aerobic soil degradation of 2,4-D from the EU assessment as mkindsg object with metadata - f_time_norm_focus() to do time-step normalisation using the FOCUS method - focus_soil_moisture data with default moisture contents at pF1, pF 2 and pF 2.5 for USDA soil types from FOCUS GW guidance - Dataset generation scripts in inst/dataset_generation - Depend on R >= 2.15.1 in order to facilitate the use of utils::globalVariables()
2020-11-06Fast analytical solutions for saemix, update.mmkinJohannes Ranke1-10/+8
Also, use logit transformation for g and for solitary formation fractions, addressing #10.
2020-11-03Do not test residuals per default, improve nlme.mmkinJohannes Ranke1-6/+10
Do not give starting values for random effects in nlme.mmkin.
2020-10-24Printing method for mmkin objectsJohannes Ranke1-3/+3
2020-07-17mkinfit: Ignore unused components of state.iniJohannes Ranke1-1/+2
2020-07-15Improve testsJohannes Ranke1-1/+1
- Reduce significant digits for the objective function output in mkinfit(..., quiet = FALSE) as R and R-devel gave different output on my system - Add makefile target 'devtest' for testing with R-devel, in order to fix problems showing up with R-devel on Travis
2020-07-15Improve handling of (partially) failing fitsJohannes Ranke1-20/+26
2020-06-15Fix a bug, update for current vdiffrJohannes Ranke1-1/+1
Vignette FOCUS_L failed as I had introduced a bug in the handling of warnings. Current vdiffr only runs visual tests if R < 4.1.0, skipping r-devel for now, see https://github.com/r-lib/vdiffr/commit/630a29d013361fd63fea242f531e2db6aef37919
2020-05-29Improve handling of warnings, reorganize testsJohannes Ranke1-7/+20
2020-05-29Warn if standardized residuals are unlikely normalJohannes Ranke1-46/+54
This revealed a bug in the data returned in mkinfit$data in the case of the d_3 algorithm, which also affected the residual plot - the data from the direct fitting was not returned even if this was the better method.
2020-05-28use_of_ff = "max" for shorthand models like "SFO"Johannes Ranke1-1/+1
2020-05-15Use markdown links in mkinfit documentationJohannes Ranke1-24/+24
2020-05-12Another documentation updateJohannes Ranke1-9/+8
2020-05-12Improve documentation, now using a spell checkerJohannes Ranke1-1/+1
2020-05-12Documentation improvements, rebuild static docsJohannes Ranke1-3/+7
2020-05-11Analytical solutions for all SFO variantsJohannes Ranke1-0/+1
2020-05-11Reduce precision of traced parameters, formattingJohannes Ranke1-2/+2
2020-05-11Avoid merge() and data.frame() in cost functionJohannes Ranke1-6/+2
also for deSolve and eigenvalue based solutions. This noticeably increases performance for these methods, see test.log and benchmark vignette.
2020-05-10Default to analytical for coupled models if availableJohannes Ranke1-2/+2
This revealed that transforming rates is necessary for fitting the analytical solution of the SFO-SFO model to the FOCUS D dataset. Benchmarks show that fitting coupled models with deSolve got a bit slower through the latest changes
2020-05-09Avoid the call to merge for analytical solutionsJohannes Ranke1-38/+37
This increases performance up to a factor of five!
2020-05-08Profiling suggests the merge in mkinfit is the bottleneckJohannes Ranke1-0/+3
2020-05-08We do not need the n.outtimes argument for mkinfitJohannes Ranke1-10/+3
As we set the tolerance for ode() appropriately
2020-05-08Avoid duplicate merge in tc error model fitJohannes Ranke1-10/+7
This increases the performance in the complete test suite by about 20 secs from 120 to around 100 secs. I tried improving merge speed by using data.table on another branch, but this did not give a noticeable performance gain.
2020-05-08Slight performance gain by reducing default n.outtimesJohannes Ranke1-2/+2
2020-05-08Analytical SFO_SFO about as fast as deSolve compiledJohannes Ranke1-2/+2
2020-05-07Another overhaul of analytical solutionsJohannes Ranke1-1/+1
Still in preparation for analytical solutions of coupled models
2020-05-06Change implementation of analytical solutionsJohannes Ranke1-3/+3
Preparing for symbolic solutions for more than one compound
2020-04-22Support SFORB with formation fractionsJohannes Ranke1-4/+5
2019-11-01Fix bug in yesterdays release, add methods for BICJohannes Ranke1-0/+2
2019-10-31Add likelihood ratio test and other methods, fixesJohannes Ranke1-13/+39
The likelihood ratio test method is lrtest, in addition, methods for update and residuals were added.
2019-10-26parms and confint methodsJohannes Ranke1-22/+27
The confint method can do profile likelihood based confidence intervals!
2019-10-25Use roxygen for functions and methodsJohannes Ranke1-904/+897
2019-10-22Go back to d_3 for errmod = "obs"Johannes Ranke1-1/+1
in the hope that this makes plotting cross-platform also for this error model
2019-10-21Refactor mkinfit, infrastructure workJohannes Ranke1-153/+175
mkinfit objects now include an ll() function to calculate the log-likelihood. Part of the code was refactored, hopefully making it easier to read and maintain. IRLS is currently the default algorithm for the error model "obs", for no particular reason. This may be subject to change when I get around to investigate. Slow tests are now in a separate subdirectory and will probably only be run by my own Makefile target. Formatting of test logs is improved. Roundtripping error model parameters works with a precision of 10% when we use lots of replicates in the synthetic data (see slow tests). This is not new in this commit, but as I think it is reasonable this closes #7.
2019-07-09Adaptations for gmkinJohannes Ranke1-1/+3
Address winbuilder check problems, update check log, update of static docs
2019-07-08Support summarizing older fitsJohannes Ranke1-8/+10
generated with mkin < 0.9.49.5
2019-07-05Static documentation rebuilt by pkgdownJohannes Ranke1-0/+1
2019-06-05Add error model algorithm to outputJohannes Ranke1-8/+19
2019-06-04Fix a bug introduced in the last commitJohannes Ranke1-2/+4
2019-06-04For the d_3 algorithm, report which was better, if anyJohannes Ranke1-2/+13
2019-06-04Additional algorithm "d_c", more tests, docsJohannes Ranke1-46/+71
The new algorithm tries direct optimization of the likelihood, as well as a three step procedure. In this way, we consistently get the model with the highest likelihood for SFO, DFOP and HS for all 12 new test datasets.
2019-06-04Algorithms direct, two-, three-, fourstep, IRLSJohannes Ranke1-9/+41
All of them are working now and allow for comparison Based on SFO, DFOP and HS fits to twelve test datasets, only the combination of direct and threestep is needed to find the lowest AIC

Contact - Imprint