aboutsummaryrefslogtreecommitdiff
path: root/R/mkinfit.R
AgeCommit message (Collapse)AuthorFilesLines
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
2019-06-03Status von Samstag morgen - untestedJohannes Ranke1-37/+63
2019-05-23Fix a bug that could lead to wrong chi2 error levelsJohannes Ranke1-0/+1
2019-05-07Fix hessian calculationsJohannes Ranke1-7/+8
Static documentation rebuilt by pkgdown
2019-05-07After the OLS step, use OLS parameter estimatesJohannes Ranke1-24/+24
- Fix the respective error in the code - Static documentation rebuilt by pkgdown
2019-05-03Improve error model fittingJohannes Ranke1-14/+36
Now we have a three stage fitting process for nonconstant error models: - Unweighted least squares - Only optimize the error model - Optimize both Static documentation rebuilt by pkgdown
2019-05-02Better initials for error model parametersJohannes Ranke1-8/+21
- Also make it possible to specify initial values for error model parameters. - Run tests - Rebuild docs
2019-04-24Improve output and update testsJohannes Ranke1-5/+9
Remove skipped tests as I do not intend to reactivate them
2019-04-10Adapt tests, vignettes and examplesJohannes Ranke1-65/+87
- Write the NEWS - Static documentation rebuilt by pkgdown - Adapt mkinerrmin - Fix (hopefully all) remaining problems in mkinfit
2019-04-08Remove zero observations, adapt logLikJohannes Ranke1-0/+7
Zero observations at time zero made fitting the two-component error model fail. A concentration of exactly zero does not make sense anyways, as we generally have a limit of detection
2019-04-05Report negative log-likelihood during fitsJohannes Ranke1-4/+10
If not quiet = TRUE
2019-04-04Direct error model fitting worksJohannes Ranke1-366/+133
- No IRLS required - Removed optimization algorithms other than Port - Removed the dependency on FME - Fitting the error model 'obs' is much faster for the FOCUS_2006_D dataset and the FOMC_SFO model (1 second versus 3.4 seconds) - Vignettes build slower. Compiled models needs 3 minutes instead of 1.5 - For other vignettes, the trend is less clear. Some fits are faster, even for error_model = "const". FOCUS_Z is faster (34.9 s versus 44.1 s) - Standard errors and confidence intervals are slightly smaller - Removed code for plotting during the fit, as I hardly ever used it - Merged the two cost functions (using transformed and untransformed parameters) into one log-likelihood function
2019-02-27Comment out unused codeJohannes Ranke1-21/+21
2019-02-27Increase test coverageJohannes Ranke1-8/+17
2019-02-26NAFTA SOP Attachment vignetteJohannes Ranke1-0/+4
Also: - Change rounding in print.nafta - Add dots argument to nafta() - Use cores=1 in examples - Restrict N in IORE model to values > 0
2019-02-22Further adaptations for the logistic modelJohannes Ranke1-2/+2
- Make mmkin compatible - Return DT50 values corresponding to k0 and kmax - Turn incompatible parameter names in parms.ini from an error to a warning, in order to make it possible to use this argument in calls to mmkin
2019-02-21Add the logistic modelJohannes Ranke1-3/+6
2018-11-23Add logLik method to enable AIC() on mkinfit modelsJohannes Ranke1-1/+1
Further relax two tests to pass build on Travis
2018-09-21Improve fitting the two-component error modelJohannes Ranke1-47/+83
with respect to accuracy and robustness.
2018-09-20Use the median absolute deviance for fittingJohannes Ranke1-5/+16
as the absolute value is a biased estimator for the standard deviation
2018-09-15Remove correlation test as gmkin on windows still crashesJohannes Ranke1-18/+10
Clean up the code a bit
2018-09-14Update NEWSJohannes Ranke1-2/+4
Static documentation rebuilt by pkgdown
2018-09-14Avoid nls crashes by checking for a correlation firstJohannes Ranke1-0/+7
2018-09-13Enable new error model in gmkinJohannes Ranke1-7/+20
Also improve the irls fitting of the error model and add a test for FOCUS_2006_C where the second component of the error model is zero
2018-07-18Correct references to the Rocke and Lorenzato modelJohannes Ranke1-3/+3
Rename 'sigma_rl' to 'sigma_twocomp' as the Rocke and Lorenzato model assumes lognormal distribution for large y. Rebuild static documentation.
2018-07-04Improve IORE fitting, use 1.1 as N starting valueJohannes Ranke1-1/+4
2018-02-02mkinfit: Work around a bug in the current FME versionJohannes Ranke1-6/+15
that prevented the convergence message to be returned in the case of non-convergence.
2018-02-02Show R and mkin version used for fitting in the summaryJohannes Ranke1-2/+15
For fits generated with previous version, the version numbers used for fitting were not stored in the fit object. Therefore, the versions used for fitting can only be shown for fits generated with mkin containing this commit.

Contact - Imprint