Learn R Programming

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

pracma (version 1.2.5)

Practical Numerical Math Functions

Description

Implementations of functions in numerical analysis as R scripts, with a special view on on optimization and time series routines. Uses Matlab function names where appropriate to simplify porting.

Copy Link

Version

Install

install.packages('pracma')

Monthly Downloads

108,124

Version

1.2.5

License

GPL (>= 3)

Maintainer

Last Published

November 8th, 2012

Functions in pracma (1.2.5)

kron

Kronecker product (Matlab Style)
complexstep

Complex Step Derivation
eta

Dirichlet Eta Function
gammaz

Complex Gamma Function
gradient

Discrete Gradient (Matlab Style)
hadamard

Hadamard Matrix
fminsearch

Minimum Finding
grad

Numerical Gradient
distmat

Distance Matrix
lambertWp

Lambert's W Function
kmeanspp

K-means++ Clustering
mod, rem

Integer Division
neville

Neville's Method
newmark

Newmark Method
nnz

Nonzero Elements
pascal

Pascal Triangle
pchip

Hermitean Interpolation Polynomials
polymul

Multiplying Polynomials
polypow

Polynomial Powers
quadinf

Infinite Integrals
quad

Adaptive Simpson Quadrature
quadgr

Gaussian Quadrature with Richardson Extrapolation
quadgk

Adaptive Gauss-Kronrod Quadrature
Toeplitz

Toeplitz Matrix
ratinterp

Rational Interpolation
transfinite

Boxed Region Transformation
strcat

String Concatenation
eig

Eigenvalue Function (Matlab Style)
hooke-jeeves

Hooke-Jeeves Method
andrewsplot

Andrews' Curves
blanks

String of Blank Carakters
cubicspline

Interpolating Cubic Spline
direct1d

Univariate Global Optimization
ezplot

Easy Function Plot
deval

Evaluate ODE Solution
hankel

Hankel Matrix
fderiv

Numerical Differentiation
inpolygon

Polygon Region
laguerre

Laguerre's Method
linspace

Linearly Spaced Sequences
meshgrid

Generate a Mesh Grid
logspace

Log-linearly Spaced Sequences
magic

Magic Square
newtonsys

Newton Method for Nonlinear Systems
numderiv

Richardson's Numerical Derivative
randperm

Random Permutation
repmat

Replicate Matrix
rmserr

Accuracy Measures
subspace

Angle between two subspaces
titanium

Titanium Test Data
std_err

Standard Error
vander

Vandermonde matrix
blkdiag

Block Diagonal Matrix
ceil

Integer Functions (Matlab Style)
chebCoeff

Chebyshev Polynomials
whittaker

Whittaker Smoothing
cond

Matrix Condition
spinterp

Monotone (Shape-Preserving) Interpolation
fletcher-powell

Davidon-Fletcher-Powell Method
givens

Givens Rotation
gcd, lcm

GCD and LCM Integer Functions
histc

Histogram Count (Matlab style)
trigPoly

Trigonometric Polynomial
jacobian

Jacobian Matrix
inv

Matrix Inverse (Matlab Style)
golden_ratio

Golden Ratio Search
laplacian

Laplacian Operator
movavg

Moving Average Filters
normest

Estimated Matrix Norm
nthroot

Real nth Root
pow2

Base 2 Power
rat

Continuous Fractions (Matlab Style)
strcmp

String Comparison
polyfit

Fitting by Polynomial
Trace

Matrix trace
pade

Pade Approximation
angle

Basic Complex Functions
conv

Polynomial Convolution
brown72

Brownian Motion
euler_heun

Euler-Heun ODE Solver
cart2sph

Coordinate Transformations
bisect

Rootfinding Through Bisection
hessian

Hessian Matrix
findzeros

Find All Roots
Diag

Matrix Diagonal
figure

Control Plot Devices (Matlab Style)
crossn

n-dimensional Vector Cross Product
cross

Vector Cross Product
finds

find function (Matlab Style)
cutpoints

Find Cutting Points
flipdim

Matrix Flipping (Matlab Style)
barylag2d

2-D Barycentric Lagrange Interpolation
bvp

Solve Boundary Value Problem
fplot

Plot Multivariate Function
circlefit

Fitting a Circle
barylag

Barycentric Lagrange Interpolation
chebApprox

Chebyshev Approximation
quiver

Quiver or Velocity Plot
charpoly

Characteristic Polynomial
accumarray

Accumulate Vector Elements
chebPoly

Chebyshev Polynomials
fminbnd

Finding Function Minimum
Poly

Define Polynomial by Roots
gaussLegendre

Gauss-Legendre Quadrature Formula
humps

Matlab Test Functions
aitken

Aitken' Method
deg2rad

Degrees to Radians
hurst

Hurst Exponent
bsxfun

Elementwise Function Application (Matlab Style)
ezcontour,ezmesh

Contour and Mesh Plotter
expm

Matrix Exponential
eye

Some Basic Matrices
disp,beep

Utility functions (Matlab style)
broyden

Broyden's Method
abm3pc

Adams-Bashford-Moulton
cotes

Newton-Cotes Formulas
brent_dekker

Brent-Dekker Root Finding Method
deeve

Event Detection in ODE solution
erf

Error Functions and Inverses (Matlab Style)
detrend

Remove Linear Trends
einsteinF

Einstein Functions
factors

Prime Factors
fzsolve

Complex Root Finding
clear

Clear function (Matlab style)
findintervals

Find Interval Indices
hausdorff_dist

Hausdorff Distance
and, or

Logical AND, OR (Matlab Style)
fact

Factorial Function
combs

Generate Combinations
newtonRaphson

Rootfinding through Newton-Raphson or Secant.
newtonInterp

Lagrange and Newtons Interpolation
fzero

Root Finding
householder

Householder Reflections
deconv

Deconvolution
gauss_kronrod

Gauss-Kronrod Quadrature
compan

Companion Matrix
muller

Muller's Method
clenshaw_curtis

Clenshaw-Curtis Quadrature Formula
gramSchmidt

Gram-Schmidt
fornberg

Finite Difference Approximation (Fornberg's Method)
gaussLaguerre

Gauss-Laguerre Quadrature Formula
lsqnonlin

Nonlinear Least-Squares Fitting
nelder_mead

Nelder-Mead Minimization Method
fibsearch

Fibonacci Search
errorbar

Plot Error Bars
gaussHermite

Gauss-Hermite Quadrature Formula
hilb

Hilbert Matrix
invperm

Inverse Permutation
Rank

Matrix Rank
horner

Horner's Rule
findpeaks

Find Peaks
gaussNewton

Gauss-Newton Function Minimization
lebesgue

Lebesgue Constant
isempty

isempty Property
fnorm

Function Norm
numel

Number of Elements
ode23

Runge-Kutta
ifft

Inverse Fast Fourier Transformation
matlab

Matlab Idioms
nextpow2

Next Power of 2
polyadd

Adding Polynomials
mldivide

Matlab backslash operator
ndims

Number of Dimensions
isprime

isprime Property
nullspace

Kernel or Nullspace
interp1

One-dimensional Interpolation
primes

Prime Numbers
plotyy

Plotting Two y-Axes
perms

Generate Permutations
polar

Polar Coordinate Plot (Matlab Style)
polyarea

Area of a Polygon
piecewise

Piecewise Linear Function
fsolve

Solve System of Nonlinear Equations
findmins

Find All Minima
polyint

Anti-derivative of Polynomial
peaks

Peaks Function (Matlab Style)
regexp

Match regular expression
newtonHorner

Newton's Root Finding Method for Polynomials.
refindall

Find overlapping regular expression matches.
rand

Create Random Matrices
taylor

Taylor Series Approximation
regexprep

Replace string using regular expression
randcomb

Random Combination
pltcross

Plotting Crosses
Mode

Mode function (Matlab style)
invlap

Inverse Laplacian
ridders

Ridders' Method
polyApprox

Polynomial Approximation
ppval

Piecewise Polynomial Structures
rortho

Generate Random Orthogogonal Matrix
vectorfield

Vector Field Plotting
hampel

Hampel Filter
polylog

Polylogarithm Function
Norm

Vector Norm
hypot

Hypotenuse Function
roots

Polynomial Roots
sigmoid

Sigmoid Function
pracma-package

Practical Numerical Math Routines
rot90

Matrix Rotation
rkf54

Runge-Kutta-Fehlberg
strjust

Justify character vector
trigApprox

Trigonometric Approximation
pinv

Pseudoinverse or Generalized Inverse
strTrim

Remove leading and trailing white space.
nchoosek

Binomial Coefficients
strfind

Find Substrings
runge

Runge Function
segm_intersect

Segment Intersection
sorting

Sorting Routines
rosenbrock

Optimization Test Function
rref

Reduced Row Echelon Form
segm_distance

Segment Distance
softline

Soft (Inexact) Line Search
polytrans

Polynomial Transformation
poly2str

Print Polynomial
ppfit

Piecewise Polynomial Fit
std

Standard Deviation (Matlab Style)
moler

Moler Matrix
triquad

Gaussian Triangle Quadrature
polyval

Evaluating a Polynomial
simpson2d

Double Simpson Integration
simpadpt

Adaptive Simpson Quadrature
polyder

Derivative of Polynomial
rk4, rk4sys

Classical Runge-Kutta
quadl

Adaptive Lobatto Quadrature
qrSolve

LSE Solution
Reshape

Reshape Matrix
cranknic

Crank-Nicolson Method
savgol

Savitzky-Golay Smoothing
trapz

Trapezoidal Integration
size

Size of Matrix
tri

Triangular Matrices (Matlab Style)
tic,toc

MATLAB timer functions
sqrtm,rootm

Matrix Square and p-th Roots
str2num

Converting string to number (Matlab style)
fresnelS/C

Fresnel Integrals
interp2

Two-dimensional Data Interpolation
strrep

Find and replace substring
steepest_descent

Steepest Descent
dblquad

Double Integration
orth

Range Space
romberg

Romberg Integration
zeta

Riemann Zeta Function
wilkinson

wilkinson Matrix
quad2d

2-d Gaussian Quadrature
approx_entropy

Approximate Entropy
rationalfit

Rational Function Approximation
rosser

Rosser Matrix
dot

Scalar Product
gammainc

Incomplete Gamma Function