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

Allow root finding functions to use “models” #358

Open
Beakerboy opened this issue Nov 19, 2019 · 3 comments
Open

Allow root finding functions to use “models” #358

Beakerboy opened this issue Nov 19, 2019 · 3 comments

Comments

@Beakerboy
Copy link
Contributor

The “Models” that are part of the regression namespace are kind of like classed versions of closures. We could create a parent object which includes a simple derivative() function, which could be overridden by a child if the child had a simple derivative. This accurate derivative could be used in the root-finding algorithm instead of the estimate.

@markrogoyski
Copy link
Owner

For PowerModel, for instance, there would be a derivative method that returned a function that would evaluate ab * xᵇ⁻¹ based on what a and b were already set to, taking only x as a parameter I presume.

@Beakerboy
Copy link
Contributor Author

If performing root-finding, Newton’s method would only need (∂y / ∂x), but for nonlinear least squares, there would need to be (∂y / ∂a) and (∂y / ∂b).

@Beakerboy
Copy link
Contributor Author

Even better, derivative() could return a new PowerLaw model with $new_a = $this->a* $this->b and $new_b = $this->b-1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants