Learn R Programming

⚠️There's a newer version (1.0.5) of this package.Take me there.

Computational Methods for Numerical Analysis

This is the R package to support Computational Methods for Numerical Analysis with R by James P. Howard, II.

Computational Methods for Numerical Analysis with R is an overview of traditional numerical analysis topics presented using R. This guide shows how common functions from linear algebra, interpolation, numerical integration, optimization, and differential equations can be implemented in pure R code. Every algorithm described is given with a complete function implementation in R, along with examples to demonstrate the function and its use.

Computational Methods for Numerical Analysis with R with R is intended for those who already know R, but are interested in learning more about how the underlying algorithms work. As such, it is suitable for statisticians, economists, and engineers, and others with a computational and numerical background.

Algorithms included

  • Elementary and Example Algorithms
    • Polynomial Expansion
      • Naive (naivepoly)
      • Cached Naive (betterpoly)
      • Horner's Method (horner, rhorner)
    • Summation
      • Naive Summation (naivesum)
      • Kahan Summation (kahansum)
    • Division
      • Naive Division (naivediv)
      • Long Division (longdiv)
    • Miscellaneous
      • Naive Primality tester (isPrime)
      • Nth Root (nthroot)
      • Quadratic Formula (quadratic, quadratic2)
    • Samples
      • Fibbonaci (fibonacci)
      • Wilinson's Polynomial (wilkinson)
      • Himmelblau (himmelblau)
  • Linear Algebra
    • Row/Vector Operations
      • Row Replacement (replacerow)
      • Scale Row (scalerow)
      • Swap Rows (swaprows)
      • Norm of a Vector (vecnorm)
    • Elementary Functions
      • Determinant (detmatrix)
      • Matrix Inverse (invmatrix)
      • Row-Echelon Form (refmatrix)
      • Reduced Row-Echelon Form (rrefmatrix)
      • Solve a Matrix, Using Row Reduction (solvematrix)
    • Decompositions
      • Cholesky Decomposition (choleskymatrix)
      • LU Decomposition (lumatrix)
    • Iterative Methods
      • Conjugate Gradient (cgmmatrix)
      • Gauss Seidel (gaussseidel)
      • Jacobi (jacobi)
    • Specialty Methods
      • Tridiagonal Matrix Solver (tridiagmatrix)
  • Interpolation and Extrapolation
    • Polynomial Interpolation
      • Liner Interpolation (linterp)
      • Polynomial Interpolation (polyinterp)
    • Splines
      • Piecewise Linear (pwiselinterp)
      • Cubic Spline (cubicspline)
    • Bezier
      • Quadratic Bezier (qbezier)
      • Cubic Bezier (cbezier)
    • Multidimensional Interpolaters
      • Bilinear (bilinear)
      • Nearest Neighbor (nn)
    • Applications
      • Image Resizing (resizeImageNN, resizeImageBL)
  • Differentiation
    • Finite Differences
      • One-Step (findiff)
      • More Differentiators (symdiff, rdiff)
      • Second Derivative (findiff2)
  • Numerical Integration
    • Newton-Cotes
      • Midpoint Method (midpt)
      • Trapezoid Method (trap)
      • Simpson's Rule (simp)
      • Simpson's 3/8s Rule (simp38)
    • Gaussian Integration
      • Driver (gaussint)
      • Specific forms (gauss.hermite, gauss.laguerre, gauss.legendre)
    • Adaptive Integrators
      • Recursive Adaptive (adaptint)
      • Romberg (romberg)
    • Monte Carlo
      • Monte Carlo Integration, 1D (mcint)
      • Monte Carlo Integration, 2D (mcint2)
    • Applications
      • Shell Method for Revolved Volume (shellmethod)
      • Disc Method for Revolved Volume (discmethod)
      • Gini Coefficient (giniquintile)
  • Root Finding
    • Bisection Method (bisection)
    • Newton's Method (newton)
    • Secant Method (secant)
  • Optimization
    • Continuous
      • Golden Section (goldsectmax, goldsectmin)
      • Gradient Descent (gd, gdls, gradasc, graddsc)
      • Hill Climbing (hillclimbing)
      • Simulated Annealing (sa)
    • Discrete
      • Traveling Salesperson Problem (tspsa)
  • Differential Equations
    • Initial Value Problems
      • Euler Method (euler)
      • Midpoint Method (midptivp)
      • Fouth-Order Runge-Kutta (rungekutta4)
      • Adams-Bashforth (adamsbashforth)
    • Systems of Differential Equations
      • Euler Method (eulersys)
    • Partial Differential Equations
      • Heat Equation, 1D (heat)
      • Wave Equation, 1D (wave)
    • Applications
      • Boundary Value Problems (bvpexample, bvpexample10)

Dependencies

  • testthat
  • roxygen2
  • markdown

Contribution guidelines

For more information

Copy Link

Version

Install

install.packages('cmna')

Monthly Downloads

665

Version

1.0.3

License

BSD_2_clause + file LICENSE

Maintainer

James P. Howard

Last Published

July 7th, 2020

Functions in cmna (1.0.3)

gaussint

Gaussian integration method driver
fibonacci

Fibonacci numbers
findiff

Finite Differences
hillclimbing

Hill climbing
ivp

Initial value problems
himmelblau

Himmelblau Function
ivpsys

Initial value problems for systems of ordinary differential equations
iterativematrix

Solve a matrix using iterative methods
isPrime

Test for Primality
quadratic

The quadratic equation.
pwiselinterp

Piecewise linear interpolation
gdls

Least squares with graident descent
linterp

Linear interpolation
gradient

Gradient descent
trap

Trapezoid method
tridiagmatrix

Solve a tridiagonal matrix
invmatrix

Invert a matrix
heat

Heat Equation via Forward-Time Central-Space
horner

Horner's rule
revolution-solid

Volumes of solids of revolution
giniquintile

Gini coefficients
refmatrix

Matrix to Row Echelon Form
goldsect

Golden Section Search
nthroot

The n-th root formula
lumatrix

LU Decomposition
summation

Two summing algorithms
polyinterp

Polynomial interpolation
simp38

Simpson's 3/8 rule
choleskymatrix

Cholesky Decomposition
newton

Newton's method
nn

Nearest interpolation
midpt

rectangle method
mcint

Monte Carlo Integration
vecnorm

Norm of a vector
romberg

Romberg Integration
resizeImage

Image resizing
sa

Simulated annealing
rowops

Elementary row operations
simp

Simpson's rule
secant

Secant Method
wilkinson

Wilkinson's Polynomial
wave

Wave Equation using
cmna-package

Computational Methods for Numerical Analysis
bilinear

Bilinear interpolation
bvp

Boundary value problems
bisection

The Bisection Method
cubicspline

Natural cubic spline interpolation
division

Algorithms for divisions
detmatrix

Calculate the determinant of the matrix
bezier

Bezier curves
adaptint

Adaptive Integration