-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
224 lines (211 loc) · 14.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Practical Numerical Math Functions • pracma</title>
<!-- jquery --><script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js" integrity="sha384-cV+rhyOuRHc9Ub/91rihWcGmMmCXDeksTtCihMupQHSsi8GIIRDG0ThDc3HGQFJ3" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script><meta property="og:title" content="Practical Numerical Math Functions">
<meta property="og:description" content="
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.">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-home">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">pracma</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released package">2.1.6</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right"></ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="contents col-md-9">
<div id="package-pracma" class="section level1">
<div class="page-header"><h1 class="hasAnchor">
<a href="#package-pracma" class="anchor"></a>Package PRACMA</h1></div>
<div id="introduction" class="section level2">
<h2 class="hasAnchor">
<a href="#introduction" class="anchor"></a>Introduction</h2>
<p>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.</p>
<p>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.</p>
</div>
<div id="details" class="section level2">
<h2 class="hasAnchor">
<a href="#details" class="anchor"></a>Details</h2>
<p>The package encompasses functions from all areas of numerical analysis, for example:</p>
<ul>
<li>Root finding and minimization of univariate functions,<br>
e.g. Newton-Raphson, Brent-Dekker, Fibonacci or `golden ratio’ search.</li>
<li>Handling polynomials, including roots and polynomial fitting,<br>
e.g. Laguerre’s and Muller’s methods.</li>
<li>Interpolation and function approximation,<br>
barycentric Lagrange interpolation, Pade and rational interpolation, Chebyshev or trigonometric approximation.</li>
<li>Some special functions,<br>
e.g. Fresnel integrals, Riemann’s Zeta or the complex Gamma function, and Lambert’s W computed iteratively through Newton’s method.</li>
<li>Special matrices, e.g. Hankel, Rosser, Wilkinson</li>
<li>Numerical differentiation and integration,<br>
Richardson approach and ``complex step’’ derivatives, adaptive Simpson and Lobatto integration and adaptive Gauss-Kronrod quadrature.</li>
<li>Solvers for ordinary differential equations and systems,<br>
Euler-Heun, classical Runge-Kutta, ode23, or predictor-corrector method such as the Adams-Bashford-Moulton.</li>
<li>Some functions from number theory,<br>
such as primes and prime factorization, extended Euclidean algorithm.</li>
<li>Sorting routines, e.g. recursive quickstep.</li>
<li>Several functions for string manipulation and regular search, all wrapped and named similar to their Matlab analogues.</li>
</ul>
</div>
<div id="goals" class="section level2">
<h2 class="hasAnchor">
<a href="#goals" class="anchor"></a>Goals</h2>
<p>It serves two main goals:</p>
<ul>
<li>Collecting R scripts that can be demonstrated in courses on Numerical Analysis or Scientific Computing using R/S as the chosen programming language.</li>
<li>Wrapping functions with appropriate Matlab names to simplify porting programs from Matlab or Octave to R.</li>
<li>Providing an environment in which R can be used as a full-blown numerical computing system.</li>
</ul>
<p>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).</p>
<p>All referenced books have been utilized in one way or another. Web links have been provided where reasonable.</p>
</div>
<div id="emulated-matlab-functions" class="section level2">
<h2 class="hasAnchor">
<a href="#emulated-matlab-functions" class="anchor"></a>Emulated MATLAB Functions</h2>
<p>The following 220 functions are emulations of correspondingly named Matlab functions and bear the same signature as their Matlab cousins if possible:</p>
<div class="sourceCode"><pre class="sourceCode R"><code class="sourceCode r">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, fminsearch, 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</code></pre></div>
<p>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):</p>
<div class="sourceCode"><pre class="sourceCode R"><code class="sourceCode r">Diag, factos, finds, Fix, Imag, Lcm, Mode, Norm, <span class="kw"><a href="reference/nullspace.html">nullspace</a></span> (<-<span class="st"> </span>null),
Poly, Rank, Real, Reshape, strRep, strTrim, Toeplitz, Trace, <span class="kw"><a href="reference/accumarray.html">uniq</a></span> (<-<span class="st"> </span>unique).</code></pre></div>
<p>To use <code>ans</code> instead of <code>ans()</code> – as is common practice in Matlab – type (and similar for other Matlab commands):</p>
<div class="sourceCode"><pre class="sourceCode R"><code class="sourceCode r"><span class="kw">makeActiveBinding</span>(<span class="st">"ans"</span>, <span class="cf">function</span>() .Last.value, .GlobalEnv)
<span class="kw">makeActiveBinding</span>(<span class="st">"who"</span>, <span class="kw"><a href="reference/clear.html">who</a></span>(), .GlobalEnv)</code></pre></div>
<div id="note" class="section level3">
<h3 class="hasAnchor">
<a href="#note" class="anchor"></a>Note</h3>
<p>The R package `matlab’ contains some of the basic routines from Matlab, but unfortunately not any of the higher math routines.</p>
</div>
</div>
<div id="references" class="section level2">
<h2 class="hasAnchor">
<a href="#references" class="anchor"></a>References</h2>
<p>Abramowitz, M., and I. A. Stegun (1972). Handbook of Mathematical Functions (with Formulas, Graphs, and Mathematical Tables). Dover, New York. <a href="https://personal.math.ubc.ca/~cbm/aands/" class="uri">https://personal.math.ubc.ca/~cbm/aands/</a>.</p>
<p>Arndt, J. (2010). Matters Computational: Ideas, Algorithms, Source Code. Springer-Verlag, Berlin Heidelberg Dordrecht. FXT: a library of algorithms: <a href="http://www.jjj.de/fxt/" class="uri">http://www.jjj.de/fxt/</a>.</p>
<p>Cormen, Th. H., Ch. E. Leiserson, and R. L. Rivest (2009). Introduction to Algorithms. Third Edition, The MIT Press, Cambridge, MA.</p>
<p>Encyclopedia of Mathematics (2012). Editor-in-Chief: Ulf Rehmann. <a href="http://www.encyclopediaofmath.org/" class="uri">http://www.encyclopediaofmath.org/</a>.</p>
<p>Gautschi, W. (1997). Numerical Analysis: An Introduction. Birkhaeuser, Boston.</p>
<p>Gentle, J. E. (2009). Computational Statistics. Springer Science+Business Media LCC, New York.</p>
<p>Hazewinkel, M., Editor (2002). Encyclopaedia of Mathematics. Springer-Verlag, Berlin Heidelberg New York. <a href="http://eom.springer.de/" class="uri">http://eom.springer.de/</a>.</p>
<p>MathWorld.com (2011). Matlab Central: <a href="http://www.mathworks.com/matlabcentral/" class="uri">http://www.mathworks.com/matlabcentral/</a>. Mathtools.net: <a href="http://www.mathtools.net/" class="uri">http://www.mathtools.net/</a>.</p>
<p>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, <a href="http://dlmf.nist.gov/" class="uri">http://dlmf.nist.gov/</a>; Dictionary of Algorithms and Data Structures, <a href="http://www.nist.gov/" class="uri">http://www.nist.gov/</a>; Guide to Available Mathematical Software, <a href="http://gams.nist.gov/" class="uri">http://gams.nist.gov/</a></p>
<p>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. URL: <a href="http://numerical.recipes/" class="uri">http://numerical.recipes/</a></p>
<p>Quarteroni, A., R. Sacco, and F. Saleri (2007). Numerical Mathematics. Second Edition, Springer-Verlag, Berlin Heidelberg.</p>
<p>Skiena, St. S. (2008). The Algorithm Design Manual. Second Edition, Springer-Verlag, London. The Stony Brook Algorithm Repository: <a href="http://www.cs.sunysb.edu/~algorith/" class="uri">http://www.cs.sunysb.edu/~algorith/</a>.</p>
<p>Stoer, J., and R. Bulirsch (2002). Introduction to Numerical Analysis. Third Edition, Springer-Verlag, New York.</p>
<p>Strang, G. (2007). Computational Science and Engineering. Wellesley-Cambridge Press. Matlab Codes: <a href="http://www-math.mit.edu/cse/" class="uri">http://www-math.mit.edu/cse/</a></p>
<p>Weisstein, E. W. (2003). CRC Concise Encyclopedia of Mathematics. Second Edition, Chapman & Hall/CRC Press. Wolfram MathWorld: <a href="http://mathworld.wolfram.com/" class="uri">http://mathworld.wolfram.com/</a>.</p>
<p>Zhang, S., and J. Jin (1996). Computation of Special Functions. John Wiley & Sons.</p>
</div>
</div>
</div>
<div class="col-md-3" id="sidebar">
<div class="links">
<h2>Links</h2>
<ul class="list-unstyled">
<li>Download from CRAN at <br><a href="https://cloud.r-project.org/package=pracma">https://cloud.r-project.org/package=pracma</a>
</li>
<li>Report a bug at <br><a href="NA">NA</a>
</li>
</ul>
</div>
<div class="license">
<h2>License</h2>
<ul class="list-unstyled">
<li>GPL (>= 3)</li>
</ul>
</div>
<div class="developers">
<h2>Developers</h2>
<ul class="list-unstyled">
<li>Hans W. Borchers <br><small class="roles"> Author, maintainer </small> </li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by Hans W. Borchers.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>