You are on page 1of 53

Computational methods for numerical

analysis with R 1st Edition James


Patrick Howard Ii
Visit to download the full and correct content document:
https://textbookfull.com/product/computational-methods-for-numerical-analysis-with-r-
1st-edition-james-patrick-howard-ii/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Spatial analysis with R: statistics, visualization, and


computational methods Second Edition Oyana

https://textbookfull.com/product/spatial-analysis-with-r-
statistics-visualization-and-computational-methods-second-
edition-oyana/

Teaching and Learning Mathematics Online 1st Edition


James P. Howard Ii (Editor)

https://textbookfull.com/product/teaching-and-learning-
mathematics-online-1st-edition-james-p-howard-ii-editor/

Numerical Methods of Exploration Seismology With


Algorithms in Matlab r Gary F. Margrave

https://textbookfull.com/product/numerical-methods-of-
exploration-seismology-with-algorithms-in-matlab-r-gary-f-
margrave/

Computational Stem Cell Biology Methods and Protocols


Patrick Cahan

https://textbookfull.com/product/computational-stem-cell-biology-
methods-and-protocols-patrick-cahan/
Using R for Numerical Analysis in Science and
Engineering 1st Edition Victor A. Bloomfield

https://textbookfull.com/product/using-r-for-numerical-analysis-
in-science-and-engineering-1st-edition-victor-a-bloomfield/

Statistical Analysis of Financial Data: With Examples


In R 1st Edition James Gentle

https://textbookfull.com/product/statistical-analysis-of-
financial-data-with-examples-in-r-1st-edition-james-gentle/

Computational Methods for Next Generation Sequencing


Data Analysis 1st Edition Ion Mandoiu

https://textbookfull.com/product/computational-methods-for-next-
generation-sequencing-data-analysis-1st-edition-ion-mandoiu/

Computational Methods for Single-Cell Data Analysis


Guo-Cheng Yuan

https://textbookfull.com/product/computational-methods-for-
single-cell-data-analysis-guo-cheng-yuan/

Numerical Methods in Physics with Python 1st Edition


Alex Gezerlis

https://textbookfull.com/product/numerical-methods-in-physics-
with-python-1st-edition-alex-gezerlis/
Computational Methods for
Numerical Analysis with R
CHAPMAN & HALL/CRC
Numerical Analysis and Scientific Computing

Aims and scope:


Scientific computing and numerical analysis provide invaluable tools for the sciences and engineering.
This series aims to capture new developments and summarize state-of-the-art methods over the whole
spectrum of these fields. It will include a broad range of textbooks, monographs, and handbooks.
Volumes in theory, including discretisation techniques, numerical algorithms, multiscale techniques,
parallel and distributed algorithms, as well as applications of these methods in multi-disciplinary fields,
are welcome. The inclusion of concrete real-world examples is highly encouraged. This series is meant
to appeal to students and researchers in mathematics, engineering, and computational science.

Editors
Choi-Hong Lai Frédéric Magoulès
School of Computing and Applied Mathematics and
Mathematical Sciences Systems Laboratory
University of Greenwich Ecole Centrale Paris

Editorial Advisory Board

Mark Ainsworth Peter Jimack


Mathematics Department School of Computing
Strathclyde University University of Leeds

Todd Arbogast Takashi Kako


Institute for Computational Department of Computer Science
Engineering and Sciences The University of Electro-Communications
The University of Texas at Austin
Peter Monk
Craig C. Douglas Department of Mathematical Sciences
Computer Science Department University of Delaware
University of Kentucky
Francois-Xavier Roux
Ivan Graham ONERA
Department of Mathematical Sciences
University of Bath Arthur E.P. Veldman
Institute of Mathematics and Computing Science
University of Groningen

Proposals for the series should be submitted to one of the series editors above or directly to:
CRC Press, Taylor & Francis Group
3 Park Square, Milton Park
Abingdon, Oxfordshire OX14 4RN
UK
Published Titles
Classical and Modern Numerical Analysis: Theory, Methods and Practice
Azmy S. Ackleh, Edward James Allen, Ralph Baker Kearfott, and Padmanabhan Seshaiyer
Cloud Computing: Data-Intensive Computing and Scheduling Frédéric Magoulès, Jie Pan,
and Fei Teng
Computational Fluid Dynamics Frédéric Magoulès
Computational Methods for Numerical Analysis with R James P. Howard, II
A Concise Introduction to Image Processing using C++ Meiqing Wang and Choi-Hong Lai
Coupled Systems: Theory, Models, and Applications in Engineering Juergen Geiser
Decomposition Methods for Differential Equations: Theory and Applications Juergen Geiser
Designing Scientific Applications on GPUs Raphaël Couturier
Desktop Grid Computing Christophe Cérin and Gilles Fedak
Discrete Dynamical Systems and Chaotic Machines: Theory and Applications
Jacques M. Bahi and Christophe Guyeux
Discrete Variational Derivative Method: A Structure-Preserving Numerical Method for
Partial Differential Equations Daisuke Furihata and Takayasu Matsuo
Grid Resource Management: Toward Virtual and Services Compliant Grid Computing
Frédéric Magoulès, Thi-Mai-Huong Nguyen, and Lei Yu
Fundamentals of Grid Computing: Theory, Algorithms and Technologies Frédéric Magoulès
Handbook of Sinc Numerical Methods Frank Stenger
Introduction to Grid Computing Frédéric Magoulès, Jie Pan, Kiat-An Tan, and Abhinit Kumar
Iterative Splitting Methods for Differential Equations Juergen Geiser
Mathematical Objects in C++: Computational Tools in a Unified Object-Oriented Approach
Yair Shapira
Numerical Linear Approximation in C Nabih N. Abdelmalek and William A. Malek
Numerical Methods and Optimization: An Introduction Sergiy Butenko and Panos M. Pardalos
Numerical Methods for Fractional Calculus Changpin Li and Fanhai Zeng
Numerical Techniques for Direct and Large-Eddy Simulations Xi Jiang and Choi-Hong Lai
Parallel Algorithms Henri Casanova, Arnaud Legrand, and Yves Robert
Parallel Iterative Algorithms: From Sequential to Grid Computing Jacques M. Bahi,
Sylvain Contassot-Vivier, and Raphaël Couturier
Particle Swarm Optimisation: Classical and Quantum Perspectives Jun Sun, Choi-Hong Lai,
and Xiao-Jun Wu
XML in Scientific Computing C. Pozrikidis
Computational Methods for
Numerical Analysis with R

James P. Howard, II
The Johns Hopkins University
Applied Physics Laboratory
Laurel, Maryland, USA
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742

© 2017 by Taylor & Francis Group, LLC


CRC Press is an imprint of Taylor & Francis Group, an Informa business

No claim to original U.S. Government works

Printed on acid-free paper


Version Date: 20170516

International Standard Book Number-13: 978-1-4987-2363-3 (Hardback)

This book contains information obtained from authentic and highly regarded sources. Reasonable
efforts have been made to publish reliable data and information, but the author and publisher cannot
assume responsibility for the validity of all materials or the consequences of their use. The authors and
publishers have attempted to trace the copyright holders of all material reproduced in this publication
and apologize to copyright holders if permission to publish in this form has not been obtained. If any
copyright material has not been acknowledged please write and let us know so we may rectify in any
future reprint.

Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced,
transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or
hereafter invented, including photocopying, microfilming, and recording, or in any information
storage or retrieval system, without written permission from the publishers.

For permission to photocopy or use material electronically from this work, please access
www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc.
(CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization
that provides licenses and registration for a variety of users. For organizations that have been granted
a photocopy license by the CCC, a separate system of payment has been arranged.

Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and
are used only for identification and explanation without intent to infringe.
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
and the CRC Press Web site at
http://www.crcpress.com
To Nina, Chase (see Figure 4.13),
and Ducky (see Figure 4.14)
Contents

List of Figures xiii

List of Tables xv

List of R Functions xvii

Preface xix

1 Introduction to Numerical Analysis 1

1.1 Numerical Analysis . . . . . . . . . . . . . . . . . . . . . . . 1


1.1.1 The Goals of Numerical Analysis . . . . . . . . . . . . 1
1.1.2 Numerical Analysis in R . . . . . . . . . . . . . . . . . 3
1.1.3 Efficiency . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Data Types in R . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.1 Data Types . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.2 Data Structures . . . . . . . . . . . . . . . . . . . . . 11
1.3 Elementary Problems . . . . . . . . . . . . . . . . . . . . . . 16
1.3.1 Summation Algorithms . . . . . . . . . . . . . . . . . 16
1.3.2 Evaluating Polynomials . . . . . . . . . . . . . . . . . 20
1.3.3 The nth Root Algorithm . . . . . . . . . . . . . . . . 24
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

2 Error Analysis 29

2.1 True Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 29


2.1.1 Accuracy . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.1.2 Precision . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.2 Internal Data Storage . . . . . . . . . . . . . . . . . . . . . . 35
2.2.1 Binary Numbers . . . . . . . . . . . . . . . . . . . . . 35
2.2.2 Floating Point Numbers . . . . . . . . . . . . . . . . . 37
2.3 Numerical Error . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.3.1 Round-Off Error and Machine  . . . . . . . . . . . . 42
2.3.2 Loss of Significance . . . . . . . . . . . . . . . . . . . . 44
2.3.3 Overflow and Underflow . . . . . . . . . . . . . . . . . 48
2.3.4 Error Propagation and Stability . . . . . . . . . . . . 50

ix
x Contents

2.4 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.4.1 Simple Division Algorithms . . . . . . . . . . . . . . . 53
2.4.2 Binary Long Division . . . . . . . . . . . . . . . . . . 55
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

3 Linear Algebra 59

3.1 Vectors and Matrices . . . . . . . . . . . . . . . . . . . . . . 59


3.1.1 Vector and Matrix Operations . . . . . . . . . . . . . 59
3.1.2 Elementary Row Operations . . . . . . . . . . . . . . . 64
3.2 Gaussian Elimination . . . . . . . . . . . . . . . . . . . . . . 67
3.2.1 Row Echelon Form . . . . . . . . . . . . . . . . . . . . 67
3.2.2 Tridiagonal Matrices . . . . . . . . . . . . . . . . . . . 73
3.3 Matrix Decomposition . . . . . . . . . . . . . . . . . . . . . . 76
3.3.1 LU Decomposition . . . . . . . . . . . . . . . . . . . . 76
3.3.2 Cholesky Decomposition . . . . . . . . . . . . . . . . . 80
3.4 Iterative Methods . . . . . . . . . . . . . . . . . . . . . . . . 82
3.4.1 Jacobi Iteration . . . . . . . . . . . . . . . . . . . . . . 83
3.4.2 Gauss–Seidel Iteration . . . . . . . . . . . . . . . . . . 86
3.5 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.5.1 Least Squares . . . . . . . . . . . . . . . . . . . . . . . 89
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

4 Interpolation and Extrapolation 95

4.1 Polynomial Interpolation . . . . . . . . . . . . . . . . . . . . 95


4.1.1 Linear Interpolation . . . . . . . . . . . . . . . . . . . 95
4.1.2 Higher-Order Polynomial Interpolation . . . . . . . . . 97
4.2 Piecewise Interpolation . . . . . . . . . . . . . . . . . . . . . 102
4.2.1 Piecewise Linear Interpolation . . . . . . . . . . . . . 103
4.2.2 Cubic Spline Interpolation . . . . . . . . . . . . . . . . 105
4.2.3 Bézier Curves . . . . . . . . . . . . . . . . . . . . . . . 110
4.3 Multidimensional Interpolation . . . . . . . . . . . . . . . . . 115
4.3.1 Bilinear Interpolation . . . . . . . . . . . . . . . . . . 115
4.3.2 Nearest Neighbor Interpolation . . . . . . . . . . . . . 119
4.4 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
4.4.1 Time Series Interpolation . . . . . . . . . . . . . . . . 122
4.4.2 Computer Graphics . . . . . . . . . . . . . . . . . . . 125
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Contents xi

5 Differentiation and Integration 133

5.1 Numerical Differentiation . . . . . . . . . . . . . . . . . . . . 133


5.1.1 Finite Differences . . . . . . . . . . . . . . . . . . . . . 133
5.1.2 The Second Derivative . . . . . . . . . . . . . . . . . . 137
5.2 Newton–Cotes Integration . . . . . . . . . . . . . . . . . . . 138
5.2.1 Multipanel Interpolation Rules . . . . . . . . . . . . . 139
5.2.2 Newton–Cotes Errors . . . . . . . . . . . . . . . . . . 145
5.2.3 Newton–Cotes Forms, Generally . . . . . . . . . . . . 147
5.3 Gaussian Integration . . . . . . . . . . . . . . . . . . . . . . 149
5.3.1 The Gaussian Method . . . . . . . . . . . . . . . . . . 149
5.3.2 Implementation Details . . . . . . . . . . . . . . . . . 151
5.4 More Techniques . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.4.1 Adaptive Integrators . . . . . . . . . . . . . . . . . . . 153
5.4.2 Romberg’s Method . . . . . . . . . . . . . . . . . . . . 156
5.4.3 Monte Carlo Methods . . . . . . . . . . . . . . . . . . 159
5.5 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
5.5.1 Revolved Volumes . . . . . . . . . . . . . . . . . . . . 163
5.5.2 Gini Coefficients . . . . . . . . . . . . . . . . . . . . . 168
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173

6 Root Finding and Optimization 175

6.1 One-Dimensional Root Finding . . . . . . . . . . . . . . . . . 175


6.1.1 Bisection Method . . . . . . . . . . . . . . . . . . . . . 175
6.1.2 Newton–Raphson Method . . . . . . . . . . . . . . . . 179
6.1.3 Secant Method . . . . . . . . . . . . . . . . . . . . . . 183
6.2 Minimization and Maximization . . . . . . . . . . . . . . . . 185
6.2.1 Golden Section Search . . . . . . . . . . . . . . . . . . 185
6.2.2 Gradient Descent . . . . . . . . . . . . . . . . . . . . . 188
6.3 Multidimensional Optimization . . . . . . . . . . . . . . . . . 192
6.3.1 Multidimensional Gradient Descent . . . . . . . . . . . 192
6.3.2 Hill Climbing . . . . . . . . . . . . . . . . . . . . . . . 195
6.3.3 Simulated Annealing . . . . . . . . . . . . . . . . . . . 197
6.4 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
6.4.1 Least Squares . . . . . . . . . . . . . . . . . . . . . . . 200
6.4.2 The Traveling Salesperson . . . . . . . . . . . . . . . . 203
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

7 Differential Equations 213

7.1 Initial Value Problems . . . . . . . . . . . . . . . . . . . . . . 213


7.1.1 Euler Method . . . . . . . . . . . . . . . . . . . . . . . 213
xii Contents

7.1.2 Runge–Kutta Methods, Generally . . . . . . . . . . . 219


7.1.3 Linear Multistep Methods . . . . . . . . . . . . . . . . 224
7.2 Systems of Ordinary Differential Equations . . . . . . . . . . 227
7.2.1 Solution Systems and Initial Value Problems . . . . . 228
7.2.2 Boundary Value Problems . . . . . . . . . . . . . . . . 231
7.3 Partial Differential Equations . . . . . . . . . . . . . . . . . . 234
7.3.1 The Heat Equation . . . . . . . . . . . . . . . . . . . . 234
7.3.2 The Wave Equation . . . . . . . . . . . . . . . . . . . 238
7.4 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
7.4.1 Carbon Dating . . . . . . . . . . . . . . . . . . . . . . 242
7.4.2 Lotka–Volterra Equations . . . . . . . . . . . . . . . . 244
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

Suggested Reading 249

Index 253
List of Figures

1.1 Assembly of partial sums in piecewise addition . . . . . . . . 18

2.1 Newark is near New York . . . . . . . . . . . . . . . . . . . 30


2.2 At least we got to New York, this time . . . . . . . . . . . . 32
2.3 A journey of a thousand miles starts with a good map . . . 33
2.4 Error in the measurement of length . . . . . . . . . . . . . . 51
2.5 Additive error in measurement of length . . . . . . . . . . . 51
2.6 Multiplicative error in measurement of length . . . . . . . . 52

4.1 Linear interpolation of two points . . . . . . . . . . . . . . . 96


4.2 Quadratic interpolation of three points . . . . . . . . . . . . 100
4.3 Cubic interpolation of y = tan ((x − 1/4)) + 1 . . . . . . . . 101
4.4 Piecewise linear interpolation of four points . . . . . . . . . 103
4.5 Cubic spline interpolation of four points . . . . . . . . . . . 109
4.6 Cubic spline interpolation of five points . . . . . . . . . . . . 110
4.7 Quadratic Bézier interpolation of three points . . . . . . . . 113
4.8 Cubic Bézier interpolation of four points . . . . . . . . . . . 115
4.9 Cubic Bézier interpolation of four points, with crossover . . 116
4.10 Bilinear interpolation example . . . . . . . . . . . . . . . . . 118
4.11 Nearest neighbor interpolation in one dimension . . . . . . . 120
4.12 Two-dimensional nearest neighbor example . . . . . . . . . . 121
4.13 ckbh image at 400 pixels and 200 pixels, scaled using nearest
neighbor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
4.14 babh image at 400 pixels and 200 pixels, scaled using bilinear
interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

5.1 Derivative of sin x at x = π/4 for step sizes h = {1, 0.5, 0.01} 135
5.2 The midpoint rule for f (x) = x2 with m = 2 and m = 4 . . 140
5.3 The trapezoid rule for f (x) = x2 with√m = 2 and m = 4 . . 142
5.4 The Monte Carlo method for f (x) = 1 − x2 with m = 20 . 160
5.5 Cylinder as a rotated solid around the x-axis and y-axis . . 165
5.6 Rotated volume around the x-axis . . . . . . . . . . . . . . . 166
5.7 Rotated volume around the y-axis . . . . . . . . . . . . . . . 167
5.8 Lorenz curve . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

6.1 The roots of f (x) = x2 − 1 . . . . . . . . . . . . . . . . . . . 176


6.2 The roots of f (x) = x3 − x . . . . . . . . . . . . . . . . . . . 178

xiii
xiv Computational Methods for Numerical Analysis with R

6.3 Finding a real root of x3 − 2x2 − x + 2 . . . . . . . . . . . . 180


6.4 Golden section search on f (x) = −x2 + 4x + 1 . . . . . . . . 186
6.5 Golden section search on f (x) = sin x − x2 . . . . . . . . . . 188
6.6 Gradient descent on 41 x4 + x3 − x − 1 . . . . . . . . . . . . . 189
6.7 Plot of f (x1 , x2 ) = (x1 − 1)2 + (2x2 − 2)2 . . . . . . . . . . 194
y
7.1 Vector field of f 0 (x, y) = 2x+1 . . . . . . . . . . . . . . . . . 214
7.2 Euler method with h = 0.5 and 0.2 . . . . . . . . . . . . . . 216
7.3 Integration of f 0 (x, y) = −10y . . . . . . . . . . . . . . . . . 218
7.4 Euler and midpoint initial value problem example . . . . . . 220
7.5 Midpoint and fourth order Runge–Kutta methods with h =
0.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
7.6 Adams–Bashforth with h = 0.5 and 0.2 . . . . . . . . . . . . 227
7.7 Plot of bvpexample for x ∈ [−2, 2] . . . . . . . . . . . . . . 233
7.8 Heat equation plot for ∆t = 0.001 . . . . . . . . . . . . . . . 237
7.9 Heat equation plot for ∆t = 0.0015 . . . . . . . . . . . . . . 238
7.10 Wave equation plot for ∆t = 0.001 . . . . . . . . . . . . . . 241
7.11 Lotka–Volterra model for a hypothetical population dynamic 246
List of Tables

2.1 Hexadecimal, decimal, and binary numbers with equivalents 36

4.1 Time series interpolation examples . . . . . . . . . . . . . . 125

5.1 Gauss–Legendre points and weights for n = 1, 2, 3, 4 . . . . . 152

xv
List of R Functions

1.1 The Fibonacci sequence . . . . . . . . . . . . . . . . . . . . 4


1.2 Test an integer for primality . . . . . . . . . . . . . . . . . . 7
1.3 The naı̈ve approach to summing a vector . . . . . . . . . . . 17
1.4 The pairwise summation algorithm . . . . . . . . . . . . . . 18
1.5 The Kahan summation algorithm . . . . . . . . . . . . . . . 19
1.6 The algebraic approach to evaluating polynomials . . . . . . 21
1.7 A better algebraic approach to polynomial evaluation . . . . 22
1.8 Horner’s rule for polynomial evaluation . . . . . . . . . . . . 23
1.9 The nth root algorithm . . . . . . . . . . . . . . . . . . . . . 25

2.1 The quadratic formula . . . . . . . . . . . . . . . . . . . . . 46


2.2 The quadratic formula rewritten . . . . . . . . . . . . . . . . 47
2.3 Naı̈ve division by repeated subtraction . . . . . . . . . . . . 54
2.4 Binary long division . . . . . . . . . . . . . . . . . . . . . . 56

3.1 The row scaling algorithm . . . . . . . . . . . . . . . . . . . 65


3.2 The row swapping algorithm . . . . . . . . . . . . . . . . . . 65
3.3 The row replacement algorithm . . . . . . . . . . . . . . . . 66
3.4 The row echelon matrix form . . . . . . . . . . . . . . . . . 68
3.5 The reduced row echelon matrix form . . . . . . . . . . . . . 70
3.6 Use reduced row echelon form to solve linear equations . . . 73
3.7 Tridiagonal matrix algorithm . . . . . . . . . . . . . . . . . 75
3.8 The matrix LU decomposition function . . . . . . . . . . . . 79
3.9 The Cholesky decomposition . . . . . . . . . . . . . . . . . . 82
3.10 Find the norm of a vector . . . . . . . . . . . . . . . . . . . 83
3.11 Jacobi iteration for diagonally dominant matrices . . . . . . 85
3.12 Gauss–Seidel iteration for diagonally dominant matrices . . 87

4.1 Linear interpolation . . . . . . . . . . . . . . . . . . . . . . . 97


4.2 Vandermonde polynomial interpolation . . . . . . . . . . . . 99
4.3 Piecewise linear interpolation . . . . . . . . . . . . . . . . . 104
4.4 The natural cubic spline . . . . . . . . . . . . . . . . . . . . 108
4.5 Quadratic Bézier curves . . . . . . . . . . . . . . . . . . . . 112
4.6 Cubic Bézier curves . . . . . . . . . . . . . . . . . . . . . . . 114
4.7 Bilinear interpolation . . . . . . . . . . . . . . . . . . . . . . 117
4.8 Nearest neighbor interpolation . . . . . . . . . . . . . . . . . 121

xvii
xviii Computational Methods for Numerical Analysis with R

4.9 Image resizing via nearest neighbor . . . . . . . . . . . . . . 126


4.10 Image resizing via bilinear interpolation . . . . . . . . . . . 129

5.1 Finite differences formula . . . . . . . . . . . . . . . . . . . . 134


5.2 Symmetric finite differences formula . . . . . . . . . . . . . . 136
5.3 Second derivative via finite differences . . . . . . . . . . . . 138
5.4 The midpoint rule . . . . . . . . . . . . . . . . . . . . . . . . 141
5.5 The trapezoid rule . . . . . . . . . . . . . . . . . . . . . . . 142
5.6 Simpson’s rule . . . . . . . . . . . . . . . . . . . . . . . . . . 143
5.7 Simpson’s 3/8 rule . . . . . . . . . . . . . . . . . . . . . . . 145
5.8 Gaussian integration method driver . . . . . . . . . . . . . . 151
5.9 Gauss–Legendre integration using precomputed weights . . . 153
5.10 Adaptive method with midpoint rule . . . . . . . . . . . . . 155
5.11 Romberg’s method for integration . . . . . . . . . . . . . . . 158
5.12 Univariate Monte Carlo integration . . . . . . . . . . . . . . 161
5.13 Bivariate Monte Carlo integration . . . . . . . . . . . . . . . 162
5.14 Disc method for the volume of revolved solids . . . . . . . . 165
5.15 Shell method for the volume of revolved solids . . . . . . . . 166
5.16 Gerber’s method for Gini quintiles . . . . . . . . . . . . . . 170

6.1 Finding roots via bisection . . . . . . . . . . . . . . . . . . . 177


6.2 Finding roots via the Newton–Raphson method . . . . . . . 181
6.3 Finding roots via the secant method . . . . . . . . . . . . . 183
6.4 Golden section search for local maxima . . . . . . . . . . . . 187
6.5 Gradient descent for local minima . . . . . . . . . . . . . . . 190
6.6 Gradient ascent for local maxima . . . . . . . . . . . . . . . 191
6.7 Gradient descent for n dimensions . . . . . . . . . . . . . . . 193
6.8 Hill climbing for n dimensions . . . . . . . . . . . . . . . . . 196
6.9 Simulated annealing for n dimensions . . . . . . . . . . . . . 198
6.10 Least squares via gradient descent . . . . . . . . . . . . . . . 202
6.11 The traveling salesperson problem via simulated annealing . 205

7.1 Euler method for ordinary differential equations . . . . . . . 215


7.2 Midpoint method for ordinary differential equations . . . . . 221
7.3 Fourth-order Runge–Kutta method for ordinary differential
equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
7.4 Adams–Bashforth method for ordinary differential equations 225
7.5 Euler method for systems of ordinary differential equations . 229
7.6 Example boundary value problem, f 00 (x, y) = y 2 −2, f (0) = 1,
and f (1) = 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
7.7 The heat equation via the forward-time central-space method 236
7.8 The wave equation via finite differences . . . . . . . . . . . . 239
Preface

Computational Methods for Numerical Analysis with R(cmna) is a treatment


of the traditional numerical analysis course using R as the underlying program-
ming language. The traditional numerical analysis outline begins with numer-
ical error, then linear algebra, interpolation, integration, optimization, and
differential equations. In this way, the outline covers the entire introductory
mathematically sequence. This text is suitable for the advanced undergraduate
student or first year graduate student. The book will require a solid under-
standing of linear algebra, differential and integral calculus, and differential
equations. Students of mathematics, computer science, physics, engineering,
and other mathematically intensive disciplines will have sufficient background
to read and understand the book.
My motivation for writing this book is the lack of similar materials in
the market. There are several commonly used textbooks that teach numerical
analysis using matlab® . Others use C or Fortran. matlab® is a very expen-
sive program and while available on college campuses, is not cheap enough
for most graduates to purchase. C and Fortran are inexpensive or free, but
require basic programming skills to manage data input and output, memory,
and other tasks that should not be set upon someone trying to learn a specific
set of skills. R provides a rich environment that students are already familiar
with due to its rapidly growing user base. It is free for all users and it does
not require intensive “environmental management” when programming, as is
required in, for instance, Java.
The primary audience for this book are individuals interested in a deeper
understanding of the methodological approaches used in numerical analysis,
especially as they apply to computational statistics and data science. The
audience should have a solid grounding in mathematics through calculus and
differential equations. Data scientists can also use this text as the starting
point for implementing new analytical techniques in R.
This book presents a different approach to computational methods. Rather
than focusing on theory and proofs, we focus on the value of working code,
and shy away from formal proofs. The code is demonstrated, as functioning,
directly in the text. Using working code as our guide, our goal is to reach an
intuitive understanding of the process each algorithm uses through explana-
tion, code, and examples. With that understanding, we can modify, support,
and improve these codes. More importantly, we can understand what R, or
some other language, is doing when it executes its internal functions to solve
numerical problems.

xix
xx Computational Methods for Numerical Analysis with R

Each section of this text present a type of problem and a numerical solu-
tion. The problem is described briefly and the numerical solution is explained.
Then the R code implementing that solution is described, along with any
specific implementation details. From there examples are given. Where ap-
propriate, examples showing where the algorithm can fail are provided along
with suggestions for where robust implementations are available as part of the
standard R distributions, or one of the many packages available from cran.
Because this book focuses on working code, this book is not meant to be
a textbook. However, its structure mirrors the structure of an undergraduate
computational methods course. As such, this text would be appropriate an
textbook for courses entitled Numerical Analysis, Computational Methods,
Scientific Computing, or similar courses, if the instructor is willing to forego
rigours analytical approaches. cmna would better serve as a secondary text
for one of these courses when the text provides weaker examples, or in an
inaccessible manner, such as Fortran or matlab® .
I would like to thank the following Rob Calver, Lara Spieker, and many
others at CRC Press for seeing this book through to completion. I would also
like to thank Marck Vaisman, Elizabeth Shope, Kelley O’Neal, James Long,
and Casey Driscoll, who all offered great comments at one point or another.
I also want to thank two anonymous reviewers for extensive and insightful
comments on the text. Any errors remaining are only my responsibility.
1
Introduction to Numerical Analysis

1.1 Numerical Analysis


Numerical analysis is the branch of mathematics that addresses solving math-
ematical problems with computers in a search for numerical answers, as op-
posed to symbolic answers. These numerical solutions provide answers suitable
for practical and real-world applications. In contrast, symbolic solutions are
exact, but may be difficult or impossible to find and offer more detail than
can practically be applied.
R was developed to provide a free implementation of the S programming
environment for statistics. Like S, R can provide solutions to statistical anal-
ysis similar to stata and sas. R also provides a comprehensive programming
environment and a number of tools for processing functions and matrices.
With these tools, R provides an environment for calculation and can be used
to solve numerical problems. This text will provide a guide for doing numerical
analysis in R.

1.1.1 The Goals of Numerical Analysis


Numerical analysis is an applied branch of mathematics. It seeks out solutions
to practical problems that can be put into practice. The practical aspect of
it leads to a desire for solutions that are “good enough.” But good enough
is harder to define. The value and suitability of numerical solutions are con-
strained by three concepts. First, we are concerned with the efficiency, or how
much work is necessary to reach a solution. Second, we are concerned with
the accuracy of our solution, or how close we are to the true value. Finally,
we are concerned with precision, or the level of detail in our solution. We
will examine each of these concepts in turn and learn how to apply them to
numerical analysis. But good enough is entirely dependent on the application
space.
Numerical analysis underlies many fields which require numerical answers
to mathematical questions. From video games to climate science, and physics
to psychology, numerical analysis performs the calculations we use daily. En-
gineers need to know the tolerances for load bearing capacities for a building.
Financiers need to calculate the expected market return on an investment.

1
2 Computational Methods for Numerical Analysis with R

And medical professionals use numerical analysis to process advanced im-


agery. Numerical analysis supports almost any field when computers are used
to solve mathematical problems.
Numerical analysis is different from other branches of mathematics. In
calculus, we expend considerable effort to identify the exact value of equations,
even if they cannot be represented by a “number” such as 7, 21, or 98.6, because
the value is irrational or transcendental. Accordingly, numerical analysis is the
engine of applied mathematics.
For instance, we know a circle’s area is πr2 and the area of a circle that
is 20 meters across has a radius of 10 meters and is 100π square meters. But
for determining how much mulch is necessary for a 10-meter-across circular
garden, we really need an actual number of square meters. When it comes to
this sort of practical problem, knowing there are about 314 square meters is
probably good enough.
This distinction is what separates numerical analysis from symbolic com-
putation. Symbolic computation would result in the solution of 100π. There
are platforms for providing these symbolic computations. Both Mathemat-
ica by Wolfram Research and Maplesoft’s Maple packages provide symbolic
computation engines. Free alternatives in both Maxima and sage are also
available and all of these products are capable of providing numerical results,
as well.
But in a symbolic computation platform, expressions are first class objects,
like numbers are to R. Except for some minor cases around linear models, R
does not work well with symbolic computation on expressions. For instance,
adding x to x + y should yield 2x + y, a concept R cannot handle. However,
if x and y have values associated with them, R will dutifully find the sum of
2x and y. Despite this limitation, the D function family will symbolically find
derivatives of some mathematical expressions.
However, the constraints listed above affect the final results, especially
when the constraints work at cross purposes. Accordingly, numerical analysis
is not just the search for numerical solutions to mathematical problems. It is
also the search for usable estimates of those solutions. These usable estimates
might be bounded, so while we might know if they are correct, we might know
the error is no more than some limit. From there, we can evaluate how usable
our estimate is.
Applied mathematics is sometimes considered as distinct from pure math-
ematics. However, applications of mathematics are based on the underlying
pure mathematics. Often, numerical methods are straightforward implemen-
tations of the related pure mathematical solution for the problem. Because
of this relationship, some problems are better understood after applying pure
mathematics. Accordingly, when a function generates an error, it can some-
times be resolved through symbolic manipulation.
In addition to the three constraints, numerical analysis is subject to several
important limits. The most important is on size of the data. Modern computers
have vast amounts of memory. But for some problems, no amount of memory is
Introduction to Numerical Analysis 3

sufficient. And for others, no amount of computational time is sufficient. These


space and time limits are continually pushed back as computers grow faster
and larger. Today’s complex climate modelling was a dream ten years ago and
a fantasy ten years before that. But even straightforward problems, such as
the determinant of a matrix, using the traditional method of calculation, grow
unchecked, quickly.
Another limitation is the availability of good algorithms for solving nu-
merical problems. For instance, in Section 1.3.2, we will review three different
algorithms for evaluating polynomials. These have different qualities and dif-
ferent benefits. These limitations are baked into the process in a way the
constraints are not. We can relax a constraint. In fact, we can usually trade
one constraint for another. But the limitations are externally imposed. We
can build bigger and faster computers, but only so much and so quickly. Fur-
ther, we can evade some limitations through the use of parallel programming,
not addressed in this text. Parallel programming allows processes to be bro-
ken into multiple independent steps and executed, simultaneously, on different
computers with the final results aggregated at the end.

1.1.2 Numerical Analysis in R


R was developed based on the S programming language to provide a domain-
specific language for statistics. R, like S, grew out of the Unix environment
and provides a modular environment that is extensible and flexible. R has
developed a reputation for implementing new algorithms quickly, delivered
through a package management system that makes installation of new modules
easy.
R is also free software. Like many free software packages, R is developed
primarily by volunteers or those working for companies using the software.
Those volunteers are often the authors of new modules. This has led to a
strong support community through mailing lists and websites dedicated to R.
Even though R is geared toward and known primarily as a statistical anal-
ysis environment, the platform provides a complete programming language
with numerical primitives. Providing a complete programming environment,
along with attendant editors and other supporting applications, makes it pos-
sible to implement any algorithm in R. The language includes specific features
for using and managing datasets and numerical computation. Because of its
power and ready availability, R is a good environment for learning numerical
analysis.
R’s rise as a statistical analysis platform has introduced the language and
its fundamentals to a wide audience. If you are already familiar with R from a
statistical perspective, you are familiar enough with the language for numerical
analysis. Many software packages exist to provide numerical analysis. However,
the large complete packages, especially matlab® , are very expensive and may
cost more than many students and independent learners can afford. Finally,
4 Computational Methods for Numerical Analysis with R

fibonacci <- function ( n ) {


if ( n == 0)
return (0)
if ( n == 1)
return (1)
return ( fibonacci ( n - 1) + fibonacci ( n - 2) )
}

R Function 1.1
The Fibonacci sequence

because R provides a complete programming environment, any algorithm can


be implemented in it.
In this text, implementations of algorithms are presented in set off boxes
and numbered. For instance, Function 1.1 includes an implementation of the
Fibonacci number generator. Examples of R input and output are given set
off within the text, lending the example to the narrative, like this,
> fibonacci(10)
[1] 55
> 3 + 8
[1] 11
showing the tenth member of the Fibonacci sequence and the results of three
plus eight. Input and output are shown as fixed-width text and input lines
begin with a bracket (>). The examples are directly run in R and added to
the LATEX source for this text using Sweave. Accordingly, they show the actual
output from R without cutting and pasting or other potential corruptions. The
version used is
> print(version$version.string)
[1] "R version 3.3.2 (2016-10-31)"
In developing this text, a few rules were adopted. First, a function must
be well formatted. This means functions have whitespace, usually empty lines,
to break up internal components. Lines must be short enough not to wrap,
either. However, control structures, like if statements or for loops are set
off through indentation, a common approach in formal coding. If a line from
a function becomes too long, the line would be rewritten or shortened to fit,
horizontally, across the page. This could involve using other approaches such
as splitting a complicated operation into more than one step. A final strategy
is that internal variable names are not always fully descriptive. For instance,
instead of a variable called upperBoundaryLimit or some other lengthy noun
phrase, something shorter such as upper or even u may be used. Variables
should be unambigious and easy to remember in context, regardless.
In addition, R code examples must be small enough to fit on a single
printed page in this text. Most are under half a page. This encourages the
Introduction to Numerical Analysis 5

reader to open the text and read functions. The small size is designed to
help example implementations fit in the head of the reader. As a result, error
handling and potential evaluation options are not included, unless convenient
or necessary. In some cases, smaller independent components were moved into
new functions. This provides additional flexibility to the implementation and
improves the readability of the functions.
The functions included in this book, and some others, are bundled into a
package called cmna, standing for Computational Methods for Numerical Anal-
ysis. This package provides the algorithms, implementations, documentation,
and testing. The package is available through standard distribution channels.

> library(cmna)
The call to library makes the library available for use. Despite bundling
these functions into a single package, the functions provided do not provide
a unified whole. That is, the functions provide a baseline for understanding
the imeplementation and are designed to provide a comprehensive solution for
numerical applications. Where possible, functions with similar applications are
given similar interfaces. This is not to say the functions were not designed.
But they are not designed to work together in any meaningful way.
Because of these design choices, it is also important to remember the func-
tions implemented here are not robust. That is, they do not perform basic
error handling and they are unlikely to fail gracefully when presented with
a problem. This is the tradeoff from the simple implementations given. They
explain the fundamental method from a numerical standpoint. Handling un-
usual circumstances or errors, should be a routine part of any program, but
because they are not included here, some implementations may not fail well.
As such, error handling is addressed when necessary, such as when a function
could silently return an incorrect answer, rather than simply terminate.
The functions in cmna are not robust and should not be used for actual ap-
plied numerical analysis. Applied numerical analysis, such as an architectural
model, relies on well-tested and well-understood numerical models that handle
errors. R includes robust and tested functions for numerical analysis. Because
the functions we develop are not robust enough for everyday use, when appro-
priate, these functions are described and demonstrated to show how to solve
actual numerical analysis problems in R. This allows you to move along and
actually use the demonstrated solution rather than fixing the cmna version to
meet more demanding requirements.

1.1.3 Efficiency
The first constraint we will look at is efficiency. Programmers generally work
very hard to make sure their computers do not have to. Every gain in effi-
ciency enables more interesting problems to be solved. Because programs for
numerical analysis are run so many times, increased efficiency decreases the
6 Computational Methods for Numerical Analysis with R

overall runtime, as well. Efficiency comprises two areas. The first is time com-
plexity, focusing on how long it takes for a program to execute. Programs that
require more steps for larger inputs are said to have higher time complexity.
The second is space complexity, measuring how much storage, even intermedi-
ate, is necessary to execute the program. Programs that require more memory
for larger inputs are said to have higher space complexity.1 We are going to
use less formal methods focusing on the count of operations a function must
perform to complete and return a value. For instance, examine this loop:
> count <- 0
> m <- 10
> for(i in 1:m)
+ count <- count + 1
> count
[1] 10
This is a fancy way to perform a loop 10 times. The function loops from 1 to
m times. This loop’s internals execute 10 times. To verify this, we increment
the count variable and print the value, which is m. Of course, we can also nest
loops, and this increases the number of times the loop’s internals, the parts
within the innermost loop, run:
> count <- 0
> m <- 10
> n <- 7
> for(i in 1:m)
+ for(j in 1:n)
+ count <- count + 1
> count
[1] 70
In this case, we have two loops. The outer loop runs from 1 to m and the
inner loop executes from 1 to n. The inner loop executes n times for each time
through the outer loop. Therefore, the loop’s innermost internals execute mn
times. These are straightforward examples. Slightly less straightforward is an
example where the outer loop executes from 1 to m. The inner loop executes
from 1 to i where i represents the iteration of the outer loop:
> count <- 0
> m <- 10
> for(i in 1:m)
+ for(j in 1:i)
+ count <- count + 1
> count
[1] 55
1 For a textbook treatment, I recommend Introduction to Algorithms by Cormen et al.

(2009) or Algorithms by Sedgewick and Wayne (2011). For a less formal approach, an
Internet search for “time complexity,” “space complexity,” or “big-O notation” is sufficient.
Introduction to Numerical Analysis 7

isPrime <- function ( n ) {


if ( n == 2)
return ( TRUE )

for ( i in 2: sqrt ( n ) )
if ( n %% i == 0)
return ( FALSE )

return ( TRUE )
}

R Function 1.2
Test an integer for primality

The inner loop’s internals execute 1 time the first time through the outer loop,
2 times the second time, and so on up to m times the mth time Pmthrough the
loop. Accordingly, the inner loop executes k times where k = i=1 i.
Each of these grow at least as quickly as the input does. However, that
is not always the case for a function. Consider the function isPrime, listed
in Function 1.2. This function performs a basic primality test by testing the
input for division by a successive number of potential divisors.
When testing for primality, it is only necessary
√ to test the integers from
2 to the last integer less than or equal to n. This function still grows, but
at a much slower rate. Further, the relative
√ rate of increase decreases as n
increases. Also, in the case of isPrime, n is the maximum number of √ times
through the loop. If the number is not prime, an integer less than n will
successfully divide n and the loop will terminate early.
Of course, within a loop, it is possible for complex operations to be less
obvious. In this example,
> count <- 0
> m <- 10
> x <- 1:100
> y <- rep(1, 100)
> for(i in 1:m) {
+ y <- y * x
+ count <- count + 1
+ }
> count
[1] 10
the value of count is 10. However, many more multiplications happened within
the loop. The loop itself contains an element-wise multiplication. This is a
multiplication for each element of the vectors x and y. As each are 100 elements
long, this loop actually contains 1000 multiplications. Despite there being only
8 Computational Methods for Numerical Analysis with R

one for loop within the example as stated, it includes more operations than
the last example, with its explictly nested loops.
Understanding what is happening inside a loop is critical to estimating
how long it will take to execute. If the loop calls other external functions,
each of those will have their operations to perform. Likely, these functions are
opaque to us, and we will not necessarily know what they are doing and how
they do it.
Despite these speed analyses, R is not a fast programming language. Its
internal operations are fast enough for most purposes. If speed were the most
important consideration, we would use c or Fortan. As compiled languages,
they execute as machine code directly on the hardware. R programs, like
Python, matlab® , and other interpreted programming languages, do not run
directly on the hardware, but are instead translated and executed by the
language’s runtime engine.
But we use languages like R, matlab® , or Python for other reasons and
in the case of R, the reasons might be access to libraries created by other
programmers, the statistical facilities, or its accessibility. And understanding
how to estimate the number of operations necessary to complete a task is
language-neutral. So if one implemented
√ a c version of the prime tester in
Function 1.2, it would still require n tests.

1.2 Data Types in R


R provides a wide variety of data types both natively and through extensions.
These data types include atomic elements, which are elements that consist of
a single element of data. These are Boolean data types, those that are true
or false, and numbers. More complex datatypes exist that are treated as core
objects by R. This includes dates, strings, matrices, and arrays. Finally, R
supports a number of compound data types that include multiple elements
such as the results of a regression.
We will be focusing on a few data types that directly support numerical
analysis, either as the input or the output. These data types are the purely
numerical types, such as floating point numbers. These data types also include
aggregate types from linear algebra, vectors, and matrices. Finally, our discus-
sion will include data frames, a special type of matrix with named properties
that is optimized for use by many of the statistical functions in R. First, we
will begin with Boolean data types, which provide critical support to all of R.

1.2.1 Data Types


R presents a number of ways to store data. Many of these are variants on stor-
ing numbers. The fundamental data types are building blocks for compound
Another random document with
no related content on Scribd:
Natividad; Rafael (?): Retrato de un desconocido; Tiziano: Retrato
del Gran Duque de Alba Don Fernando III, y La Cena; Giorgione:
Psychis; Rubens: La Vuelta del mercado; Van Dick: Retrato del
Gran Condé; Rembrandt: Paisaje; Breugel de Velours: La
Vanidad mundana, y otros de maestros eminentes.
No está la Biblioteca en igual proporción y riqueza de libros, si
bien se cuentan entre ellos algunos códices, como el de una versión
castellana de la Biblia, único que se conoce. Todos han sido
ordenados y catalogados por la Duquesa, y de su puño y letra están,
una por una, las papeletas del Indice.
En cambio, los documentos históricos no tienen precio, así por su
calidad como por su número. Maravillan verdaderamente la variedad
y la abundancia de los que ha logrado reunir la Duquesa en sus
largas y penosas investigaciones, comparables únicamente con el
gusto y primor con que los más importantes se hallan hoy
colocados, por mano de la ilustre dama, en hermosas vitrinas, en
uno de los más espaciosos y elegantes salones de la Casa. Joyas
arqueológicas, entre ellas una cabeza de Minerva, única en su tipo
que se conoce: lanzas, armaduras, tapices y cuadros,
delicadamente repartidos y ordenados, embellecen y realzan aquel
salón de vitrinas, gabinete de estudio, al par, de una de las señoras
más cultas de nuestra época.
Del valor histórico de los documentos podrá juzgarse desde luego
con saber que algunos, como la Escritura de cambio de un prado en
San Julián, y el Fuero de Caldelas, se remontan, respectivamente, á
los años 1026 y 1172 de nuestra era; que otros datan,
sucesivamente, de los días de Don Pedro I, Don Juan II de Castilla,
Don Enrique IV y los Reyes Católicos; y, por último, que al lado de
autógrafos de personajes como Colón, Carlos V, Felipe II, el
Príncipe Don Carlos, Don Juan de Austria, el Marqués de Santa
Cruz, Zurita, Arias Montano y fray Luis de Granada, hay otros de
extranjeros tan ilustres como Pedro Paleólogo, Emperador de
Constantinopla, el Papa Pío IV, Enrique VII, Isabel de Inglaterra,
María Estuardo, el Rey Don Sebastián, Catalina de Médicis,
Guicciardini, Tiziano y J. J. Rousseau.
Solamente del Gran Duque de Alba pasan de 1.200 las cartas
suyas entre autógrafos y originales, con otros muchos papeles
anotados por su mano, y el testamento, á cuyo pie se lee su rúbrica.
Y por lo que toca á América, me bastará decir que sólo los
publicados en el volumen que conocemos ascienden á cincuenta y
seis, entre ellos «de mano de Colón, además de las firmas de los
libramientos, cuatro papeles que no pasan del año 1501. En las
espaldas de todos, y encerrándolos en un cuadro, puso números de
orden, que indican con cuánto método disponía sus documentos.»
Á pesar de los abultados volúmenes que la Duquesa ha publicado
en poco más de un año, sólo en las vitrinas aun quedan muchos
otros documentos autógrafos ó con firma autógrafa de históricos
personajes y de diferentes tiempos, alternando con objetos curiosos
de diversa clase y excelencia.
De estos últimos, bueno será mencionar aquí los siguientes:
«Sello en lacre con retrato de Felipe II, probablemente por Pompeo
Leoni; Hierro de Lanza de Carlos V; Bastón de mando de D.
Fernando de Castro, Conde de Lemos (1592), que tiene los
nombres de los regimientos con letras de oro; Plano iluminado, con
multitud de figuras, de la batalla de Montconcourt (1569); Sellos de
plomo, algunos á flor de cuño, de Alfonso X y demás Soberanos, y
otros sellos de placa y de cera; Privilegios rodados, con ruedas de
oro y colores, lujosísimas; Pergaminos con orlas de miniaturas
finísimas de códices de los siglos xv y xvi, y Esmaltes y Miniaturas,
en medallones, con retratos de inestimable valor.
En cuanto á los documentos no publicados hasta ahora, que
existen en las vitrinas, he aquí una lista completa para conocimiento
de los doctos: Nuño Freire de Andrade (1428); Condestable de
Castilla D. Pedro (1398); Infante de Aragón Don Enrique (1441);
Conde de Lemos y de Trastamara (1444); Fray Agustín Castro
(Conde de Lemos), 1632; D. García Alvarez de Toledo (el de los
Gelves), 1510; Alfonso Martínez, Arcipreste de Talavera (1448);
Doña Germana de Foix (1516); Fernando IV; Don Pedro el Cruel;
Enrique II, III y IV y la mujer de éste Doña Juana; Príncipe de Viana;
Don Juan II de Castilla; Don Juan II de Aragón; Reyes Católicos
(Cartas autógrafas); Felipe I y Doña Juana la Loca; Carlos V; Don
Sebastián de Portugal; Pío IV; Juan Federico, Duque de Sajonia
(1548); Príncipe de Orange, Guillermo de Nassau (1560); Filiberto
de Saboya (1565); Juan Andrea Doria (1558); Conde de Lerín,
Condestable de Navarra (1469); Suero de Quiñones; Marqués de
Santillana; Conde de Lemos, D. Fernando de Castro (La lealtad de
España), 1367; Cisneros; Cristóbal de Castillejo; Lupercio Leonardo
de Argensola; Infante Don Alfonso, hermano de Isabel la Católica;
Don Juan II y Doña Blanca de Navarra (1430); Don Fadrique,
segundo Duque de Alba; D. Pedro Alvarez Osorio, Conde de
Trastamara (1445); Carlos III el Noble, de Navarra (1412); Almirante
D. Fadrique Enríquez (1429); Sancho Dávila; Dux de Venecia
Nicolás de Ponte (1578); il Fratino, famoso ingeniero al servicio del
Gran Duque de Alba; Padre Nithard; Don Antonio de Oquendo
(1632); D. Rodrigo Calderón; Mazarino; Mariscal de Villars; Alfonso
VIII (1172); Alfonso IX de León (1210); Fueros del Concejo de San
Leonardo (1220); Bula de absolución al Duque de Alba D. Fadrique
(1480), y plano del Brasil, del siglo xvi.
Tales son, en suma, los tesoros descubiertos en las
investigaciones llevadas á cabo hasta ahora por la entendida
Duquesa. Réstale aún por explorar no escasa parte de los archivos
de la Casa. Es posible que en ésta se logren nuevos y no menos
felices hallazgos. Tal vez en los papeles de los Portocarreros,
Señores de Moguer, se encuentren datos preciosos para la historia
del descubrimiento de América. Por desgracia, entre tantos
documentos conservados no ha sido dable encontrar uno solo
referente á insignes protegidos de la Casa, tales como Juan de la
Encina, Lope, Calderón, Santa Teresa y el egregio autor de Don
Quijote.
No hay que decir que la iniciativa, la dirección y la obra capital en
la búsqueda, examen y clasificación de los documentas corresponde
á la Duquesa en absoluto. Si ha tenido auxiliares en lo tocante á
cuestiones lingüísticas y paleográficas, y consultores en lo que
respecta á la elección de papeles, es la misma Duquesa quien
ingenuamente lo declara á la cabeza de su primer libro para
conocimiento de todos. Sin tales confesiones, toda persona
conocedora de esta clase de trabajos lo inferiría claramente, sin
amenguar por ello lo más mínimo la magnitud de la empresa
acometida y ejecutada por su esclarecida autora.
Tarea tan vasta y tan compleja es de aquellas que no pueden ser
llevadas á feliz término por persona alguna, cualesquiera que sean
sus condiciones de actividad y competencia. No tema, pues, la
inteligente y laboriosa Duquesa que la crítica digna de este nombre
deje de reconocer y admirar nunca sus especiales aptitudes y
señalados merecimientos. Y si la ignorancia ó la envidia los
desconocen, descanse en la magnanimidad de sus pensamientos,
recordando, al par, que

De altos espíritus es
Aspirar á empresas altas,
Y ver con dolor las faltas
De los que muerden sus pies.

Para concluir: la Duquesa de Alba es la primera señora española


cultivadora de los estudios históricos en sus fuentes primarias, en
los documentos. Esta sola singularidad le daría, por propio derecho,
lugar aparte en la historia de nuestras letras. Hemos tenido y
tenemos pensadoras, poetisas, novelistas, escritoras de historia; lo
que no teníamos era investigadoras de primera mano en el campo
de las ciencias históricas. La Duquesa de Alba es la primera, y hasta
ahora la única. ¡Ojalá que su ejemplo encuentre imitadoras é
imitadores en la alta clase á que pertenece! Que al menos hagan
organizar sus archivos y los abran luego á los estudiosos, si carecen
de vocación para ordenarlos y examinarlos por sí mismos, y publicar
sus joyas como hace la Duquesa.
Fuera de España, en las naciones latinas sólo conozco un caso
parecido al que la dama española nos ofrece: la italiana Condesa
Lovatelli, hija del Duque de Sermoneta. Y digo parecido, en cuanto
que una y otra Condesas se dedican á los estudios históricos, si
bien en orden distinto de estos estudios: la Condesa de Siruela, al
de los documentos; la Condesa de Lovatelli, al de las inscripciones,
mosaicos antiguos y objetos arqueológicos. La distinguida autora de
Antichi monumenti illustrati es hoy la primera y única señora que ha
tenido el honor de ingresar, como Académica de número, en la
Accademia dei Lincei, Instituto de Italia, en la Sección
correspondiente á nuestra Real Academia de la Historia. ¿Ingresará
en ésta la Duquesa de Alba? Que lo tiene merecido, y en grado
eminente, nadie puede ponerlo en duda. Cuente desde ahora con mi
voto la señora Duquesa de Alba.
EL MAESTRO LEBRIJA Y EL
DESCUBRIMIENTO DE AMÉRICA
POCOS días después que salieron de Palos las naves
descubridoras, el 18 de Agosto de 1492, veía la luz pública, en
Salamanca, un libro que, á juzgar por su título, no parecía guardar
relación alguna con la empresa de Colón y los españoles: la
Gramática de la lengua castellana del maestro Antonio de Lebrija.
Al cabo de cuatro siglos, la obra del viejo humanista yace en tal
olvido, que ni siquiera ha logrado recuerdo alguno de los doctos en
el IV Centenario de su publicación, con saberse á ciencia cierta el
año, el mes, hasta el día en que fué terminada, viniendo como
vienen declarados al final del mismo libro en los términos siguientes:
«Acabóse este tratado de grammatica que nuevamente hizo el
maestro Antonio de lebrixa sobre la lengua castellana. En el año del
salvador de mil e CCCCXCII á xviii de Agosto. Empresso en la mui
noble ciudad de Salamanca.»
Mucho ha contribuído, sin duda, á semejante olvido la extremada
rareza de los ejemplares que quedan, así de esta edición como de
la contrahecha que se publicó más tarde, á mediados del siglo xviii,
en sentir del autor de la Tipografía Española. Á excepción de
nuestra Biblioteca Nacional, que ha llegado á reunir tres, rarísima es
la Biblioteca española que posee algún ejemplar, bien de la primera,
bien de la segunda de dichas ediciones. No existe ninguno en
Salamanca, donde salió á luz y en cuya Universidad fué catedrático
el sapientísimo filólogo.
En cuanto al extranjero, sube de punto la rareza de los
ejemplares. En Alemania, el fundador de la novísima filología
neolatina, el gran Federico Diez, no pudo proporcionarse ninguno.
Puedo decir que, en mi visita á la Biblioteca de la Universidad de
Bonn, no encontré ejemplar alguno, ni entre los libros de la
Biblioteca particular de Diez, adquirida por aquel centro, ni entre los
fondos especiales de la Biblioteca universitaria. Vióse obligado Diez
á hablar siempre de referencia de nuestro libro, cuyo conocimiento
directo hubiérale sido utilísimo.
Tocante á Italia, me bastará decir que he visto un solo ejemplar,
por cierto de la primera edición y en excelente estado, en la
Biblioteca Ambrosiana, de Milán. Y por lo que á Francia respecta,
debo asegurar que no logré ver ninguno, no ya en las diferentes
Bibliotecas provinciales que visité, sino en todas las de París, que
recorrí detenidamente, una por una, en compañía del ilustre profesor
del Colegio de Francia Mr. d’Arbois de Jubainville, precisamente con
objeto de consultar nuestro libro para el trabajo de que hablaré más
adelante.
Muy diversa suerte ha tenido la Gramática latina del gran
humanista, que aun hoy mismo sirve de texto en algunos centros de
enseñanza en España y América. Es cierto que otras obras de
nuestro autor figuran ya únicamente en las Bibliotecas, consultadas
de vez en cuando por algún que otro erudito; pero no es menos
cierto que se tiene mayor noticia de ellas que de la Gramática
castellana, la cual ni ha vuelto á ser impresa, ni ha sido objeto nunca
de estudios especiales, y, lo que es más, ni siquiera ha sido
examinada, tanto en las bibliografías generales como en los
estudios biográficos referentes al insigne polígrafo. Nicolás Antonio,
y Salvá, por toda noticia, registran su título solamente; Gallardo no
la cita; Méndez y Clemencín incurren en errores al mencionarla, y
Muñoz, en su Elogio del sabio maestro, encaminado, como nos dice,
«á dar á conocer el mérito de Antonio de Lebrija, rectificar el
concepto que de él se ha tenido comunmente, y en sus estudios,
escritos y enseñanza proponer la norma que deberán seguir los
literatos, si quieren serlo de verdadero nombre, para bien suyo y de
sus semejantes», olvida sus merecimientos como padre y fundador
del estudio de la lengua castellana, y con él de la moderna
Gramática neolatina, dentro y fuera de España.
Fué Lebrija, en efecto, el padre y fundador del estudio de la
lengua española. «Esta, hasta nuestra edad, escribía, anduvo suelta
é fuera de regla; é á esta causa a recebido en pocos siglos muchas
mudanças.» Al acometer tal empresa no obró Lebrija, como
suponen algunos, por encargo de la Reina Católica, ni tampoco,
como otros han dicho, á petición de las damas de la gran Reina,
«que quisieron también cultivar sus entendimientos.» Los autores de
tales especies han probado cumplidamente que no habían leído
siquiera el Prólogo de nuestro libro, pues en él nos declara su autor
una por una las causas que le movieron á escribirlo, y la primera de
todas (habla Lebrija) «porque mi pensamiento é gana siempre fué
engrandecer las cosas de nuestra nación.» Sólo el más puro y
generoso patriotismo podía inspirar, en efecto, empresa de esta
índole. Por eso son aún más sensibles la ingratitud y el olvido que
ha tenido en recompensa.
Dedicó nuestro autor su libro á la Reina Católica, su constante
favorecedora. Por su mandado había compuesto antes unas
Introducciones latinas, «contraponiendo línea por línea el romance
al latín.» Buscaba ahora el patrocinio de su augusto nombre contra
las envidias, injusticias y malquerencias de sus émulos; que hartos
tuvo, como no podía menos de tener maestro de tan extraordinarias
cualidades y merecimientos.
Doloroso es decirlo: la gran Reina no dió pruebas, en este caso,
de su penetración acostumbrada. Cuando Lebrija le presentó en
Salamanca su libro, Doña Isabel, lejos de comprender desde luego
su necesidad y alcance, me preguntó (cuenta Lebrija) que para qué
podía aprovechar.» Entonces (prosigue el maestro) «el mui
reverendo padre Obispo de Ávila me arrebató la respuesta, é
respondiendo por mí, dixo: Que despues que vuestra alteza
metiesse debaxo de su iugo muchos pueblos bárbaros e naciones
de peregrinas lenguas, é, con el vencimiento, aquellos ternían
(tendrían) necessidad de recebir las leies que el vencedor pone al
vencido é con ellas nuestra lengua, entonces, por esta mi Arte,
podrían venir en el conocimiento della, como agora nosotros
deprendemos (aprendemos) el arte de la gramática latina para
deprender el latin.» ¿Cabe imaginar respuesta más elocuente y
decisiva?
Ó mucho me engaño, ó en esa misma respuesta hay algo, tal vez,
que toca al descubrimiento del Nuevo Mundo, que importa precisar
en lo posible. Desde luego las palabras pueblos bárbaros e
naciones de peregrinas lenguas no parecen muy adecuadas
tratándose de pueblos europeos, á los que en modo alguno
convenía el dictado de bárbaros, ni tampoco enteramente el de
peregrinas á sus lenguas: diríase que se referían á otros pueblos y
naciones. ¿Las del Nuevo Mundo? Pero éste estaba aún por
descubrir cuando ocurrió la escena que acabamos de contar. Pasó
ésta en Salamanca, como nuestro gramático nos dice, aunque sin
mencionar la fecha. Las estadas de la Reina Católica en la ciudad
salmantina anteriores á la publicación de nuestro libro, que hasta
hoy se conocen, corresponden á los años 1486 y 1487, en los
cuales parecía generalmente incierto el pensamiento del futuro
descubridor.
Por otra parte, Lebrija no parece referirse á esos años, sino á
fecha reciente, á 1492, cuando, terminado su libro, trataba de su
publicación. Ahora bien: en 1492 la Reina Isabel permaneció en
Granada hasta fines de Mayo. Desde entonces hasta el 10 de
Agosto, en que se sabe que estaba en Barcelona, nada nos dice de
su residencia en otras partes el curioso Memorial ó registro breve,
de Galíndez de Carvajal, de los lugares donde el Rey y Reina
Católicos estuvieron de 1468 en adelante. ¿Estuvo la Reina alguna
vez en Salamanca en ese tiempo, esto es, por los meses de Junio y
Julio? Es de advertir que, aunque Galíndez de Carvajal no lo
consigna en su Registro, es indudable que en Junio estuvieron los
Reyes en Guadalupe. ¿Estarían de igual modo en Salamanca?
Aclarada esta cuestión, quedarían resueltas las demás.
En caso afirmativo, bien pueden ser interpretadas como alusivas á
los futuros descubrimientos y conquistas de nuevas tierras y pueblos
y naciones bárbaras las frases que examinamos, como cosa posible
y esperada en días en que la Corona de Castilla había ya aceptado
la empresa del gran navegante. De otro modo, no cabe ver en ellas
sino referencias generales á la dilatación del imperio de España en
otros pueblos y naciones, calificadas de bárbaras en el sentido de
extrañas ó extranjeras.
Es de tener también en cuenta, si no como hecho probado, como
verosímil al menos, que el maestro Lebrija, por sus conocimientos,
no sólo en las letras clásicas, sino en otras muchas y distintas
ramas del saber, así como por el alto aprecio en que era tenido,
justamente, por los Reyes, el Cardenal Mendoza y otros personajes
de la corte, parecía naturalmente llamado, como pocos, á ser oído y
consultado en lo tocante á los fundamentos científicos de los
proyectos de Colón, bien particularmente, bien en el seno de la
Junta encargada de examinarlos. Y en este caso, ¿cabría contar al
sabio maestro, al innovador por excelencia de aquellos tiempos en
los estudios y en las ciencias, entre los que en nombre de la
tradición y la rutina fueron adversarios decididos de las novedades
colombinas? En manera alguna.
De todos modos, con ó sin referencias ni relaciones inmediatas
con el descubrimiento del Nuevo Mundo, el libro de Lebrija venía á
satisfacer una necesidad de primer orden y en los instantes más
oportunos y adecuados. El imperio español tocaba ya entonces al
período de su mayor grandeza, y con él la lengua española: era
llegado el momento de fundar el estudio de esta lengua.
Después de cuatrocientos años, mucho de lo que dejó escrito el
viejo filólogo, ó está en pie todavía, ó es de útil recuerdo y consulta.
Si su tecnicismo gramatical, sus teorías en algunas cuestiones, las
ortográficas especialmente, ó sus doctrinas sobre puntos históricos,
bien del lenguaje en general, bien del idioma castellano, han
envejecido, en cambio en materias fonéticas y sintáxicas hay no
poco aprovechable, cuando no vigente, en nuestros propios días. Ya
el mismo Lebrija estaba seguro de que podrían superarle los
gramáticos posteriores, como superados fueron los padres de la
gramática griega y latina; pero, como fundadamente escribía, «á lo
menos fué aquella su gloria é será nuestra: que fuemos (fuimos) los
primeros inventores de obra tan necesaria.»
Al emprender la suya, Lebrija, no sólo echó los cimientos de la
Gramática española, sino también los de la Gramática moderna,
introduciendo en el estudio de las lenguas romances el método
gramatical que ha dominado más de tres siglos hasta el nacimiento
de la Gramática histórica y comparativa. Ó en otros términos: la
Gramática más antigua que se conoce de una lengua romance ó
neolatina, con arreglo á las doctrinas del Renacimiento, es la
Gramática de la lengua castellana, del maestro Lebrija. Los estudios
gramaticales de esta clase más antiguos en Italia y Francia, todos
son posteriores: en Italia Fortunio (1516) y Bembo (1525), y en
Francia Palsgrave(l530), Robert Estienne (1569) y Canchie (1570).
Demostré esta verdad doce años hace en mi trabajo España y la
Filología principalmente neolatina, publicado en la Revista
Contemporánea correspondiente á Enero de 1880, y más tarde en
mi Memoria, leída primero en la Sociedad lingüística de París, que
acababa de dispensarme el honor de elegirme socio de número el
19 de Febrero de 1887, y después en la Academia de Inscripciones
y Bellas Letras en 4 de Marzo del mismo año, por M. d’Arbois de
Jubainville. Puede leerse integra en las Mémoires de la Société de
Linguistique de Paris (t. vi, págs. 176-179).
En esta última Memoria, no sólo traté de evidenciar la prioridad de
Lebrija sobre los gramáticos italianos y franceses, sino de probar al
propio tiempo que le pertenecía de derecho y en exclusivo la
paternidad de algunas doctrinas gramaticales que corren en Francia
atribuídas á escritores de este país. Y así fué reconocido por los
filólogos de la nación vecina en términos honrosos para nuestra
patria[3].
[3] Al dar cuenta de mi Memoria, leída en la Academia de
Inscripciones y Bellas Letras por M. d’Arbois de Jubainville,
escribía lo siguiente la Révue critique d’Histoire et de Littérature
(14 de Mars, 1887, page 220): «M. d’Arbois de Jubainville
communique une remarque due à un philologue espagnol, M.
Sánchez Moguel, professeur à l’Université de Madrid. La plus
ancienne grammaire qui ait eu pour objet une langue néolatine,
depuis la grande rénovation des études provoqués par l’invention
de l’imprimerie, est la grammaire espagnole du célèbre humaniste
Lebrija. M. Sánchez Moguel a reconnu que le grammairien
espagnol du xvᵉ siècle a le premier découvert, et explique le
mode de formation du futur et du conditionel des langues néo-
latines, composées comm’on sait, à l’aide de l’infinitif et d’un
temps du verbe avoir, le présent de l’indicatif pour le futur,
l’imparfait pour le conditionel.» Véase también, sobre este punto,
entre otras, la Révue Archéologique de París (troisième serie.—
Tome ix, p. 354).
Hoy que los españoles de ambos mundos conmemoramos unidos
comunes glorias, nada más justo que consagrar un recuerdo á la
memoria del viejo humanista de los tiempos de Colón y los Reyes
Católicos, que, aparte de la relación que pueda tener su nombre con
la empresa descubridora, en los días mismos en que el genio de
Colón y el arrojo de los españoles buscaban nuevas tierras para
Castilla, fundaba el estudio científico del patrio idioma, que había de
ser en lo futuro el vínculo más estrecho y más firme de la
indestructible fraternidad de americanos y españoles.
LA AURORA EN COPACAVANA
COMEDIA DE DON PEDRO
CALDERÓN
DERROCADO el secular Imperio de los Incas, ondeando triunfante
el estandarte de Castilla desde Túmbez hasta el Cuzco, creían los
vencedores asegurada su dominación en las auríferas tierras
peruanas, cuando un acontecimiento inesperado vino á poner en
grave aprieto el naciente poderío español: el alzamiento, en 1536,
de los indios, los cuales, en formidable número, sitiaron el Cuzco,
guarnecido solamente por 180 españoles de á pie y de á caballo.
Tres veces incendiaron la ciudad los sitiadores, arrojando piedras
hechas ascuas y flechas encendidas sobre los techos de paja de los
edificios, y otras tantas veces, sin ningún esfuerzo por parte de los
sitiados, se apagó el fuego. Refiérenlo así los antiguos cronistas
como los modernos historiadores, desde Cieza de León hasta W.
Prescott.
Atribuyóse por todos á favor divino, con especialidad á la
protección de la Virgen María, á quien, no sólo nuestra gente, sino
los indios, declaraban haber visto con sus propios ojos, ornada de
celestiales resplandores, sobre el paraje mismo en que había de
alzarse después el templo consagrado á su culto.
Este poético episodio es el alma de la comedia de Calderón La
Aurora en Copacavana. Y no digo el argumento, porque éste, como
vamos á ver, es más amplio y complicado, si bien dicho episodio
constituye en realidad el núcleo de la acción, en tales términos, que
ha podido dar nombre á toda la comedia.
Subdivídese ésta en tantas otras piezas como actos, con asunto
especial y propio: el primer acto se refiere en exclusivo á la primera
llegada de Pizarro y los suyos á Túmbez; el segundo, al sitio del
Cuzco y aparición de la Virgen; y el tercero, á la milagrosa imagen
de Nuestra Señora de Copacavana. Los dos últimos actos tienen
alguna relación y enlace; no así el primero con los demás, puesto
que la Virgen no tiene en él arte ni parte, como en los otros.
Lígalos todos el poeta en una fábula interesante, invención de su
ingenio: la historia de dos amantes, el indio Jupangui y la india
Guacolda, que sirve de argumento secundario, pero general, á toda
la comedia, desde el principio hasta el fin.
Guacolda, virgen consagrada al culto del Sol, ama á Jupangui,
personaje principal de la corte del Inca Guaxcar, y es correspondida
de Jupangui. Ámala también el poderoso Monarca, pero en secreto,
hasta el día en que tocó en suerte á Guacolda ser sacrificada al Sol.
Entonces el Inca no puede ocultar por más tiempo su ardoroso
cariño, y lo confía, para que la salve, á Jupangui, bien ajeno de
sospechar en él un rival

Combatido tan á un tiempo


De celos, lealtad y amor.

Guacolda, fugándose, resuelve el conflicto por el pronto. Búscala


y hállala Jupangui, resuelto á morir con ella, cuando los sorprende el
irritado Inca.
Son delicadas y poéticas las escenas en que Calderón nos
presenta á los amantes pugnando á porfía cada uno por salvar al
otro, atribuyéndose por entero toda la culpa. Mándalos Guaxcar
matar; pero es impotente para conseguirlo, porque Guacolda se
abraza á una cruz y Jupangui á un plátano, atributo de María, y no
pueden arrancarlos de ellos los verdugos. Después de este prodigio,
Guacolda y Jupangui se convierten, y son luego los mayores
devotos de la Virgen, á cuyo culto se dedican toda la vida. Es
Jupangui quien por sus toscas manos comienza á labrar la imagen
de la Virgen de Copacavana, concluída después por ministerio de
los ángeles.
El santuario de Copacavana es desde entonces en el Alto Perú,
hoy Bolivia, lo que el de la Virgen de Guadalupe en Méjico. Hasta en
sus orígenes guardan señalada relación las tradiciones de ambas
Vírgenes. Ya el doctísimo Muñoz, en su Memoria sobre las
apariciones y el culto de Nuestra Señora de Guadalupe de México,
puso de manifiesto que la primera de estas apariciones se refiere á
un indio; á un indio también, en la tradición peruana, se aparece la
Virgen, sirviéndole de modelo para su imagen de Copacavana.
Desamparadas por sus antiguos dioses en los días de la derrota,
las razas vencidas buscaban y encontraban igualmente en la Virgen
María el puerto de su refugio y amparo, y en el culto de sus
imágenes la satisfacción religiosa de sus corazones. Acaso, y sin
acaso, nada haya influído tanto en la civilización de los indios, en su
barbarie avezados á los sacrificios humanos, como el tierno y
delicado culto de la Virgen María.
El de Nuestra Señora de Copacavana no sólo se difundió en el
Perú, sino también por España. Sólo en Madrid recuerdo dos
iglesias donde le erigió altares la piedad de nuestros mayores: la
Parroquia de San Ginés y el derruído templo de San Antonio del
Prado. En Madrid también salió á luz su historia, obra de Andrés de
San Nicolás, en 1665, quince años antes de la muerte del madrileño
cantor de la peruana imagen. Ya antes, en Lima, había sido escrita y
publicada en prosa (1621) por Alfonso Ramos Gavilán, y en verso
(1641) por Fray Fernando de Valverde. Diríase que su devoción y
culto se propagaron tan rápidamente como en nuestros días los de
Nuestra Señora de Lourdes. De todos modos, la comedia de
Calderón será siempre fraternal vínculo y monumento de la fe
americana y española.
Con relación á la conquista del Perú, y desde el punto de vista
histórico, Calderon se ajusta unas veces á las tradiciones y crónicas,
y en otras se aparta de ellas, rindiéndose en absoluto á la fuerza
creadora de su ingenio. La llegada de los españoles á Túmbez,
asunto del acto primero; el desembarco de Pedro de Candía; la cruz
que deja plantada por señales,

Pues nadie habrá que la vea


Que no diga: «Aquí llegaron
Españoles; que esta es muestra
Del celo que los anima
Y la fe que los alienta»,

se encuentra en el primer caso, y en el segundo las fieras, que se


postran ante ella sumisas, y las flechas disparadas por los indios,
que caen, sin tocarla, á su pie.
El sitio del Cuzco y aparición de la Virgen, del segundo acto, es el
que contiene errores de mayor bulto, tales como los de atribuir dicho
sitio á la segunda llegada de los españoles, el de poner al frente de
los sitiados á Francisco Pizarro, y el de presentarnos al famoso
conquistador escribiendo de su puño y letra á Carlos V y Felipe II la
relación de sus victorias anteriores. Añádanse á éstos los de
suponer reinando entonces á Guaxcar ó Huascar, tiempo antes
muerto de orden de su hermano Atabaliba ó Atahualpa, y otros
errores por el estilo. Y por lo que respecta al acto tercero, con decir
que sigue generalmente á los historiadores de la imagen peruana,
dicho está todo.
Ni la naturaleza, ni los indios, tales y como eran en los días de la
conquista, ni las grandiosas escenas de audacia, valor, heroísmo y
aun ferocidad verdadera de que dieron entonces señaladas pruebas
los conquistadores, tienen en nuestra comedia el puesto natural y
propio. Tejido de milagros, de alegorías convencionales y de
escenas de amor, inverosímiles en los indios, trabajo costaría creer,
si algunos rasgos felices no lo revelaran, que el autor de esta
comedia es el mismo de La Devoción de la Cruz, y menos todavía
del Alcalde de Zalamea.
Lo más extraño de todo es que poeta del vigor de Calderón no
haya visto ni sentido la vigorosa figura de Francisco Pizarro,
ejemplar y dechado como pocos de las excelencias y defectos del
pueblo español en aquellos tiempos. Bien es verdad que ningún otro
de los grandes conquistadores ha tenido tampoco la fortuna de
inspirar con sus hazañas escenas de primer orden á nuestros
autores dramáticos. Ténganlo en cuenta los que, sin pararse á
comprobarlo, repiten uno y otro día que la historia de España en
ambos mundos ha tenido su mejor órgano de expresión poética en
nuestro viejo teatro.
DESCRIPCIÓN DE COPACAVANA

Es Copacavana un pueblo
Que casi igualmente dista,
En la provincia que llaman
Chucuitos, las propias millas
De la ciudad de la Paz
Y Potosí. Sus campiñas
Son fértiles, sus ganados
Muchos, y sus alquerías
De frutas, pescas y cazas
Abundantes siempre y ricas:
Cuya opulencia, en su lengua,
Á la nuestra traducida,
Copacavana lo mismo
Que piedra preciosa explica.
Pero aunque pudiera ser
Por esto grande su estima,
Lo hizo mayor que en sus montes
Yace aquella peña altiva
Que adoratorio del Sol
Fué un tiempo, por ser su cima
Donde diabólico impulso
Hizo creer que el Sol podía
Dar á su hijo para que
Los mande, gobierne y rija.
Á esta causa, entre la peña
Y la procelosa orilla
De gran laguna, que hace
El medio contorno isla,
Se construyó templo al sol,
En cuyas aras impías
Faubro al ídolo llamaron
Superior, que significa
Mes Santo, y mientras el cielo
No nos revele el enigma,
Ocioso es que discurramos
Ahora en su etimología.
En él, por los reservados
Juicios de Dios, las insidias
Del antiguo áspid, y en otros
Oráculos, respondían
Inspirando abominables
Ritos, cuya hidropesía
De sangre, mal apagada
Con la de las brutas vidas,
Pasó á beber la de humanas
Virgenes sacerdotisas.
En fin, siendo como era
Copacavana la hidra
De tantas cabezas cuantas
El padre de la mentira
En cada garganta mueve,
En cada anhélito inspira,
Fué la primera en quien Dios
Logró la feliz semilla
De su fe, siendo primeros
Obreros de su doctrina
De Domingo y de Agustino
Las dos sagradas familias.
Roma de América hay
Quien piadoso la publica;
Pues bien, como Roma, siendo
Donde más vana tenía
La gentilidad su trono,
Fué donde puso su silla
Triunfante la Iglesia; así
Donde más la idolatría
Reinaba, puso la fe
Su española monarquía.
Mostrando cuán docta siempre
La eterna sabiduría,
Donde ocurre el mayor daño,
El mayor remedio aplica.

(La Aurora en Copacavana, acto iii.)


PEDRO DE VALDIVIA
FUÉ Diego de Almagro, al decir de Fernández de Oviedo, «uno de
los escogidos é más acabados Capitanes que á Indias han passado,
y aun que han militado fuera della.» La posteridad ha confirmado
plenamente el juicio del viejo cronista de las Indias; pero para la
generalidad de las gentes, el esforzado compañero y rival de Pizarro
no es todavía lo conocido que merece. Basta decir que en ninguna
de las publicaciones promovidas por la celebración del Centenario,
el Adelantado del Cuzco ha sido recordado en el modo y forma que
en justicia reclaman sus insignes merecimientos.
Solamente el descubrimiento de Chile coloca su nombre entre los
más atrevidos y heroicos descubridores de los tiempos antiguos y
modernos. El paso de los Andes, si indiscutibles testimonios
históricos no lo probaran como lo prueban cumplidamente, parecería
increíble. La travesía por el corazón de las nevadas sierras, que no
han podido cruzar aún las vias férreas, para mayor grandeza,
verificada en invierno, publica la fortaleza invencible de aquel
capitán ilustre, á quien ni la magnitud de la empresa, ni el peso de la
ancianidad, ni los sufrimientos pasados en la conquista del Perú, ni
las riquezas y honores ya adquiridos, pudieron detener un solo
instante en la ejecución de su colosal empeño.
¿Cómo, una vez coronado á tanta costa por el triunfo, después de
arribar á Chile y de llegar hasta el Maule, dio la vuelta al Perú, sin
dejar siquiera fundación alguna que asegurase y conservase lo
descubierto y conquistado? Pregunta es esta, á la que no ha logrado
aún responder satisfactoriamente la historia.

You might also like