Provides a large number of functions from numerical analysis and linear algebra, numerical optimization, differential equations, time series, plus some well-known special mathematical functions. Uses 'MATLAB' function names where appropriate to simplify porting.

This package provides R implementations of more advanced functions in numerical analysis, with a special view on on optimization and time series routines. Uses Matlab/Octave function names where appropriate to simplify porting.

Some of these implementations are the result of courses on Scientific Computing (``Wissenschaftliches Rechnen'') and are mostly intended to demonstrate how to implement certain algorithms in R/S. Others are implementations of algorithms found in textbooks.

The package encompasses functions from all areas of numerical analysis, for example:

- Root finding and minimization of univariate functions,

e.g. Newton-Raphson, Brent-Dekker, Fibonacci or `golden ratio' search. - Handling polynomials, including roots and polynomial fitting,

e.g. Laguerre's and Muller's methods. - Interpolation and function approximation,

barycentric Lagrange interpolation, Pade and rational interpolation, Chebyshev or trigonometric approximation. - Some special functions,

e.g. Fresnel integrals, Riemann's Zeta or the complex Gamma function, and Lambert's W computed iteratively through Newton's method. - Special matrices, e.g. Hankel, Rosser, Wilkinson
- Numerical differentiation and integration,

Richardson approach and ``complex step'' derivatives, adaptive Simpson and Lobatto integration and adaptive Gauss-Kronrod quadrature. - Solvers for ordinary differential equations and systems,

Euler-Heun, classical Runge-Kutta, ode23, or predictor-corrector method such as the Adams-Bashford-Moulton. - Some functions from number theory,

such as primes and prime factorization, extended Euclidean algorithm. - Sorting routines, e.g. recursive quickstep.
- Several functions for string manipulation and regular search, all wrapped and named similar to their Matlab analogues.

It serves three main goals:

- Collecting R scripts that can be demonstrated in courses on Numerical Analysis or Scientific Computing using R/S as the chosen programming language.
- Wrapping functions with appropriate Matlab names to simplify porting programs from Matlab or Octave to R.
- Providing an environment in which R can be used as a full-blown numerical computing system.

Besides that, many of these functions could be called in R applications as they do not have comparable counterparts in other R packages (at least at this moment, as far as I know).

All referenced books have been utilized in one way or another. Web links have been provided where reasonable.

The following 220 functions are emulations of correspondingly named Matlab functions and bear the same signature as their Matlab cousins if possible:

```
accumarray, acosd, acot, acotd, acoth, acsc, acscd, acsch, and, angle, ans,
arrayfun, asec, asecd, asech, asind, atand, atan2d,
beep, bernoulli, blank, blkdiag, bsxfun,
cart2pol, cart2sph, cd, ceil, circshift, clear, compan, cond, conv,
cosd, cot, cotd, coth, cross, csc, cscd, csch, cumtrapz,
dblquad, deblank, deconv, deg2rad, detrend, deval, disp, dot,
eig, eigint, ellipj, ellipke, eps, erf, erfc, erfcinv, erfcx, erfi, erfinv,
errorbar, expint, expm, eye, ezcontour, ezmesh, ezplot, ezpolar, ezsurf,
fact, fftshift, figure, findpeaks, findstr, flipdim, fliplr, flipud,
fminbnd, fmincon, fminsearch, fminunc, fplot, fprintf, fsolve, fzero,
gammainc, gcd, geomean, gmres, gradient,
hadamard, hankel, harmmean, hilb, histc, humps, hypot,
idivide, ifft, ifftshift, inpolygon, integral, integral2, integral3,
interp1, interp2, inv, isempty, isprime,
kron,
legendre, linprog, linspace, loglog, logm, logseq, logspace, lsqcurvefit,
lsqlin, lsqnonlin, lsqnonneg, lu,
magic, meshgrid, mkpp, mldivide, mod, mrdivide,
nchoosek, ndims, nextpow2, nnz, normest, nthroot, null, num2str, numel,
ode23, ode23s, ones, or, orth,
pascal, pchip, pdist, pdist2, peaks, perms, piecewise, pinv, plotyy,
pol2cart, polar, polyfit, polyint, polylog, polyval, pow2, ppval,
primes, psi, pwd,
quad, quad2d, quadgk, quadl, quadprog, quadv, quiver,
rad2deg, randi, randn, randsample, rat, rats, regexp, regexpi,
regexpreg, rem, repmat, roots, rosser, rot90, rref, runge,
sec, secd, sech, semilogx, semilogy, sinc, sind, size, sortrows, sph2cart,
sqrtm, squareform, std, str2num, strcat, strcmp, strcmpi,
strfind, strfindi, strjust, subspace,
tand, tic, toc, trapz, tril, trimmean, triplequad, triu,
vander, vectorfield, ver,
what, who, whos, wilkinson,
zeros, zeta
```

The following Matlab function names have been capitalized in `pracma' to avoid shadowing functions from R base or one of its recommended packages (on request of Bill Venables and because of Brian Ripley's CRAN policies):

```
Diag, factos, finds, Fix, Imag, Lcm, Mode, Norm, nullspace (<- null),
Poly, Rank, Real, Reshape, strRep, strTrim, Toeplitz, Trace, uniq (<- unique).
```

To use `ans`

instead of `ans()`

-- as is common practice in Matlab --
type (and similar for other Matlab commands):

```
makeActiveBinding("ans", function() .Last.value, .GlobalEnv)
makeActiveBinding("who", who(), .GlobalEnv)
```

The R package `matlab' contains some of the basic routines from Matlab, but unfortunately not any of the higher math routines.

Abramowitz, M., and I. A. Stegun (1972). Handbook of Mathematical Functions (with Formulas, Graphs, and Mathematical Tables). Dover, New York. http://www.nr.com/aands/.

Arndt, J. (2010). Matters Computational: Ideas, Algorithms, Source Code. Springer-Verlag, Berlin Heidelberg Dordrecht. FXT: a library of algorithms: http://www.jjj.de/fxt/.

Cormen, Th. H., Ch. E. Leiserson, and R. L. Rivest (2009). Introduction to Algorithms. Third Edition, The MIT Press, Cambridge, MA.

Encyclopedia of Mathematics (2012). Editor-in-Chief: Ulf Rehmann. http://www.encyclopediaofmath.org/.

Gautschi, W. (1997). Numerical Analysis: An Introduction. Birkhaeuser, Boston.

Gentle, J. E. (2009). Computational Statistics. Springer Science+Business Media LCC, New York.

Hazewinkel, M., Editor (2002). Encyclopaedia of Mathematics. Springer-Verlag, Berlin Heidelberg New York. http://eom.springer.de/.

MathWorld.com (2011). Matlab Central: http://www.mathworks.com/matlabcentral/. Mathtools.net: http://www.mathtools.net/.

NIST: National Institute of Standards and Technology. Olver, F. W. J., et al. (2010). NIST Handbook of Mathematical Functions. Cambridge University Press. Internet: NIST Digital Library of Mathematical Functions, http://dlmf.nist.gov/; Dictionary of Algorithms and Data Structures, http://www.nist.gov/; Guide to Available Mathematical Software, http://gams.nist.gov/

Press, W. H., S. A. Teukolsky, W. T Vetterling, and B. P. Flannery (2007). Numerical Recipes: The Art of Numerical Computing. Third Edition, incl. Numerical Recipes Software, Cambridge University Press, New York. http://www.nrbook.com/a/bookcpdf.php [chapters], or http://apps.nrbook.com/c/index.html [pages].

Quarteroni, A., R. Sacco, and F. Saleri (2007). Numerical Mathematics. Second Edition, Springer-Verlag, Berlin Heidelberg.

Skiena, St. S. (2008). The Algorithm Design Manual. Second Edition, Springer-Verlag, London. The Stony Brook Algorithm Repository: http://www.cs.sunysb.edu/~algorith/.

Stoer, J., and R. Bulirsch (2002). Introduction to Numerical Analysis. Third Edition, Springer-Verlag, New York.

Strang, G. (2007). Computational Science and Engineering. Wellesley-Cambridge Press. Matlab Codes: http://www-math.mit.edu/cse/

Weisstein, E. W. (2003). CRC Concise Encyclopedia of Mathematics. Second Edition, Chapman & Hall/CRC Press. Wolfram MathWorld: http://mathworld.wolfram.com/.

Zhang, S., and J. Jin (1996). Computation of Special Functions. John Wiley & Sons.

- fsolve() and broyden() are no longer applicable to univariate functions (Morrison-Sherman formula not working in this case).
- Alias cgmin() and option 'dfree=F' in fminsearch() are removed, both have been deprecated since half a year.

- qpsolve() minimizes quadratic forms such as 0.5*t(x)
*x-d*x with linear quality and inequality constraints. - fmincon() now has an 'augmented Lagrangian' option with a 'variable metric' approach as inner solver.

- linearproj() linear projection onto a linear subspace, and affineproj() linear projection onto an affine subspace of R^n.

- Corrected "length > 1 in coercion to logical" in expm().

- fminunc() unconstrained minimization of nonlinear objective function, based on stripped-down 'Rvmmin' code by John Nash.
- 'fmincon()' minimization of nonlinear objective function with constraints; wraps suggested package NlcOptim with SQP method.

- Reintroduced 'nelder_mead()' and 'hooke_jeeves()'.
- fminsearch() now calls 'Nelder-Mead' or 'Hooke-Jeeves', i.e., derivative-free methods only; 'dfree=F' gets deprecated.

- Renamed 'cgmin()' to its original name 'fletcher_powell', alias 'cgmin' is deprecated since this version.
- Removed alias 'normest2' that was anyway non-existing.

- Corrected a bug in hessenberg() reported by Ben Ubah.

- Removed the deprecated 'rortho' function, use randortho() instead.

- Si(), Ci() sine and cosine integral functions added.
- Added dot notation for brent(), bisect(), newton(), halley(), and ridders() -- on request of John Nash for the histRalg project.

- shubert() implements one-dimensional Shubert-Piyavskii method.
- fminsearch() and anms() stop for one-dimensional minimization.

- bsxfun() now uses sweep() for matrices in search of higher speed.
- direct1d() removed because slow and not effective.

- poisson2disk() approximate Poisson disk distribution
- Corrected small bug in findpeaks(), reported by Mike Badescu.

- Added a field "[email protected]" in the DESCRIPTION, deleted others.
- Added README.md and NEWS.md (for a future Github repository).
- Needed a new version for resubmitting (because of 'survivalsvm')

- Package 'quadprog' is now suggested, not imported; the functions quadprog() and lsqlincon() work only when 'quadprog' is installed.

- Package byte-compiled on loading (Requires R version >= 3.1.0).

- findpeaks() function not checking for NAs (reported by Wesley Burr).
- fplot() extra parameters were not handed over to plotting routine.

- bernstein() generates the Bernstein polynomial B_,_().
- legendre(n,_) corrected for n=0, thanks to Peter W. Marcy.
- cgmin() alias for fletcher_powell(), a constraint gradient method.

- polyvalm() evaluates a polynomial in the matrix sense.
- arnoldi() Arnoldi iteration (incl. Hessenberg matrix).

- integral() redesigned, less methods, several starting intervals with regular or random intermediate nodes (similar to MATLAB).
- quadgr() corrected as functions vectorized with Vectorize() did not behave as expected with apply(); still needs vectorization.
- Help page of quadgk() did not mention the need for vectorization.

- hessenberg() computes the Hessenberg form of a matrix through Householder transformations (this is named hess() in MATLAB).

- Corrected functions with conditions in control statements with conditions of length greater than one: rem().

- isposdef() test for positive definiteness of a (real) matrix.
- hooke_jeeves() removed; similar implementations are available in packages 'dfoptim::hjk[b]' and 'adagio::hookejeeves'.

- nelder_mead() replaced by an adaptive Nelder-Mead implementation, anms(), following F. Gao and L. Han.
- fminsearch() now calls this new version of Nelder-Mead.

- incgam(x,a) computes the incomplete upper gamma function using the R function pgamma for higher precision than gammainc().
- Corrected a small oversight in hurstexp(), thnx George Ostrouchov.

- Slightly changed the description lines on request of CRAN.

- whittaker() finally implemented avoiding the sparse matrix package.
- nelder_mead() now applies adaptive parameters for the simplicial search, depending on the dimension of the problem space.
- psinc(x,n), the so-called periodic sinc function.

- shooting() implements the shooting method for boundary value problems of second order differential equations.
- interp2() corrected the help page with size(z) = length(y)*length(x).
- Corrected a small oversight on the help page of Gauss-Laguerre.

- haversine() Haversine formula for geographical distances on earth.
- trigonometric functions accepting degrees instead of inputs in radians: sind cosd tand cotd secd cscd asind acosd atand acotd asecd acscd atan2d

- fprintf() mimicks MATLAB's function of the same name.
- Added ezsurf(), an easy surface plot following MATLAB.
- fplot() is almost an alias for ezplot(); please note that in future versions ez...() will be renamed to f...() according MATLAB 2016/17.

- rortho() renamed to randortho(), the underlying code was buggy (not truely random) and has been replaced, thanks to Jan Tuitman.
- an error in the final step of calculating approx_energy() was corrected, thanks to Daniel Krefl.

- bvp() now solves boundary value problems for linear 2nd order ODEs using a 'finite differences' approach and a tridiagonal solver.
- polyfit2() has been removed, use polyfix() instead.

- romberg() corrected an error estimation that diminished the accuracy.
- trapzfun() realizes trapezoidal integration with iterated calculations.

- fractalcurve() generates some fractal curves of order n, i.e. the Hilbert, Sierpinski, Snowflake, Dragon, and Molecule curves.
- ode23(), ode23s() changed the size of the returned components, now it is similar to what is returned by ode45() and ode78().
- arclength() corrected a boundary condition ('on the left'), added an example how to generate an arc-length parametrization of a curve.

- quadprog() solves quadratic programming problems (QP) with linear equality and inequality constraints, based on package 'quadprog'.
- lsqlincon() solves linear least-squares problems with linear equality and inequality constraints (as well as bound constraints).
- pracma now imports package 'quadprog'.

- polyfix() fits a polynomial that exactly passes through given fixed points. polyfit2() will be deprecated in future versions.
- Important bug fix for polyApprox() (thanks to Max Marchi).

- Option 'minpeakdistance' for function findpeaks() added (thanks to Razvan Chereji for providing a workable approach).

- Removed invperm().
- 'linear' is now the default method for interp1().
- Cases n = 0, 1 for legendre() corrected (thanks to Nuzhdin Yury).

- Removed two non-existing links pointing to Gander's pages at the ETHZ.
- Removed a link explaining approximate entropy.

- Added 'Imports' field in description and 'import' in namespace, as requested for the new R development version.
- strrep() renamed to strRep(), because of a new function in R Base.

- bernoulli() calculates the Bernoulli numbers and polynomials.
- factorial2() the product of all even resp. odd integers below n.

- Deleted some URLs that were not working properly anymore.

- Special functions gathered under topics 'specfun' resp. 'specmat'.

- sumalt() accelerating (infinite) alternating sums.
- Option 'fast=FALSE' in circlefit() to avoid optim().
- Added Gauss' AGM-based computation of pi to agmean().

- hurstexp() amended for vectors of uneven length.

- qpspecial() special quadratic programming solver.
- Reintroduces the 'tol' keyword in fminbnd() for compatibility.

- bulirsch_stoer() Bulirsch-Stoer method for solving *rdinary differential equations with high accuracy.
- midpoint() implements the midpoint rule for solving ODEs combined with Richardson extrapolation for high accuracy.

- lufact() LU factorization with partial pivoting; lusys() solves linear systems through Gaussian elimination.

- ode23s() for stiff ordinary differential equations refining Rosenbrock's method (supply Jacobian if available).
- euler_heun() Euler-Heun ODE solver has been corrected.

- fminbnd() much improved implementation of Brent's method; added challenging example by Trefethen to the help page.
- lambertWn() for the second (real) branch of Lambert W.
- Function name alias cintegral() removed.

- hooke_jeeves() replaced by a much more efficient implementation and equipped with a special approach to bound constraints.
- nelder_mead() replaced by a much more efficient implementation and utilizing a transformation to handle bound constraints; functions nelmin() and nelminb() are not exported anymore.

- quadinf() now uses the double exponential method with the tanh-sinh quadrature scheme for (semi-)infinite intervals.
- Removed the not-exported and too slow .quadcc() function.
- brent() alias for brentDekker(), newton() for newtonRaphson().

- pchipfun() function wrapper around pchip(); missing error handling in pchip() was added.
- hurst() removed, functionality merged with hurstexp().
- Nile overflow data set 1871--1984 added as time series.

- bits() binary representation of a number as string.
- agmean() returns AGM, no of iterations, and estimated precision.
- trapz() tiny improvement on error handling.

- ode45() ODE solver using Dormand-Prince (4,5) coefficients.
- ode78() ODE solver using Fehlberg (7,8) coefficients.
- cintegral() renamed to line_integral().

- Version 1.6.8 "Failed to build" on R-Forge. [Maybe it's time to move pracma to a github repository.]

- nelmin() a more efficient and accurate version of Nelder-Mead.
- nelminb() Nelder-Mead in bounded regions (applies a transformation).

- trisolve() stopping for singular tridiagonal matrices.
- romberg() slightly improved accuracy and speed.

- Corrected rref() (as pointed out by Peter Audano).

- lsqnonneg() changed to an active-set approach.
- bisect() trimmed bisection to return almost exact results.

- halley() Halley's variant of the Newton-Raphson method.
- numderiv() corrected Richardson's method by breaking the loop.

- lambertWp() improved inner accuracy from 1e-12 to 1e-15.
- complexstepJ() renamed to jacobian_csd(); introduced grad_csd().
- hessian_csd() applies Richardson's method as the second step, and the same for laplacian_csd().

- Removed zeroin(); for fzero() a variation of Brent-Dekker is used, that applies cubic instead of quadratic interpolation.
- Corrected an oversight in newtonRaphson().
- brentDekker() returns a list now.

- samp_entropy() complements approx_entropy() for short time series.
- Removed NEWS.Rd and NEWS.pdf in favour of NEWS.

- integral3() now handles functions as inner interval limits.
- poly_crossings() calculates crossing points of two polygons.
- erfz() complex error function vectorized (thanks to Michael Lachmann).

- muller() implements Muller's root-finding method [Mueller, 1956], especially suited for polynomials and complex functions.
- Inserted a safeguard for the distmat() function to prevent different results on Mac OS X, (Ubuntu) Linux, and Windows operating systems.
- Removed pltcross() and kmeanspp().

- interp1() with option method ``spline'' now computes Moler's spline functions, for compatibility with MATLAB (hint by Boudewijn Klijn).

- Corrected parameter 'waypoints' in cintegral().

- odregress() orthogonal distance (or: total least-squares) regression.
- Changed maintainer name to its long form (CRAN request).

- L1linreg() L1 (a.k.a. LAD or median) linear regression.
- geo_median() geometric median (minimizes sum of distances).

- rectint() rectangular intersection areas (MATLAB style).
- cumtrapz() cumulative trapezoidal integration (MATLAB style).
- Some corrections to help pages and function names.

- arclength() length of a parametrized curve in n-dimensional space, w/ improved convergence by applying Richardson's extrapolation method.
- legendre() associated Legendre functions (MATLAB style).

- poly_center() calculates the center coordinates of a polygon.
- poly_length() calculates the (euclidean) length of a polygon.
- polyarea() corrected, returns the true, not the absolute value.

- fsolve() will use broyden() if m = n; fzsolve() the same; additionally, improved broyden() and gaussNewton().
- ezplot() can draw markers on the line, with equal distances measured along the curve length.

- gmres() generalized minimum residual method.
- nearest_spd() finds nearest symmetric positive-definite matrix.
- eps() floating point relative accuracy.

- lapacian() now works in n dimensions, not only for n = 2.
- mldivide(), mrdivide() corrected a severe typo.
- numderiv(), numdiff() start with h = 1/2 instead of h = 1.
- figure() platform-independent by using dev.new().

- findzeros() now finds 'quadratic' roots, too.
- pdist2() added as an alias for distmat(), while pdist(X) now is distmat(X, X) (MATLAB style).

- histcc() histogram with optimized number of bins.
- Example of correction term for the trapz() integration.

- psi() Psi polygamma function (MATLAB style).
- rosenbrock() and rastrigin() functions removed.

- quadcc() new, iterative Clenshaw-Curtis quadrature.
- squareform() formats distance matrix (MATLAB style).

- integral2() implements the two-dimensional numerical integration approach `TwoD', i.e. Gauss-Kronrod (3, 7)-points on rectangles.
- integral3() three-dimensional integration based on integral2().
- triplequad() 3-dim. integration based on dblquad() (MATLAB style).

- integral() combines adaptive numerical integration procedures.
- cintegral() complex line integrals (rectangles and curves).

- linprog() linear programming solver for linear equality and inequality constraints.

- romberg() Romberg integration completely rewritten.
- idivide() integer division with different roundings.

- fderiv(), taylor() expanded to higher orders.
- itersolve() iteration methods for solving linear systems.
- lu() LU decomposition with different schemes (w/o pivoting).

- pdist() as an alias for distmat() (MATLAB style).
- fftshift(), ifftshift() shifting Fourier frequencies.
- Improved grad(), jacobian(), hessian(), and laplacian().

- Smaller corrections, e.g., removed deprecated 'is.real'; no startup messages anymore.
- geomean(), harmmean(), trimmean() geometric, harmonic, and trimmed arithmetic mean (MATLAB style).
- agmean() algebraic-geometric mean.

- mexpfit() multi-exponentiell fitting, separating linear and nonlinear parts of the problem.

- lsqsep() separable least-squares fitting.
- lsqcurvefit() nonlinear least-squares curve fitting.

- cd(), pwd() directory functions (MATLAB style).
- rand(), randn() changed to accept size() as input.
- whos(), what() corrected for empty lists resp. directories.

- what(), who(), whos(), ver() (MATLAB style).
- semilogx(), semilogy(), loglog() logarithmic plots (MATLAB style)

- quadv() vectorized integration.
- ezpolar() easy access to the polar() function.
- sortrows() sorting rows of matrices (MATLAB style).
- null() alias for nullspace function (MATLAB style).
- eigjacobi() Jacobi's method for eigenvalues and eigenvectors.

- ellipke(), ellipj() elliptic and Jacobi elliptic integrals.
- expint() implements E1 and Ei, the exponential integrals, with aliases expint_E1() and expint_Ei().
- li() the logarithmic integral (w/o offset).

- Explicitely listing about 200 MATLAB-emulating function( name)s.
- Dismissed matlab(), using it now for infos only, not assigning any MATLAB function names to the environment (because of CRAN policies).

- cot(), csc(), sec() cotangens, cosecans, and secans functions.
- acot(), acsc(), asec() inverse cotangens, cosecans, secans functions.
- coth(), csch(), sech() hyperbolic cotangens, cosecans, secans functions.
- acoth(), acsch(), asech() inverse hyperbolic cotangens, cosecans, and secans functions.

- bvp() changed to solve second order boundary value problems.
- trisolve() solves tridiagonal linear equation systems.
- curvefit() fits points in the plane with a polynomial curve.

- lsqlin() least-squares solver with linear equality constraints.
- pinv() now works like MASS::ginv() for singular matrices.
- Added the end-';' feature to str2num().
- toc() added invisible return value.

- procrustes() solving the Procrustes problem, and kabsch() implements the Kabsch algorithm.
- kriging() ordinary and simple Kriging interpolation.
- Corrected some stupid errors in str2num().

- akimaInterp() univariate Akima interpolation.
- Moved transfinite() to package 'adagio'.

- histc() Histogram-like counting (MATLAB style).
- Added warning to complexstep() if imaginary part is zero.

- Added option 'pinv' to mldivide() to return same results as MATLAB.
- str2num(), num2str() conversion functions (MATLAB style).
- Removed some 'author' entries on help pages.

- Renamed mrank() to Rank().
- Corrected nullspace() [thanks to Stephane Laurent], which now agrees with Octave's null() function (MASS:Null appears buggy, too).
- Corrected gaussNewton() and fsolve() [thanks to Etienne Chamayou].

- bsxfun() apply binary function elementwise (MATLAB style).
- added the analytic solution for the example in bvp().

- rosenbrock() added, moved testfunctions to 'adagio' package.
- euler_heun() improved Euler method for solving ODEs.
- logit() function added to sigmoid().
- Keyword 'ode' introduced.

- matlab() can reinstall MATLAB function names.

- gcd(), lcm() greatest common divisor, least common multiple now working on a vector of integers.
- Removed number-theoretic functions: eulersPhi(), moebiusFun(), mertensFun(), sigma(), tau(), omega(), Omega(), primes2(), twinPrimes(), nextPrime(), previousPrime(), modpower(), modorder(), modinv(), modlin(), primroot(), contfrac(), coprime(), GCD(), LCM(), extGCD(), (these functions are now available in the 'numbers' package).

- ezcontour(), ezmesh() wrappers for contour(), image(), persp().
- erfi() imaginary error function.

- moler() Moler matrix

- Removed '.Rapphistory' from the tests directory (again) [and use "--as-cran" for the checks].
- disp() display text or array (MATLAB Style), i.e. cat() with newline.

- Renamed functions with capital first letter to avoid name clashes: mtrace -> Trace, mdiag -> Diag, strtrim -> strTrim, vnorm -> Norm, reshape -> Reshape, find -> finds, fix -> Fix, poly ->Poly, mode -> Mode, real -> Real, imag -> Imag, toeplitz -> Toeplitz.

- gammainc() (lower and upper) incomplete gamma function, also the regularized gamma function, all allowing negative x values.
- polylog() the polylogarithm functions for |z| < 1 and n >= -4 .

- fminsearch() now implements Nelder-Mead (similar to optim), and Fletcher-Powell when "dfree=FALSE" is chosen.
- Test functions rosenbrock() and rastrigin().

- nelder_mead() implements Nelder-Mead for nonlinear optimization.
- hooke-jeeves() Hooke-Jeeves algorithm for direct search.
- fletcher_powell() Davidon-Fletcher-Powell method for function minimization (alternative to BFGS approach).
- steep_descent() minimization of functions using steepest descent.

- fminbnd() now implements Brent's function minimization algorithm with golden section search and parabolic interpolation (same as optimize).
- transfinite() transformation function between bounded and unbounded (box constraint) regions.

- hurst(), hurstexp() calculate the Hurst exponent of a time series.
- Updated the NEWS.Rd file.

- lsqnonneg() solves nonnegative least-squares problems by using the trick "x --> exp(x)" and applying lsqnonlin(); example function lsqcurvefit() for nonlinear curve fitting.
- Renamed ridder() to ridders(), thanks to Robert Monfera for pointing it out (he also suggested a multi-dimensional variant).

- movavg() moving average of types "simple", "weighted", "modified", "exponential" (EMA), or "triangular".
- modlin() solves modular linear equations.

- lsqnonlin() solves nonlinear least-squares problems using the Levenberg-Marquardt approach.
- renamed froots() to findzeros(), and fmins() to findmins().

- fornberg() finite difference (i.e., polynomial) approximation of derivatives for unevenly spaced grid points -- Fornberg's method.

- randsample() randomly sampling, alias for sample (MATLAB style).
- rands() generates uniform random points on an N-sphere.
- Added tic(), toc() measuring elapsed time (MATLAB style).
- previousPrime() finds the next prime below a number.

- invlap() computes the inverse Lapacian numerically.
- ppfit() piecewise polynomial fitting procedure.

- cubicspline() interpolating cubic spline (w/ endpoint conditions).
- mkpp() and ppval() for piecewise polynomial structures.

- accumarray() resembles the related MATLAB function more closely.
- invperm() returns the inverse of a permutation.
- randperm() changed to make it more MATLAB-like.

- plotyy() corrected right ordinate, prettying the labels.
- peaks() peaks function (MATLAB style).

- Updated the NEWS.Rd file.

- qrSolve solves overdetermined system of linear equations.
- DSCsearch() removed, now in package 'pracopt'.
- randp() found a better, non-selective approach.

- gramSchmidt() modified Gram-Schmidt process.
- householder() Householder reflections and QR decomposition.
- givens() Givens rotation and QR decomposition.
- corrected a small error in ridder() (thanks to Roger Harbord); new example of how to use ridder() with Rmpfr for multiple precision.

- erf() corrected, erfc() and erfcx() as new functions, including their inverses erfinv() and erfcinv().
- hypot() now numerically more stable (thanks to Jerry Lewis).

- Changed third example for dblquad() [new Windows toolchain problem].
- Deactivated the test for gammaz() because of problems on Solaris.

- kmeanspp() kmeans++ clustering algorithm.
- hampel() with new option, fuelled by a blog entry of Ron Pearson.

- DSCsearch() Davies-Swann-Campey search in one dimension.
- Improved modpower() through modular exponentiation. added lehmann_test() Lehmann's primality test as example.
- Corrected polar() and andrewsplot().

- direct1d() one-dimensional version of the DIRECT algorithm for global function minimization.

- approx_entropy() approximate entropy of a time series.
- circshift() circularly shifting arrays (MATLAB Style).

- plotyy() plots curves with y-axes on both left and right side.
- fplot() plots components of a multivariate function.

- errorbar() routine for plotting error bars in both directions.
- whittaker() Whittaker-Henderson smoothing** Not yet running** .
- rref() reduced row echelon form.

- cutpoints() automatically finds cutting points based on gaps.
- hausdorff_dist calculates the Hausdorff distance / Hausdorff dimension.
- nnz() number of non-zeros elements (MATLAB style).

- polar() for polar plots (MATLAB style), see the example plots.
- andrewsplot() plots Andrews curves in polar coordinates.
- Vectorized: cart2sph(), sph2cart(), cart2pol(), pol2cart().

- deg2rad(), rad2deg().
- figure() MATLAB style and pltcross() plotting crosses.

- ridder() Ridder's method for zero finding of univariate functions.

- sqrtm() matrix square root, based on Denman-Beavers iteration, rootm() matrix p-th root, computing a complex contour integral, signm() matrix sign function. o fzero() now uses the new zeroin() function, i.e., a Brent-Dekker approach instead of refering to uniroot().
- twinPrimes() twin primes in a given interval, and nextPrime() will find the next higher prime.

- Transformations between cartesian, spherical, polar and cylindrical coordinate systems: cart2sph(), sph2cart(), cart2pol(), pol2cart().
- randp() uniformly random points in the unit circle.

- accumarray() grouping elements and applying a function to each group.
- uniq() MATLAB-style 'unique' function, allsums() in the examples.
- small correction to fsolve(), mentioned on the 'check summary' page.

- newmark() Newmark's method for solving second order differential equations of the form y''(t) = f(t, y(t), y'(t)) on [t1, t2].
- cranknic() Crank-Nicolson 'ivp' solver, combining the forward and backward Euler methods for ordinary differential equations.

- Corrected pinv() for (nearly) singular matrices.
- Renamed ifactor() to factors().

- Minor corrections and improvements to the 'pracma.pdf' manual, incl. numdiff(), refindall(), trigApprox(), and subspace().

- spinterp() monotonic (and later on shape-preserving) interpolation following the approach of Delbourgo and Gregory.

- bvp() solves boundary value problems of the following kind: -u''(x) + c1 u'(x) + c2 u(x) = f(x) for x in [a, b].

- primes2(n1, n2) will return all prime numbers betweeen n1 and n2 (without storing the numbers from sqrt(n2) up to n2).

- gaussNewton() for function minimization and solving systems of nonlinear equations. fsolve() as a wrapper for it.
- fzsolve() for root finding of complex functions.
- softline() Fletcher's inexact linesearch algorithm.

- Put NEWS.Rd in the /inst subdirectory (and NEWS.pdf in /doc), thanks to Kurt Hornik; slightly changed the version numbering.

- rortho() generate random orthogonal matrix of size n.
- Titanium data set for testing fitting procedures.

- erf() and erfc() error and complementary error functions (MATLAB style) as (almost) aliases for pnorm().
- erfz() complex error function.

- broyden() quasi-Newton root finding method for systems of nonlinear equations.

- cross() has been vectorized (remark on R-help).

- Sigmoid and Einstein functions.

- Runge-Kutta-Fehlberg method of order (5,4).

- triquad() Gaussian quadrature over triangles.
- cotes() Newton-Cotes integration formulae for 2 to 8 nodes.

- lagrangeInterp(), newtonInterp() Lagrange and Newton polynomial interpolation, neville() Neville's methods.
- tril(), triu() extracting triangular matrices (MATLAB style).

- charpoly() computes the characteristic polynomial, the determinant, and the inverse for matrices that are relativly small, applying the Faddejew-Leverrier method.
- froots() to find
*all*roots (also of second or higher order) of a univariate function in a given interval. The same with fmins() to find*all*minima.

- Adams-Bashford and Adams-Moulton (i.e., multi-step) methods for ordinary differential equations in function abm3pc().

- Changed the description to be more precise about the package.

- rationalfit() rational function approximation
- ratinterp() rational interpolation a la Burlisch-Stoer.

- pade() Pade approximation.

- quadgk() adaptive Gauss-Kronrod quadrature.

- Added differential equation example to expm()'s help page.
- Changed NEWS file to become simpler (no subsections).

- quadl() recursive adaptive Gauss-Lobatto quadrature.
- simpadpt() another recursively adaptive Simpson's rule.
- Added testing procedures for all integration routines; corrected, refined some of these procedures.

- quadgr() Gaussian Quadrature with Richardson extrapolation, can handle singularities at endpoints and (half-)infinite intervals.

- expm() for matrix exponentials.
- clenshaw_curtis() the Clenshaw-Curtis quadrature formula.

- simpson2d() as non-adaptive 2-dimensional Simpson integration.
- dblquad() twofold application of internal function integrate().

- gaussHermite() and gaussLaguerre() for infinite intervals.
- Fresnel integrals fresnelS() and frenelC().

- gaussLegendre() computes coefficients for Gauss Quadrature, and quad2d() uses these weights for 2-dimensional integration.
- quadinf() wrapper for integrate() on infinite intervals.

- ode23() solving first order (systems of) differential equations.
- barylag2d() 2-dimensional barycentric Lagrange interpolation.

- interp2() for two-dimensional interpolation.
- gradient() now works in two dimensions too.

- fzero(), fminbnd(), fminsearch(), fsolve() as aliases for uniroot(), optimize(), optim() with Nelder-Mead, newtonsys().

- Corrections to help pages.

- romberg() and gauss_kronrod() for numerical integration.
- Richardson's extrapolation in numderiv(), numdiff().
- Discrete numerical derivatives (one dimension): gradient().

- Numerical function derivatives: fderiv(), grad().
- Specialized operators: hessian(), laplacian().
- Application: taylor().

- plot vector fields: quiver() and vectorfield().
- findintervals().
- Corrections in deval(), deeve(), using findintervals().

- Laguerre's method laguerre().
- rk4() and rk4sys() classical fourth order Runge-Kutta.
- deval(), deeve() evaluate ODE solutions.

- Lebesgue coefficient: lebesgue().
- poly2str() for string representation of a polynomial.

- Dirichlet's eta() and Riemann's zeta() function.
- rmserr() different accuracy measures; std_err() standard error.

- polypow() and polytrans() for polynomials.
- polyApprox() polynomial approximation using Chebyshev.
- trigPoly(), trigApprox() for trigonometric regression.

- segm_intersect() and segm_distance() segment distances.
- inpolygon().

- polyadd() polynomial addition.
- conv() and deconv() time series (de)convolution.
- detrend() removes (piecewise) linear trends.
- ifft() for normalized inverse Fast Fourier Transform.

- Added tests for functions since version 0.3-7.

- and() and or().

- pchip() and option `cubic' for interp1() interpolation.
- The complex gamma functions gammaz().
- hadamard() and toeplitz() matrices.

- Rank of a matrix, mrank(), and nullspace() for the kernel.
- orth(), orthogonal basis of the image space, and subspace() determines the angle between two subspaces.
- normest() for estimating the (Frobenius) norm of a matrix, and cond() determines the condition number of a matrix.

- fact(), more accurate than the R internal function `factorial'.
- ezplot() as an alias for curve(), but with option ``fill = TRUE''.
- aitken() for accelerating iterations.
- Renamed polycnv() to polymul().
- Renamed outlierMAD() to hampel().

- Lambert W function lambertWp() for the real principal branch.
- ``Complex Step'' derivation with complexstep() and complexstepJ().

- Barycentric Lagrange interpolation through barylag().
- polyfit2() fits a polynomial that exactly meets one additional point.
- Added more references to the help entry `pracma-package.Rd'.

- hornerdefl() for also returning the deflated polynomial.
- newtonHorner() combining Newton's method and the Horner scheme for root finding for polynomials.
- jacobian() computes the Jacobian of a function R^n --> R^m as simple numerical derivative.
- newtonsys() applies Newton's method to functions R^n --> R^n with special application to root finding of complex functions.
- newton() renamed to newtonRaphson().

- Sorting functions: bubbleSort(), insertionSort(), selectionSort(), shellSort(), heapSort(), mergeSort(), mergeOrdered(), quickSort(), quickSortx(), is.sorted(), and testSort().
- Functions from number theory: eulersPhi(), moebiusFun() and the mertensFun(), sigma(), tau(), omega(), and Omega().

- Chebyshev polynomials of the first kind: chebPoly(), chebCoeff(), and chebApprox().

- New version of NEWS.Rd, NEWS.pdf.
- More test functions for root finding and quadrature.

- fnorm() and the Runge function runge().
- contfrac(), rat(), and rats() for continuous fractions.
- meshgrid() and magic().

- quad() adaptive Simpson quadrature.
- Minimum finding with fibsearch() and golden_ratio().
- Root finding with newton(), secant(), and brentDekker().

- Regular expression functions regexp(), regexpi(), regexprep() and refindall().

- String functions blanks(), strtrim(), deblank(), strjust(), strrep().
- interp1() one-dimensional interpolation (incl. spline)

- MATLAB functions mode(), clear() and beep().

- primroot() finds the smallest primitive root modulo a given n; needed functions are modpower() and modorder().
- humps() and sinc(): MATLAB test functions.
- Root finding through bisection: bisect(), regulaFalsi().
- outlierMAD(), findpeaks(), and piecewise().
- polycnv() for polynomial multiplication.
- Functions extgcd(), gcd(), and lcm() have been renamed to extGCD(), GCD(), and LCM() respectively.

- strfind(), strfindi(), and findstr().
- circlefit() fitting a circle to plane points.
- mldivide() and mrdivide(), emulating the MATLAB backslash operator.

- vnorm() vector norm
- Warning about a nasty "non-ASCII input" in the savgol.RD file resolved.

- horner() implementing the horner scheme for evaluating a polynomial and its derivative.
- savgol() Savitzki-Golay smoothing and needed pseudoinverse pinv().

- Package renamed to 'pracma' to avoid name clashes with packages such as 'matlab' that are sticking closer to the original.
- Added 'pracma-package' section to the manual.

- reshape(), repmat(), and blkdiag() matrix functions.
- combs() chooses all combinations of k elements out of n, and randcomb() generates a random selection.
- perms() generates all permutations, randperm() a random permutation.
- Pascal triangle as pascal(); nchoosek() returns binomial coefficients.
- Some string functions: strcmp(), strcmpi(), strcat().

- std() as refinement of the standard deviation function.
- ceil() and fix() as aliases for ceiling() and trunc(). [floor() and round() already exist in R.]
- Modulo functions mod(), rem() and integer division idiv().
- Integer functions related to the Euclidean algorithm: extgcd(), gcd(), lcm(), coprime(), and modinv().
- distmat() and crossn(), the vector product in n-dimensional space.

- size(), numel(), ndims(), isempty(), and find().
- eye(), ones(), zeros().
- Functions returning random numbers: rand(), randn(), randi().
- linspace(), logspace(), and logseq() for linearly, logarithmically, and exponentially spaced sequences.

- Matrix functions mdiag() and mtrace() added. inv() is introduced as an alias for solve() in R.
- Generate special matrices hankel(), rosser(), and wilkinson(). kron() is an alias for the R function kronecker().
- Renamed factors() to ifactor() to distinguish it more clearly from factors as used in R.

- Added function for flipping or rotating numeric and complex matrices: flipdim(). flipud(), fliplr(), and rot90().

- Added functions for generating sequences of (log-)linearly spaced numeric values: linspace() and logspace().
- Added basic complex functions real(), imag(), conj(), and angle() which are essentially only aliases of the R functions Re(), Im(), *r Conj(). angle() returns the angle of a complex number in radians. The R function Mod() is here only available as abs().

- Added compan() function for the `companion' matrix; the eig() function is an alias for the R eigen()values function.
- Added the polynomial functions poly(), polyder(), polyfit(), polyint(), and polyval().
- roots() returns real and complex roots of polynomials.
- Simplified the trapz() function.

- Added functions from number theory: primes(), isprime() and factors(). The corresponding function for factors() in MATLAB/Octave is called factor(), but that name should not be shadowed in R!
- Added the polyarea() and trapz() functions.

- Added some simple functions such as nthroot(), pow2(), and nextpow2().
- dot() and cross() functions for scalar and vector product.
- Generate matrices through vander() and hilb().

- 'pracma' will be a pure R package without using any source code. Therefore, installation will be immediate on all platforms.

- This package provides R implementations of more advanced math functions from MATLAB and Octave (and the Euler Math Toolbox) with a special view on optimization and time series routines.