-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define the models as functions rather than strings.
This is necessary as the BTS model uses integrate(), and in order to retrieve its result one needs to extract `$value` from the object it returns. But this confuses nlsLM() into thinking that `value` is a parameter to be optimized and for which a starting point should be given. The only workable solution seems to hide all that complexity into a wrapper function (f_BTS) that is used as right-hand side in the formula. Because of this, we need to reformulate also f_GOK as a function. Due to R's abstruse way of accessing variables in the enviroment from inside a function, it turns out that we can access `rhop` but not `isoT`, so we have to add `isoT` to the model signatures and also to the `data` argument. This commit also introduces some changes to the BTS model: in particular we now use sapply() inside f_BTS(), and also fixes DeltaE to 1.5eV. However, this model continues to fail with error: singular gradient matrix at initial parameter estimates
- Loading branch information
Showing
1 changed file
with
32 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters