-
-
Notifications
You must be signed in to change notification settings - Fork 331
Implement Newton-Raphson method in R #196
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the Newton-Raphson method for finding roots of equations in R. The implementation provides a numerical method that iteratively approximates roots using the function and its derivative.
Key changes:
- Adds a new Newton-Raphson algorithm implementation
- Includes standard numerical method parameters (tolerance, maximum iterations)
- Provides a clean, functional interface for root finding
Comments suppressed due to low confidence (1)
mathematics/newton_raphson_method.r:1
- The function lacks documentation explaining the algorithm, parameters, and return value. Add comments describing what the Newton-Raphson method does, the expected input parameters, and the output.
newtonRaphson <- function(f, fprime, x0, tol = 1e-6, max_iter = 100) {
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
The Newton-Raphson method is a powerful and relatively straightforward method for finding the roots of an equation. It has many advantages but suffers from several drawbacks such as a readily calculated derivative, inconsistencies when f′(x)=0 and so on.