Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-linear models #66

Open
strengejacke opened this issue Mar 24, 2019 · 16 comments
Open

Non-linear models #66

strengejacke opened this issue Mar 24, 2019 · 16 comments
Labels
Help us 👀 Extra attention is needed

Comments

@strengejacke
Copy link
Member

It would be nice to have support for non-linear models like nls, nlrob or nlmer, but I have no experience with such models and no idea what might be important to extract.

See the first example here:
https://stat.ethz.ch/R-manual/R-patched/library/stats/html/nls.html

The data used two fit the model has three variables, the formula however has further parameters in the "non-linear" part, which don't appear in the data. However, in the summary, these parameters are the only ones that are shown.

I don't know how to deal with this models, but maybe in the future we have an idea how to implement this.

@DominiqueMakowski DominiqueMakowski added the Help us 👀 Extra attention is needed label Mar 25, 2019
@DominiqueMakowski
Copy link
Member

Let's wait for the input of a user of these models. Maybe for get_parameters, we could stick to what coef() gives, but the problem arises for find_variables 😕

@strengejacke
Copy link
Member Author

@mattansb @humanfactors @pdwaggoner @IndrajeetPatil

Since you "joined" later than 25 March (if I recall right), may I point you to this issue? Anyone of you who has more experiences with non-linear models?

@mattansb
Copy link
Member

mattansb commented Jun 5, 2019

None, sorry...

@pdwaggoner
Copy link
Member

I don't have experience with these either, practically. But I get the idea of nonlinear models reasonably well and would be open to thinking about this, if we decide its something worth pushing forward on. Let me know

@IndrajeetPatil
Copy link
Member

Unfortunately, I don't have much experience working with non-linear models as well.

@DominiqueMakowski
Copy link
Member

@humanfactors
Copy link
Member

Yeah sorry team, I also have virutally no experience with non-linear models!

@fmmattioni
Copy link

Hi guys! While developing my new package {whippr}, I found myself in the need to create some things on my own, since the base function predict.nls not even supports the extraction of confidence bands and prediction bands.

I was greatly inspired by this post and by this paper from the {nlstools} package.

Regarding residuals, I created these two functions. The function model_diagnostics() was inspired by the {see} package.

Regarding the extraction of prediction and confidence bands, I created this function. However, this function is not generalized. It is very specific to the non-linear model I am using. By the way, if you guys have any ideas on how I could generalize this, that would be greatly appreciated!

In this vignette I explain the important information that I extract from the non-linear model used in this specific analysis. Let me know if I could help some how for {insight} or {see} to support nls models.

@strengejacke
Copy link
Member Author

Thanks Felipe for these "insights" (haha...) I'll look into this the next days, and it's good to see this discussion developing. Maybe we can indeed implement nls-support in the (near) future in our easystats-eco-system...

@fmmattioni
Copy link

That would be really cool! Thank you!

@strengejacke
Copy link
Member Author

@femiguez
Copy link
Contributor

I am willing to contribute support for nonlinear models (nls and nlme), but it will take me a few weeks, since I'm busy with other projects at the moment.

@bwiernik
Copy link
Contributor

The propagate::predictNLS() in propagate also has another approach to generating uncertainty bands on NLS predictions.

@femiguez
Copy link
Contributor

I just tried installing propagate and I get an error related to the gmm package.

> library(gmm) Error: package or namespace load failed for ‘gmm’ in get(Info[i, 1], envir = env): lazy-load database '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/gmm/R/gmm.rdb' is corrupt In addition: Warning message: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1

That function only works for nls objects, correct?

@bwiernik
Copy link
Contributor

bwiernik commented Apr 16, 2021

You can find the source here: https://github.com/cran/propagate. It uses an adaptive Delta Method to propagate uncertainty through Monte Carlo simulations.

There have been many issues with gmm on macs recently, especially M1 hardware which doesn't have a Fortran compiler. You could try to reinstall gmm and see if the issue resolves for you. Otherwise just perhaps compare the approach to the others cited.

@femiguez
Copy link
Contributor

@bwiernik Yes, the problem is on my Mac. On Windows gmm installed fine. It would be interesting to compare propagate::predictNLS with nlraa::predict_nls, but this is a bit outside of what I'm willing to do in the short term. Right now, nlraa works with objects of class 'lme', 'gls', 'gnls', 'nlme' and 'nls', which is what I could reasonably contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help us 👀 Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants