Package 'Pracma'

Total Page:16

File Type:pdf, Size:1020Kb

Package 'Pracma' Package ‘pracma’ January 23, 2021 Type Package Version 2.3.3 Date 2021-01-22 Title Practical Numerical Math Functions Depends R (>= 3.1.0) Imports graphics, grDevices, stats, utils Suggests NlcOptim, quadprog Description 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. License GPL (>= 3) ByteCompile true LazyData yes Author Hans W. Borchers [aut, cre] Maintainer Hans W. Borchers <[email protected]> Repository CRAN Repository/R-Forge/Project optimist Repository/R-Forge/Revision 495 Repository/R-Forge/DateTimeStamp 2021-01-22 18:52:59 Date/Publication 2021-01-23 10:10:02 UTC NeedsCompilation no R topics documented: pracma-package . .8 abm3pc . 11 accumarray . 12 agmean . 14 aitken . 16 1 2 R topics documented: akimaInterp . 17 and, or . 19 andrewsplot . 20 angle . 21 anms............................................. 22 approx_entropy . 23 arclength . 25 arnoldi . 28 barylag . 29 barylag2d . 30 bernoulli . 32 bernstein . 34 bisect . 35 bits.............................................. 37 blanks . 38 blkdiag . 38 brentDekker . 39 brown72 . 40 broyden . 41 bsxfun . 43 bulirsch-stoer . 44 bvp ............................................. 46 cart2sph . 47 cd, pwd, what . 48 ceil.............................................. 49 charpoly . 50 chebApprox . 51 chebCoeff . 52 chebPoly . 53 circlefit . 54 clear, who(s), ver . 56 clenshaw_curtis . 57 combs . 58 compan . 58 complexstep . 59 cond............................................. 61 conv............................................. 62 cot,csc,sec, etc. 63 cotes . 64 coth,csch,sech, etc. 65 cranknic . 66 cross . 68 crossn . 69 cubicspline . 70 curvefit . 71 cutpoints . 73 dblquad . 74 deconv . 76 R topics documented: 3 deeve ............................................ 77 deg2rad . 78 detrend . 78 deval............................................. 79 Diag............................................. 80 disp,beep . 81 distmat . 82 dot.............................................. 83 eig.............................................. 84 eigjacobi . 85 einsteinF . 86 ellipke,ellipj . 87 eps.............................................. 89 erf.............................................. 90 errorbar . 91 eta.............................................. 92 euler_heun . 93 expint . 94 expm ............................................ 96 eye.............................................. 97 ezcontour,ezsurf,ezmesh . 98 ezplot . 99 ezpolar . 101 fact ............................................. 102 factors . 103 fderiv . 104 fibsearch . 105 figure . 106 findintervals . 107 findmins . 108 findpeaks . 109 finds............................................. 110 findzeros . 111 fletcher_powell . 112 flipdim . 114 fminbnd . 115 fmincon . 116 fminsearch . 118 fminunc . 119 fnorm . 121 fornberg . 122 fprintf . 123 fractalcurve . ..
Recommended publications
  • Ries Via the Generalized Weighted-Averages Method
    Progress In Electromagnetics Research M, Vol. 14, 233{245, 2010 ACCELERATION OF SLOWLY CONVERGENT SE- RIES VIA THE GENERALIZED WEIGHTED-AVERAGES METHOD A. G. Polimeridis, R. M. Golubovi¶cNi¶ciforovi¶c and J. R. Mosig Laboratory of Electromagnetics and Acoustics Ecole Polytechnique F¶ed¶eralede Lausanne CH-1015 Lausanne, Switzerland Abstract|A generalized version of the weighted-averages method is presented for the acceleration of convergence of sequences and series over a wide range of test problems, including linearly and logarithmically convergent series as well as monotone and alternating series. This method was originally developed in a partition- extrapolation procedure for accelerating the convergence of semi- in¯nite range integrals with Bessel function kernels (Sommerfeld-type integrals), which arise in computational electromagnetics problems involving scattering/radiation in planar strati¯ed media. In this paper, the generalized weighted-averages method is obtained by incorporating the optimal remainder estimates already available in the literature. Numerical results certify its comparable and in many cases superior performance against not only the traditional weighted-averages method but also against the most proven extrapolation methods often used to speed up the computation of slowly convergent series. 1. INTRODUCTION Almost every practical numerical method can be viewed as providing an approximation to the limit of an in¯nite sequence. This sequence is frequently formed by the partial sums of a series, involving a ¯nite number of its elements. Unfortunately, it often happens that the resulting sequence either converges too slowly to be practically useful, or even appears as divergent, hence requesting the use of generalized Received 7 October 2010, Accepted 28 October 2010, Scheduled 8 November 2010 Corresponding author: Athanasios G.
    [Show full text]
  • 2 Homework Solutions 18.335 " Fall 2004
    2 Homework Solutions 18.335 - Fall 2004 2.1 Count the number of ‡oating point operations required to compute the QR decomposition of an m-by-n matrix using (a) Householder re‡ectors (b) Givens rotations. 2 (a) See Trefethen p. 74-75. Answer: 2mn2 n3 ‡ops. 3 (b) Following the same procedure as in part (a) we get the same ‘volume’, 1 1 namely mn2 n3: The only di¤erence we have here comes from the 2 6 number of ‡opsrequired for calculating the Givens matrix. This operation requires 6 ‡ops (instead of 4 for the Householder re‡ectors) and hence in total we need 3mn2 n3 ‡ops. 2.2 Trefethen 5.4 Let the SVD of A = UV : Denote with vi the columns of V , ui the columns of U and i the singular values of A: We want to …nd x = (x1; x2) and such that: 0 A x x 1 = 1 A 0 x2 x2 This gives Ax2 = x1 and Ax1 = x2: Multiplying the 1st equation with A 2 and substitution of the 2nd equation gives AAx2 = x2: From this we may conclude that x2 is a left singular vector of A: The same can be done to see that x1 is a right singular vector of A: From this the 2m eigenvectors are found to be: 1 v x = i ; i = 1:::m p2 ui corresponding to the eigenvalues = i. Therefore we get the eigenvalue decomposition: 1 0 A 1 VV 0 1 VV = A 0 p2 U U 0 p2 U U 3 2.3 If A = R + uv, where R is upper triangular matrix and u and v are (column) vectors, describe an algorithm to compute the QR decomposition of A in (n2) time.
    [Show full text]
  • Fortran Resources 1
    Fortran Resources 1 Ian D Chivers Jane Sleightholme May 7, 2021 1The original basis for this document was Mike Metcalf’s Fortran Information File. The next input came from people on comp-fortran-90. Details of how to subscribe or browse this list can be found in this document. If you have any corrections, additions, suggestions etc to make please contact us and we will endeavor to include your comments in later versions. Thanks to all the people who have contributed. Revision history The most recent version can be found at https://www.fortranplus.co.uk/fortran-information/ and the files section of the comp-fortran-90 list. https://www.jiscmail.ac.uk/cgi-bin/webadmin?A0=comp-fortran-90 • May 2021. Major update to the Intel entry. Also changes to the editors and IDE section, the graphics section, and the parallel programming section. • October 2020. Added an entry for Nvidia to the compiler section. Nvidia has integrated the PGI compiler suite into their NVIDIA HPC SDK product. Nvidia are also contributing to the LLVM Flang project. Updated the ’Additional Compiler Information’ entry in the compiler section. The Polyhedron benchmarks discuss automatic parallelisation. The fortranplus entry covers the diagnostic capability of the Cray, gfortran, Intel, Nag, Oracle and Nvidia compilers. Updated one entry and removed three others from the software tools section. Added ’Fortran Discourse’ to the e-lists section. We have also made changes to the Latex style sheet. • September 2020. Added a computer arithmetic and IEEE formats section. • June 2020. Updated the compiler entry with details of standard conformance.
    [Show full text]
  • A Fast Algorithm for the Recursive Calculation of Dominant Singular Subspaces N
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Elsevier - Publisher Connector Journal of Computational and Applied Mathematics 218 (2008) 238–246 www.elsevier.com/locate/cam A fast algorithm for the recursive calculation of dominant singular subspaces N. Mastronardia,1, M. Van Barelb,∗,2, R. Vandebrilb,2 aIstituto per le Applicazioni del Calcolo, CNR, via Amendola122/D, 70126, Bari, Italy bDepartment of Computer Science, Katholieke Universiteit Leuven, Celestijnenlaan 200A, 3001 Leuven, Belgium Received 26 September 2006 Abstract In many engineering applications it is required to compute the dominant subspace of a matrix A of dimension m × n, with m?n. Often the matrix A is produced incrementally, so all the columns are not available simultaneously. This problem arises, e.g., in image processing, where each column of the matrix A represents an image of a given sequence leading to a singular value decomposition-based compression [S. Chandrasekaran, B.S. Manjunath, Y.F. Wang, J. Winkeler, H. Zhang, An eigenspace update algorithm for image analysis, Graphical Models and Image Process. 59 (5) (1997) 321–332]. Furthermore, the so-called proper orthogonal decomposition approximation uses the left dominant subspace of a matrix A where a column consists of a time instance of the solution of an evolution equation, e.g., the flow field from a fluid dynamics simulation. Since these flow fields tend to be very large, only a small number can be stored efficiently during the simulation, and therefore an incremental approach is useful [P. Van Dooren, Gramian based model reduction of large-scale dynamical systems, in: Numerical Analysis 1999, Chapman & Hall, CRC Press, London, Boca Raton, FL, 2000, pp.
    [Show full text]
  • Convergence Acceleration of Series Through a Variational Approach
    Convergence acceleration of series through a variational approach September 30, 2004 Paolo Amore∗, Facultad de Ciencias, Universidad de Colima, Bernal D´ıaz del Castillo 340, Colima, Colima, M´exico Abstract By means of a variational approach we find new series representa- tions both for well known mathematical constants, such as π and the Catalan constant, and for mathematical functions, such as the Rie- mann zeta function. The series that we have found are all exponen- tially convergent and provide quite useful analytical approximations. With limited effort our method can be applied to obtain similar expo- nentially convergent series for a large class of mathematical functions. 1 Introduction This paper deals with the problem of improving the convergence of a series in the case where the series itself is converging very slowly and a large number of terms needs to be evaluated to reach the desired accuracy. This is an interesting and challenging problem, which has been considered by many authors before (see, for example, [FV 1996, Br 1999, Co 2000]). In this paper we wish to attack this problem, although aiming from a different angle: instead of looking for series expansions in some small nat- ural parameter (i.e. a parameter present in the original formula), we in- troduce an artificial dependence in the formulas upon an (not completely) ∗[email protected] 1 arbitrary parameter and then devise an expansion which can be optimized to give faster rates of convergence. The details of how this work will be explained in depth in the next section. This procedure is well known in Physics and it has been exploited in the so-called \Linear Delta Expansion" (LDE) and similar approaches [AFC 1990, Jo 1995, Fe 2000].
    [Show full text]
  • Rate of Convergence for the Fourier Series of a Function with Gibbs Phenomenon
    A Proof, Based on the Euler Sum Acceleration, of the Recovery of an Exponential (Geometric) Rate of Convergence for the Fourier Series of a Function with Gibbs Phenomenon John P. Boyd∗ Department of Atmospheric, Oceanic and Space Science and Laboratory for Scientific Computation, University of Michigan, 2455 Hayward Avenue, Ann Arbor MI 48109 [email protected]; http://www.engin.umich.edu:/∼ jpboyd/ March 26, 2010 Abstract When a function f(x)is singular at a point xs on the real axis, its Fourier series, when truncated at the N-th term, gives a pointwise error of only O(1/N) over the en- tire real axis. Such singularities spontaneously arise as “fronts” in meteorology and oceanography and “shocks” in other branches of fluid mechanics. It has been pre- viously shown that it is possible to recover an exponential rate of convegence at all | − σ |∼ − points away from the singularity in the sense that f(x) fN (x) O(exp( q(x)N)) σ where fN (x) is the result of applying a filter or summability method to the partial sum fN (x) and q(x) is a proportionality constant that is a function of d(x) ≡ |x − xs |, the distance from x to the singularity. Here we give an elementary proof of great generality using conformal mapping in a dummy variable z; this is equiva- lent to applying the Euler acceleration. We show that q(x) ≈ log(cos(d(x)/2)) for the Euler filter when the Fourier period is 2π. More sophisticated filters can in- crease q(x), but the Euler filter is simplest.
    [Show full text]
  • Numerical Linear Algebra Revised February 15, 2010 4.1 the LU
    Numerical Linear Algebra Revised February 15, 2010 4.1 The LU Decomposition The Elementary Matrices and badgauss In the previous chapters we talked a bit about the solving systems of the form Lx = b and Ux = b where L is lower triangular and U is upper triangular. In the exercises for Chapter 2 you were asked to write a program x=lusolver(L,U,b) which solves LUx = b using forsub and backsub. We now address the problem of representing a matrix A as a product of a lower triangular L and an upper triangular U: Recall our old friend badgauss. function B=badgauss(A) m=size(A,1); B=A; for i=1:m-1 for j=i+1:m a=-B(j,i)/B(i,i); B(j,:)=a*B(i,:)+B(j,:); end end The heart of badgauss is the elementary row operation of type 3: B(j,:)=a*B(i,:)+B(j,:); where a=-B(j,i)/B(i,i); Note also that the index j is greater than i since the loop is for j=i+1:m As we know from linear algebra, an elementary opreration of type 3 can be viewed as matrix multipli- cation EA where E is an elementary matrix of type 3. E looks just like the identity matrix, except that E(j; i) = a where j; i and a are as in the MATLAB code above. In particular, E is a lower triangular matrix, moreover the entries on the diagonal are 1's. We call such a matrix unit lower triangular.
    [Show full text]
  • Massively Parallel Poisson and QR Factorization Solvers
    Computers Math. Applic. Vol. 31, No. 4/5, pp. 19-26, 1996 Pergamon Copyright~)1996 Elsevier Science Ltd Printed in Great Britain. All rights reserved 0898-1221/96 $15.00 + 0.00 0898-122 ! (95)00212-X Massively Parallel Poisson and QR Factorization Solvers M. LUCK£ Institute for Control Theory and Robotics, Slovak Academy of Sciences DdbravskA cesta 9, 842 37 Bratislava, Slovak Republik utrrluck@savba, sk M. VAJTERSIC Institute of Informatics, Slovak Academy of Sciences DdbravskA cesta 9, 840 00 Bratislava, P.O. Box 56, Slovak Republic kaifmava©savba, sk E. VIKTORINOVA Institute for Control Theoryand Robotics, Slovak Academy of Sciences DdbravskA cesta 9, 842 37 Bratislava, Slovak Republik utrrevka@savba, sk Abstract--The paper brings a massively parallel Poisson solver for rectangle domain and parallel algorithms for computation of QR factorization of a dense matrix A by means of Householder re- flections and Givens rotations. The computer model under consideration is a SIMD mesh-connected toroidal n x n processor array. The Dirichlet problem is replaced by its finite-difference analog on an M x N (M + 1, N are powers of two) grid. The algorithm is composed of parallel fast sine transform and cyclic odd-even reduction blocks and runs in a fully parallel fashion. Its computational complexity is O(MN log L/n2), where L = max(M + 1, N). A parallel proposal of QI~ factorization by the Householder method zeros all subdiagonal elements in each column and updates all elements of the given submatrix in parallel. For the second method with Givens rotations, the parallel scheme of the Sameh and Kuck was chosen where the disjoint rotations can be computed simultaneously.
    [Show full text]
  • Polylog and Hurwitz Zeta Algorithms Paper
    AN EFFICIENT ALGORITHM FOR ACCELERATING THE CONVERGENCE OF OSCILLATORY SERIES, USEFUL FOR COMPUTING THE POLYLOGARITHM AND HURWITZ ZETA FUNCTIONS LINAS VEPŠTAS ABSTRACT. This paper sketches a technique for improving the rate of convergence of a general oscillatory sequence, and then applies this series acceleration algorithm to the polylogarithm and the Hurwitz zeta function. As such, it may be taken as an extension of the techniques given by Borwein’s “An efficient algorithm for computing the Riemann zeta function”[4, 5], to more general series. The algorithm provides a rapid means of evaluating Lis(z) for¯ general values¯ of complex s and a kidney-shaped region of complex z values given by ¯z2/(z − 1)¯ < 4. By using the duplication formula and the inversion formula, the range of convergence for the polylogarithm may be extended to the entire complex z-plane, and so the algorithms described here allow for the evaluation of the polylogarithm for all complex s and z values. Alternatively, the Hurwitz zeta can be very rapidly evaluated by means of an Euler- Maclaurin series. The polylogarithm and the Hurwitz zeta are related, in that two evalua- tions of the one can be used to obtain a value of the other; thus, either algorithm can be used to evaluate either function. The Euler-Maclaurin series is a clear performance winner for the Hurwitz zeta, while the Borwein algorithm is superior for evaluating the polylogarithm in the kidney-shaped region. Both algorithms are superior to the simple Taylor’s series or direct summation. The primary, concrete result of this paper is an algorithm allows the exploration of the Hurwitz zeta in the critical strip, where fast algorithms are otherwise unavailable.
    [Show full text]
  • Evolving Software Repositories
    1 Evolving Software Rep ositories http://www.netli b.org/utk/pro ject s/esr/ Jack Dongarra UniversityofTennessee and Oak Ridge National Lab oratory Ron Boisvert National Institute of Standards and Technology Eric Grosse AT&T Bell Lab oratories 2 Pro ject Fo cus Areas NHSE Overview Resource Cataloging and Distribution System RCDS Safe execution environments for mobile co de Application-l evel and content-oriented to ols Rep ository interop erabili ty Distributed, semantic-based searching 3 NHSE National HPCC Software Exchange NASA plus other agencies funded CRPC pro ject Center for ResearchonParallel Computation CRPC { Argonne National Lab oratory { California Institute of Technology { Rice University { Syracuse University { UniversityofTennessee Uniform interface to distributed HPCC software rep ositories Facilitation of cross-agency and interdisciplinary software reuse Material from ASTA, HPCS, and I ITA comp onents of the HPCC program http://www.netlib.org/nhse/ 4 Goals: Capture, preserve and makeavailable all software and software- related artifacts pro duced by the federal HPCC program. Soft- ware related artifacts include algorithms, sp eci cations, designs, do cumentation, rep ort, ... Promote formation, growth, and interop eration of discipline-oriented rep ositories that organize, evaluate, and add value to individual contributions. Employ and develop where necessary state-of-the-art technologies for assisting users in nding, understanding, and using HPCC software and technologies. 5 Bene ts: 1. Faster development of high-quality software so that scientists can sp end less time writing and debugging programs and more time on research problems. 2. Less duplication of software development e ort by sharing of soft- ware mo dules.
    [Show full text]
  • A Probabilistic Perspective
    Acceleration methods for series: A probabilistic perspective Jos´eA. Adell and Alberto Lekuona Abstract. We introduce a probabilistic perspective to the problem of accelerating the convergence of a wide class of series, paying special attention to the computation of the coefficients, preferably in a recur- sive way. This approach is mainly based on a differentiation formula for the negative binomial process which extends the classical Euler's trans- formation. We illustrate the method by providing fast computations of the logarithm and the alternating zeta functions, as well as various real constants expressed as sums of series, such as Catalan, Stieltjes, and Euler-Mascheroni constants. Mathematics Subject Classification (2010). Primary 11Y60, 60E05; Sec- ondary 33B15, 41A35. Keywords. Series acceleration, negative binomial process, alternating zeta function, Catalan constant, Stieltjes constants, Euler-Mascheroni constant. 1. Introduction Suppose that a certain function or real constant is given by a series of the form 1 X f(j)rj; 0 < r < 1: (1.1) j=0 From a computational point of view, it is not only important that the geo- metric rate r is a rational number as small as possible, but also that the coefficients f(j) are easy to compute, since the series in (1.1) can also be written as 1 X (f(2j) + rf(2j + 1)) r2j ; j=0 The authors are partially supported by Research Projects DGA (E-64), MTM2015-67006- P, and by FEDER funds. 2 Adell and Lekuona thus improving the geometric rate from r to r2. Obviously, this procedure can be successively implemented (see formula (2.8) in Section 2).
    [Show full text]
  • The Sparse Matrix Transform for Covariance Estimation and Analysis of High Dimensional Signals
    The Sparse Matrix Transform for Covariance Estimation and Analysis of High Dimensional Signals Guangzhi Cao*, Member, IEEE, Leonardo R. Bachega, and Charles A. Bouman, Fellow, IEEE Abstract Covariance estimation for high dimensional signals is a classically difficult problem in statistical signal analysis and machine learning. In this paper, we propose a maximum likelihood (ML) approach to covariance estimation, which employs a novel non-linear sparsity constraint. More specifically, the covariance is constrained to have an eigen decomposition which can be represented as a sparse matrix transform (SMT). The SMT is formed by a product of pairwise coordinate rotations known as Givens rotations. Using this framework, the covariance can be efficiently estimated using greedy optimization of the log-likelihood function, and the number of Givens rotations can be efficiently computed using a cross- validation procedure. The resulting estimator is generally positive definite and well-conditioned, even when the sample size is limited. Experiments on a combination of simulated data, standard hyperspectral data, and face image sets show that the SMT-based covariance estimates are consistently more accurate than both traditional shrinkage estimates and recently proposed graphical lasso estimates for a variety of different classes and sample sizes. An important property of the new covariance estimate is that it naturally yields a fast implementation of the estimated eigen-transformation using the SMT representation. In fact, the SMT can be viewed as a generalization of the classical fast Fourier transform (FFT) in that it uses “butterflies” to represent an orthonormal transform. However, unlike the FFT, the SMT can be used for fast eigen-signal analysis of general non-stationary signals.
    [Show full text]