Learn R Programming

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

pracma (version 1.1.6)

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/Octave function names where appropriate to simplify porting.

Copy Link

Version

Install

install.packages('pracma')

Monthly Downloads

108,124

Version

1.1.6

License

GPL (>= 3)

Maintainer

Last Published

July 20th, 2012

Functions in pracma (1.1.6)

tri

Triangular Matrices (Matlab Style)
triquad

Gaussian Triangle Quadrature
trigPoly

Trigonometric Polynomial
Toeplitz

Toeplitz Matrix
trigApprox

Trigonometric Approximation
zeta

Riemann Zeta Function
vnorm

Vector Norm
vander

Vandermonde matrix
trapz

Trapezoidal Integration
whittaker

Whittaker Smoothing
wilkinson

Wilkinson Matrix
vectorfield

Vector Field Plotting
transfinite

Boxed Region Transformation
simpson2d

Double Simpson Integration
circlefit

Fitting a Circle
distmat

Distance Matrix
size

Size of Matrix
Trace

Matrix trace
sorting

Sorting Routines
cutpoints

Find Cutting Points
aitken

Aitken' Method
contfrac

Continous Fractions
charpoly

Characteristic Polynomial
cross

Vector Cross Product
fplot

Plot Multivariate Function
barylag

Barycentric Lagrange Interpolation
figure

Control Plot Devices (Matlab Style)
abm3pc

Adams-Bashford-Moulton
clenshaw_curtis

Clenshaw-Curtis Quadrature Formula
brown72

Brownian Motion
cranknic

Crank-Nicolson Method
And, Or

Logical AND, OR (Matlab Style)
compan

Companion Matrix
chebPoly

Chebyshev Polynomials
golden_ratio

Golden Ratio Search
fact

Factorial Function
eig

Eigenvalue Function (Matlab Style)
coprime

Coprimality
fletcher-powell

Davidon-Fletcher-Powell Method
ApEn

Approximate Entropy
cubicspline

Interpolating Cubic Spline
ceil

Integer Functions (Matlab Style)
broyden

Broyden's Method
barylag2d

2-D Barycentric Lagrange Interpolation
inv

Matrix Inverse (Matlab Style)
droplet_e

Droplet for e
gaussNewton

Gauss-Newton Function Minimization
disp,beep

Utility functions (Matlab style)
blanks

String of Blank Carakters
accumarray

Accumulate Vector Elements
cond

Matrix Condition
complexstep

Complex Step Derivation
gauss_kronrod

Gauss-Kronrod Quadrature
fderiv

Numerical Differentiation
Hadamard

Hadamard Matrix
flipdim

Matrix Flipping (Matlab Style)
deg2rad

Degrees to Radians
chebCoeff

Chebyshev Polynomials
kron

Kronecker product (Matlab Style)
hilb

Hilbert Matrix
factorize

Prime Factors
direct1d

Univariate Global Optimization
grad

Numerical Gradient
invperm

Inverse Permutation
dot

Scalar Product
expm

Matrix Exponential
bvp

Solve Boundary Value Problem
deeve

Event Detection in ODE solution
extGCD

Extended Euclidean Algorithm
mrank

Matrix Rank
eye

Some Basic Matrices
finds

find function (Matlab Style)
deconv

Deconvolution
lsqnonlin

Nonlinear Least-Squares Fitting
cotes

Newton-Cotes Formulas
hypot

Hypotenuse Function
chebApprox

Chebyshev Approximation
gaussLaguerre

Gauss-Laguerre Quadrature Formula
gammaz

Complex Gamma Function
findzeros

Find All Roots
detrend

Remove Linear Trends
andrewsplot

Andrews' Curves
isprime

isprime Property
findintervals

Find Interval Indices
GCD, LCM

GCD and LCM Integer Functions
brent_dekker

Brent-Dekker Root Finding Method
erf

Error Functions and Inverses (Matlab Style)
angle

Basic Complex Functions
agm

Arithmetic-geometric Mean
newtonRaphson

Rootfinding through Newton-Raphson or Secant.
polyadd

Adding Polynomials
crossn

n-dimensional Vector Cross Product
dblquad

Double Integration
conv

Polynomial Convolution
eulersPhi

Eulers's Phi Function
blkdiag

Block Diagonal Matrix
eta

Dirichlet Eta Function
findmins

Find All Minima
errorbar

Plot Error Bars
cart2sph

Coordinate Transformations
combs

Generate Combinations
findpeaks

Find Peaks
bisect

Rootfinding Through Bisection
fminsearch

Minimum Finding
clear

Clear function (Matlab style)
fnorm

Function Norm
fibsearch

Fibonacci Search
gaussLegendre

Gauss-Legendre Quadrature Formula
kmeanspp

K-means++ Clustering
mldivide

Matlab backslash operator
romberg

Romberg Integration
modpower

Power Function modulo m
logspace

Log-linearly Spaced Sequences
interp1

One-dimensional Interpolation
nullspace

Kernel or Nullspace
polytrans

Polynomial Transformation
ezplot

Easy Function Plot
deval

Evaluate ODE Solution
gammainc

Incomplete Gamma Function
omega

Number of Prime Factors
hankel

Hankel Matrix
fminbnd

Finding Function Minimum
Diag

Matrix Diagonal
einsteinF

Einstein Functions
modlin

Modular Linear Equation Solver
hampel

Hampel Filter
movavg

Moving Average Filters
nelder_mead

Nelder-Mead Minimization Method
segm_distance

Segment Distance
nextpow2

Next Power of 2
fzero

Root Finding
polyder

Derivative of Polynomial
newtonHorner

Newton's Root Finding Method for Polynomials.
runge

Runge Function
Fresnel Integrals

Fresnel Integrals
nnz

Nonzero Elements
fornberg

Finite Difference Approximation (Fornberg's Method)
pade

Pade Approximation
givens

Givens Rotation
fsolve

Solve System of Nonlinear Equations
repmat

Replicate Matrix
polyApprox

Polynomial Approximation
hurst

Hurst Exponent
gaussHermite

Gauss-Hermite Quadrature Formula
perms

Generate Permutations
muller

Muller's Method
ifft

Inverse Fast Fourier Transformation
gramSchmidt

Gram-Schmidt
polar

Polar Coordinate Plot (Matlab Style)
strjust

Justify character vector
meshgrid

Generate a Mesh Grid
normest

Estimated Matrix Norm
pascal

Pascal Triangle
strrep

Find and replace substring
linspace

Linearly Spaced Sequences
hessian

Hessian Matrix
neville

Neville's Method
jacobian

Jacobian Matrix
newtonsys

Newton Method for Nonlinear Systems
ndims

Number of Dimensions
ratinterp

Rational Interpolation
ode23

Runge-Kutta
regexprep

Replace string using regular expression
primes

Prime Numbers
peaks

Peaks Function (Matlab Style)
polyint

Anti-derivative of Polynomial
householder

Householder Reflections
sigma

Divisor Functions
ppval

Piecewise Polynomial Structures
segm_intersect

Segment Intersection
quad

Adaptive Simpson Quadrature
lambertWp

Lambert's W Function
fzsolve

Complex Root Finding
sqrtm,rootm

Matrix Square and p-th Roots
gradient

Discrete Gradient (Matlab Style)
Poly

Define Polynomial by Roots
pow2

Base 2 Power
strcat

String Concatenation
laguerre

Laguerre's Method
mod, rem

Integer Division
numel

Number of Elements
polylog

Polylogarithm Function
laplacian

Laplacian Operator
polypow

Polynomial Powers
randperm

Random Permutation
hausdorff_dist

Hausdorff Distance
humps

Matlab Test Functions
pchip

Hermitean Interpolation Polynomials
qrSolve

LSE Solution
horner

Horner's Rule
hooke-jeeves

Hooke-Jeeves Method
numderiv

Richardson's Numerical Derivative
rationalfit

Rational Function Approximation
invlap

Inverse Laplacian
quad2d

2-d Gaussian Quadrature
quadgr

Gaussian Quadrature with Richardson Extrapolation
interp2

Two-dimensional Data Interpolation
refindall

Find overlapping regular expression matches.
isempty

isempty Property
rk4, rk4sys

Classical Runge-Kutta
inpolygon

Polygon Region
Mode

Mode function (Matlab style)
rmserr

Accuracy Measures
nchoosek

Binomial Coefficients
Steepest Descent

Steepest Descent
modinv

Modular Inverse
roots

Polynomial Roots
quadl

Adaptive Lobatto Quadrature
ppfit

Piecewise Polynomial Fit
rand

Create Random Matrices
rat

Continuous Fractions (Matlab Style)
lebesgue

Lebesgue Constant
softline

Soft (Inexact) Line Search
rosser

Rosser Matrix
nthroot

Real nth Root
pltcross

Plotting Crosses
magic

Magic Square
quiver

Quiver or Velocity Plot
rref

Reduced Row Echelon Form
ridders

Ridders' Method
newmark

Newmark Method
std_err

Standard Error
moebiusFun

Moebius Function
polyval

Evaluating a Polynomial
savgol

Savitzky-Golay Smoothing
polyfit

Fitting by Polynomial
newtonInterp

Lagrange and Newtons Interpolation
pinv

Pseudoinverse or Generalized Inverse
plotyy

Plotting Two y-Axes
strfind

Find Substrings
orth

Range Space
pracma-package

Practical Numerical Math Routines
subspace

Angle between two subspaces
std

Standard Deviation (Matlab Style)
quadinf

Infinite Integrals
simpadpt

Adaptive Simpson Quadrature
Reshape

Reshape Matrix
sigmoid

Sigmoid Function
piecewise

Piecewise Linear Function
polyarea

Area of a Polygon
spinterp

Monotone (Shape-Preserving) Interpolation
taylor

Taylor Series Approximation
randcomb

Random Combination
polymul

Multiplying Polynomials
poly2str

Print Polynomial
rkf54

Runge-Kutta-Fehlberg
primroot

Primitive Root
strcmp

String Comparison
titanium

Titanium Test Data
quadgk

Adaptive Gauss-Kronrod Quadrature
strTrim

Remove leading and trailing white space.
regexp

Match regular expression
Test functions

Optimization Test Function
rortho

Generate Random Orthogogonal Matrix
rot90

Matrix Rotation
tictoc

MATLAB timer functions