Learn R Programming

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

pracma (version 1.2.0)

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.0

License

GPL (>= 3)

Maintainer

Last Published

September 27th, 2012

Functions in pracma (1.2.0)

aitken

Aitken' Method
combs

Generate Combinations
eig

Eigenvalue Function (Matlab Style)
Diag

Matrix Diagonal
cubicspline

Interpolating Cubic Spline
eye

Some Basic Matrices
findintervals

Find Interval Indices
figure

Control Plot Devices (Matlab Style)
gaussNewton

Gauss-Newton Function Minimization
hurst

Hurst Exponent
ifft

Inverse Fast Fourier Transformation
neville

Neville's Method
magic

Magic Square
nnz

Nonzero Elements
logspace

Log-linearly Spaced Sequences
plotyy

Plotting Two y-Axes
polyfit

Fitting by Polynomial
disp,beep

Utility functions (Matlab style)
Poly

Define Polynomial by Roots
chebCoeff

Chebyshev Polynomials
blanks

String of Blank Carakters
deval

Evaluate ODE Solution
errorbar

Plot Error Bars
deconv

Deconvolution
regexprep

Replace string using regular expression
fminsearch

Minimum Finding
titanium

Titanium Test Data
gradient

Discrete Gradient (Matlab Style)
savgol

Savitzky-Golay Smoothing
fderiv

Numerical Differentiation
gaussLegendre

Gauss-Legendre Quadrature Formula
lambertWp

Lambert's W Function
jacobian

Jacobian Matrix
linspace

Linearly Spaced Sequences
meshgrid

Generate a Mesh Grid
mrank

Matrix Rank
newtonRaphson

Rootfinding through Newton-Raphson or Secant.
nullspace

Kernel or Nullspace
regexp

Match regular expression
quadgk

Adaptive Gauss-Kronrod Quadrature
repmat

Replicate Matrix
rot90

Matrix Rotation
steepest_descent

Steepest Descent
simpadpt

Adaptive Simpson Quadrature
blkdiag

Block Diagonal Matrix
trapz

Trapezoidal Integration
broyden

Broyden's Method
charpoly

Characteristic Polynomial
Testfunctions

Optimization Test Function
rk4, rk4sys

Classical Runge-Kutta
compan

Companion Matrix
fresnelS/C

Fresnel Integrals
erf

Error Functions and Inverses (Matlab Style)
grad

Numerical Gradient
spinterp

Monotone (Shape-Preserving) Interpolation
hankel

Hankel Matrix
ndims

Number of Dimensions
poly2str

Print Polynomial
rref

Reduced Row Echelon Form
size

Size of Matrix
romberg

Romberg Integration
sqrtm,rootm

Matrix Square and p-th Roots
strfind

Find Substrings
transfinite

Boxed Region Transformation
trigPoly

Trigonometric Polynomial
tic,toc

MATLAB timer functions
fornberg

Finite Difference Approximation (Fornberg's Method)
detrend

Remove Linear Trends
trigApprox

Trigonometric Approximation
abm3pc

Adams-Bashford-Moulton
circlefit

Fitting a Circle
direct1d

Univariate Global Optimization
expm

Matrix Exponential
fact

Factorial Function
ezcontour,ezmesh

Contour and Mesh Plotter
gaussLaguerre

Gauss-Laguerre Quadrature Formula
gammainc

Incomplete Gamma Function
gcd, lcm

GCD and LCM Integer Functions
dot

Scalar Product
hausdorff_dist

Hausdorff Distance
hessian

Hessian Matrix
invlap

Inverse Laplacian
laguerre

Laguerre's Method
movavg

Moving Average Filters
mod, rem

Integer Division
newtonsys

Newton Method for Nonlinear Systems
nchoosek

Binomial Coefficients
quad

Adaptive Simpson Quadrature
sigmoid

Sigmoid Function
strjust

Justify character vector
and, or

Logical AND, OR (Matlab Style)
ceil

Integer Functions (Matlab Style)
chebApprox

Chebyshev Approximation
crossn

n-dimensional Vector Cross Product
fibsearch

Fibonacci Search
eta

Dirichlet Eta Function
fminbnd

Finding Function Minimum
gammaz

Complex Gamma Function
fzsolve

Complex Root Finding
lsqnonlin

Nonlinear Least-Squares Fitting
newmark

Newmark Method
Norm

Vector Norm
numderiv

Richardson's Numerical Derivative
peaks

Peaks Function (Matlab Style)
pinv

Pseudoinverse or Generalized Inverse
polypow

Polynomial Powers
pracma-package

Practical Numerical Math Routines
polyint

Anti-derivative of Polynomial
softline

Soft (Inexact) Line Search
rmserr

Accuracy Measures
strcat

String Concatenation
newtonInterp

Lagrange and Newtons Interpolation
Trace

Matrix trace
clear

Clear function (Matlab style)
sorting

Sorting Routines
vander

Vandermonde matrix
finds

find function (Matlab Style)
angle

Basic Complex Functions
barylag

Barycentric Lagrange Interpolation
ezplot

Easy Function Plot
findmins

Find All Minima
findzeros

Find All Roots
fletcher-powell

Davidon-Fletcher-Powell Method
hadamard

Hadamard Matrix
hypot

Hypotenuse Function
mldivide

Matlab backslash operator
pltcross

Plotting Crosses
polyApprox

Polynomial Approximation
quadgr

Gaussian Quadrature with Richardson Extrapolation
rationalfit

Rational Function Approximation
strTrim

Remove leading and trailing white space.
rortho

Generate Random Orthogogonal Matrix
subspace

Angle between two subspaces
perms

Generate Permutations
bisect

Rootfinding Through Bisection
taylor

Taylor Series Approximation
normest

Estimated Matrix Norm
bvp

Solve Boundary Value Problem
cotes

Newton-Cotes Formulas
cranknic

Crank-Nicolson Method
deeve

Event Detection in ODE solution
findpeaks

Find Peaks
deg2rad

Degrees to Radians
fplot

Plot Multivariate Function
fsolve

Solve System of Nonlinear Equations
laplacian

Laplacian Operator
matlab

Matlab Idioms
pade

Pade Approximation
newtonHorner

Newton's Root Finding Method for Polynomials.
polyarea

Area of a Polygon
polymul

Multiplying Polynomials
polyder

Derivative of Polynomial
randcomb

Random Combination
roots

Polynomial Roots
segm_intersect

Segment Intersection
simpson2d

Double Simpson Integration
std_err

Standard Error
whittaker

Whittaker Smoothing
zeta

Riemann Zeta Function
inv

Matrix Inverse (Matlab Style)
andrewsplot

Andrews' Curves
cart2sph

Coordinate Transformations
brent_dekker

Brent-Dekker Root Finding Method
barylag2d

2-D Barycentric Lagrange Interpolation
chebPoly

Chebyshev Polynomials
complexstep

Complex Step Derivation
factors

Prime Factors
dblquad

Double Integration
gaussHermite

Gauss-Hermite Quadrature Formula
hampel

Hampel Filter
humps

Matlab Test Functions
interp1

One-dimensional Interpolation
hilb

Hilbert Matrix
interp2

Two-dimensional Data Interpolation
isempty

isempty Property
kmeanspp

K-means++ Clustering
pascal

Pascal Triangle
pchip

Hermitean Interpolation Polynomials
invperm

Inverse Permutation
polar

Polar Coordinate Plot (Matlab Style)
quadinf

Infinite Integrals
refindall

Find overlapping regular expression matches.
ratinterp

Rational Interpolation
ridders

Ridders' Method
rkf54

Runge-Kutta-Fehlberg
strrep

Find and replace substring
tri

Triangular Matrices (Matlab Style)
triquad

Gaussian Triangle Quadrature
pow2

Base 2 Power
accumarray

Accumulate Vector Elements
clenshaw_curtis

Clenshaw-Curtis Quadrature Formula
cond

Matrix Condition
conv

Polynomial Convolution
cutpoints

Find Cutting Points
cross

Vector Cross Product
fzero

Root Finding
gauss_kronrod

Gauss-Kronrod Quadrature
gramSchmidt

Gram-Schmidt
givens

Givens Rotation
householder

Householder Reflections
hooke-jeeves

Hooke-Jeeves Method
Mode

Mode function (Matlab style)
isprime

isprime Property
muller

Muller's Method
nthroot

Real nth Root
nextpow2

Next Power of 2
orth

Range Space
piecewise

Piecewise Linear Function
numel

Number of Elements
ppfit

Piecewise Polynomial Fit
qrSolve

LSE Solution
polyval

Evaluating a Polynomial
polylog

Polylogarithm Function
quiver

Quiver or Velocity Plot
std

Standard Deviation (Matlab Style)
randperm

Random Permutation
strcmp

String Comparison
Toeplitz

Toeplitz Matrix
vectorfield

Vector Field Plotting
lebesgue

Lebesgue Constant
quad2d

2-d Gaussian Quadrature
quadl

Adaptive Lobatto Quadrature
runge

Runge Function
distmat

Distance Matrix
primes

Prime Numbers
approx_entropy

Approximate Entropy
ppval

Piecewise Polynomial Structures
polytrans

Polynomial Transformation
kron

Kronecker product (Matlab Style)
inpolygon

Polygon Region
einsteinF

Einstein Functions
flipdim

Matrix Flipping (Matlab Style)
brown72

Brownian Motion
horner

Horner's Rule
wilkinson

wilkinson Matrix
rand

Create Random Matrices
fnorm

Function Norm
nelder_mead

Nelder-Mead Minimization Method
rosser

Rosser Matrix
ode23

Runge-Kutta
golden_ratio

Golden Ratio Search
moler

Moler Matrix
segm_distance

Segment Distance
polyadd

Adding Polynomials
Reshape

Reshape Matrix
rat

Continuous Fractions (Matlab Style)