100% found this document useful (5 votes)
14 views

Complete Download (Ebook) Time Series Algorithms Recipes: Implement Machine Learning and Deep Learning Techniques with Python by Akshay Kulkarni, Adarsha Shivananda, Anoosh Kulkarni, V Adithya Krishnan ISBN 9781484289785, 9781484289778, 1484289781, 1484289773 PDF All Chapters

The document provides information about various eBooks available for download on ebooknice.com, including titles related to time series algorithms, natural language processing, and cooking. It lists multiple authors and ISBNs for each eBook, along with links for instant download in different formats. Additionally, it includes details about the authors of the 'Time Series Algorithms Recipes' eBook, which focuses on implementing machine learning and deep learning techniques using Python.

Uploaded by

kullysionay2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (5 votes)
14 views

Complete Download (Ebook) Time Series Algorithms Recipes: Implement Machine Learning and Deep Learning Techniques with Python by Akshay Kulkarni, Adarsha Shivananda, Anoosh Kulkarni, V Adithya Krishnan ISBN 9781484289785, 9781484289778, 1484289781, 1484289773 PDF All Chapters

The document provides information about various eBooks available for download on ebooknice.com, including titles related to time series algorithms, natural language processing, and cooking. It lists multiple authors and ISBNs for each eBook, along with links for instant download in different formats. Additionally, it includes details about the authors of the 'Time Series Algorithms Recipes' eBook, which focuses on implementing machine learning and deep learning techniques using Python.

Uploaded by

kullysionay2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

Download the Full Ebook and Access More Features - ebooknice.

com

(Ebook) Time Series Algorithms Recipes: Implement


Machine Learning and Deep Learning Techniques with
Python by Akshay Kulkarni, Adarsha Shivananda,
Anoosh Kulkarni, V Adithya Krishnan ISBN
9781484289785, 9781484289778, 1484289781,
https://ebooknice.com/product/time-series-algorithms-
1484289773
recipes-implement-machine-learning-and-deep-learning-
techniques-with-python-47430754

OR CLICK HERE

DOWLOAD EBOOK

Download more ebook instantly today at https://ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason;


Viles, James ISBN 9781459699816, 9781743365571,
9781925268492, 1459699815, 1743365578, 1925268497
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

ebooknice.com

(Ebook) Natural Language Processing Recipes: Unlocking


Text Data with Machine Learning and Deep Learning Using
Python by Akshay Kulkarni, Adarsha Shivananda ISBN
9781484273500, 1484273508
https://ebooknice.com/product/natural-language-processing-recipes-
unlocking-text-data-with-machine-learning-and-deep-learning-using-
python-34204404
ebooknice.com

(Ebook) Natural Language Processing Recipes: Unlocking


Text Data with Machine Learning and Deep Learning Using
Python by Akshay Kulkarni, Adarsha Shivananda ISBN
9781484273517, 9781484273500, 1484273508, 1484273516
https://ebooknice.com/product/natural-language-processing-recipes-
unlocking-text-data-with-machine-learning-and-deep-learning-using-
python-34204734
ebooknice.com

(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena


Alfredsson, Hans Heikne, Sanna Bodemyr ISBN 9789127456600,
9127456609
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312

ebooknice.com
(Ebook) SAT II Success MATH 1C and 2C 2002 (Peterson's SAT
II Success) by Peterson's ISBN 9780768906677, 0768906679

https://ebooknice.com/product/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-1722018

ebooknice.com

(Ebook) Natural Language Processing Projects: Build Next-


Generation NLP Applications Using AI Techniques by Akshay
Kulkarni, Adarsha Shivananda, Anoosh Kulkarni ISBN
9781484273852, 1484273850
https://ebooknice.com/product/natural-language-processing-projects-
build-next-generation-nlp-applications-using-ai-techniques-36506460

ebooknice.com

(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master


the SAT Subject Test: Math Levels 1 & 2) by Arco ISBN
9780768923049, 0768923042
https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-
arco-master-the-sat-subject-test-math-levels-1-2-2326094

ebooknice.com

(Ebook) Cambridge IGCSE and O Level History Workbook 2C -


Depth Study: the United States, 1919-41 2nd Edition by
Benjamin Harrison ISBN 9781398375147, 9781398375048,
1398375144, 1398375047
https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044

ebooknice.com

(Ebook) Applied Generative AI for Beginners: Practical


Knowledge on Diffusion Models, ChatGPT, and Other LLMs by
Akshay Kulkarni, Adarsha Shivananda, Anoosh Kulkarni,
Dilip Gudivada ISBN 9781484299937, 1484299930
https://ebooknice.com/product/applied-generative-ai-for-beginners-
practical-knowledge-on-diffusion-models-chatgpt-and-other-
llms-53764360
ebooknice.com
Time Series
Algorithms Recipes
Implement Machine Learning
and Deep Learning Techniques
with Python

Akshay R Kulkarni
Adarsha Shivananda
Anoosh Kulkarni
V Adithya Krishnan
Time Series
Algorithms Recipes
Implement Machine Learning
and Deep Learning Techniques
with Python

Akshay R Kulkarni
Adarsha Shivananda
Anoosh Kulkarni
V Adithya Krishnan
Time Series Algorithms Recipes: Implement Machine Learning and Deep
Learning Techniques with Python
Akshay R Kulkarni Adarsha Shivananda
Bangalore, Karnataka, India Hosanagara, Karnataka, India

Anoosh Kulkarni V Adithya Krishnan


Bangalore, India Navi Mumbai, India

ISBN-13 (pbk): 978-1-4842-8977-8 ISBN-13 (electronic): 978-1-4842-8978-5


https://doi.org/10.1007/978-1-4842-8978-5
Copyright © 2023 by Akshay R Kulkarni, Adarsha Shivananda,
Anoosh Kulkarni, V Adithya Krishnan
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or
part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way,
and transmission or information storage and retrieval, electronic adaptation, computer software,
or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark
symbol with every occurrence of a trademarked name, logo, or image we use the names, logos,
and images only in an editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of opinion as to whether or not
they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of
publication, neither the authors nor the editors nor the publisher can accept any legal
responsibility for any errors or omissions that may be made. The publisher makes no warranty,
express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Celestin Suresh John
Development Editor: Laura Berendson
Coordinating Editor: Mark Powers
Cover designed by eStudioCalamar
Cover image by Aron Visuals on Unsplash (www.unsplash.com)
Distributed to the book trade worldwide by Apress Media, LLC, 1 New York Plaza, New York, NY
10004, U.S.A. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com,
or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member
(owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance
Inc is a Delaware corporation.
For information on translations, please e-mail booktranslations@springernature.com; for
reprint, paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our Print
and eBook Bulk Sales web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is
available to readers on GitHub (https://github.com/Apress). For more detailed information,
please visit http://www.apress.com/source-code.
Printed on acid-free paper
To our families
Table of Contents
About the Authors��������������������������������������������������������������������������������xi

About the Technical Reviewer�����������������������������������������������������������xiii

Preface�����������������������������������������������������������������������������������������������xv

Chapter 1: Getting Started with Time Series����������������������������������������1


Recipe 1-1A. Reading Time Series Objects (Air Passengers)��������������������������������2
Problem�����������������������������������������������������������������������������������������������������������2
Solution�����������������������������������������������������������������������������������������������������������2
How It Works���������������������������������������������������������������������������������������������������2
Recipe 1-1B. Reading Time Series Objects (India GDP Data)��������������������������������4
Problem�����������������������������������������������������������������������������������������������������������4
Solution�����������������������������������������������������������������������������������������������������������4
How It Works���������������������������������������������������������������������������������������������������4
Recipe 1-2. Saving Time Series Objects���������������������������������������������������������������6
Problem�����������������������������������������������������������������������������������������������������������6
Solution�����������������������������������������������������������������������������������������������������������6
How It Works���������������������������������������������������������������������������������������������������6
Recipe 1-3A. Exploring Types of Time Series Data: Univariate������������������������������7
Problem�����������������������������������������������������������������������������������������������������������7
Solution�����������������������������������������������������������������������������������������������������������7
How It Works���������������������������������������������������������������������������������������������������7

v
Table of Contents

Recipe 1-3B. Exploring Types of Time Series Data: Multivariate���������������������������9


Problem�����������������������������������������������������������������������������������������������������������9
Solution�����������������������������������������������������������������������������������������������������������9
How It Works�������������������������������������������������������������������������������������������������10
Recipe 1-4A. Time Series Components: Trends��������������������������������������������������13
Problem���������������������������������������������������������������������������������������������������������13
Solution���������������������������������������������������������������������������������������������������������13
How It Works�������������������������������������������������������������������������������������������������13
Recipe 1-4B. Time Series Components: Seasonality�������������������������������������������15
Problem���������������������������������������������������������������������������������������������������������15
Solution���������������������������������������������������������������������������������������������������������15
How It Works�������������������������������������������������������������������������������������������������15
Recipe 1-4C. Time Series Components: Seasonality (cont’d.)�����������������������������18
Problem���������������������������������������������������������������������������������������������������������18
Solution���������������������������������������������������������������������������������������������������������18
How It Works�������������������������������������������������������������������������������������������������19
Recipe 1-5A. Time Series Decomposition: Additive Model����������������������������������21
Problem���������������������������������������������������������������������������������������������������������21
Solution���������������������������������������������������������������������������������������������������������21
How It Works�������������������������������������������������������������������������������������������������22
Recipe 1-5B. Time Series Decomposition: Multiplicative Model�������������������������24
Problem���������������������������������������������������������������������������������������������������������24
Solution���������������������������������������������������������������������������������������������������������25
How It Works�������������������������������������������������������������������������������������������������25
Recipe 1-6. Visualization of Seasonality�������������������������������������������������������������27
Problem���������������������������������������������������������������������������������������������������������27
Solution���������������������������������������������������������������������������������������������������������28
How It Works�������������������������������������������������������������������������������������������������28

vi
Table of Contents

Chapter 2: Statistical Univariate Modeling�����������������������������������������33


Recipe 2-1. Moving Average (MA) Forecast��������������������������������������������������������34
Problem���������������������������������������������������������������������������������������������������������34
Solution���������������������������������������������������������������������������������������������������������34
How It Works�������������������������������������������������������������������������������������������������34
Recipe 2-2. Autoregressive (AR) Model��������������������������������������������������������������38
Problem���������������������������������������������������������������������������������������������������������38
Solution���������������������������������������������������������������������������������������������������������38
How It Works�������������������������������������������������������������������������������������������������38
Recipe 2-3. Autoregressive Moving Average (ARMA) Model�������������������������������43
Problem���������������������������������������������������������������������������������������������������������43
Solution���������������������������������������������������������������������������������������������������������43
How It Works�������������������������������������������������������������������������������������������������44
Recipe 2-4. Autoregressive Integrated Moving Average (ARIMA) Model�������������49
Problem���������������������������������������������������������������������������������������������������������49
Solution���������������������������������������������������������������������������������������������������������49
How It Works�������������������������������������������������������������������������������������������������49
Recipe 2-5. Grid Search Hyperparameter Tuning for ARIMA Model��������������������54
Problem���������������������������������������������������������������������������������������������������������54
Solution���������������������������������������������������������������������������������������������������������54
How It Works�������������������������������������������������������������������������������������������������54
Recipe 2-6. Seasonal Autoregressive Integrated Moving
Average (SARIMA) Model������������������������������������������������������������������������������������60
Problem���������������������������������������������������������������������������������������������������������60
Solution���������������������������������������������������������������������������������������������������������60
How It Works�������������������������������������������������������������������������������������������������60

vii
Table of Contents

Recipe 2-7. Simple Exponential Smoothing (SES) Model�����������������������������������62


Problem���������������������������������������������������������������������������������������������������������62
Solution���������������������������������������������������������������������������������������������������������63
How It Works�������������������������������������������������������������������������������������������������63
Recipe 2-8. Holt-Winters (HW) Model�����������������������������������������������������������������64
Problem���������������������������������������������������������������������������������������������������������64
Solution���������������������������������������������������������������������������������������������������������65
How It Works�������������������������������������������������������������������������������������������������65

Chapter 3: Advanced Univariate and Statistical Multivariate


Modeling���������������������������������������������������������������������������������������������67
Recipe 3-1. FBProphet Univariate Time Series Modeling�����������������������������������68
Problem���������������������������������������������������������������������������������������������������������68
Solution���������������������������������������������������������������������������������������������������������68
How It Works�������������������������������������������������������������������������������������������������68
Recipe 3-2. FBProphet Modeling by Controlling the Change Points�������������������73
Problem���������������������������������������������������������������������������������������������������������73
Solution���������������������������������������������������������������������������������������������������������73
How It Works�������������������������������������������������������������������������������������������������74
Recipe 3-3. FBProphet Modeling by Adjusting Trends����������������������������������������79
Problem���������������������������������������������������������������������������������������������������������79
Solution���������������������������������������������������������������������������������������������������������79
How It Works�������������������������������������������������������������������������������������������������79
Recipe 3-4. FBProphet Modeling with Holidays��������������������������������������������������82
Problem���������������������������������������������������������������������������������������������������������82
Solution���������������������������������������������������������������������������������������������������������82
How It Works�������������������������������������������������������������������������������������������������82

viii
Table of Contents

Recipe 3-5. FBProphet Modeling with Added Regressors����������������������������������84


Problem���������������������������������������������������������������������������������������������������������84
Solution���������������������������������������������������������������������������������������������������������84
How It Works�������������������������������������������������������������������������������������������������84
Recipe 3-6. Time Series Forecasting Using Auto-ARIMA������������������������������������87
Problem���������������������������������������������������������������������������������������������������������87
Solution���������������������������������������������������������������������������������������������������������87
How It Works�������������������������������������������������������������������������������������������������87
Recipe 3-7. Multivariate Time Series Forecasting Using the VAR Model������������96
Problem���������������������������������������������������������������������������������������������������������96
Solution���������������������������������������������������������������������������������������������������������96
How It Works�������������������������������������������������������������������������������������������������96

Chapter 4: Machine Learning Regression–based Forecasting���������103


Recipe 4-1. Formulating Regression Modeling for Time Series Forecasting����104
Problem�������������������������������������������������������������������������������������������������������104
Solution�������������������������������������������������������������������������������������������������������104
How It Works�����������������������������������������������������������������������������������������������104
Recipe 4-2. Implementing the XGBoost Model�������������������������������������������������112
Problem�������������������������������������������������������������������������������������������������������112
Solution�������������������������������������������������������������������������������������������������������112
How It Works�����������������������������������������������������������������������������������������������112
Recipe 4-3. Implementing the LightGBM Model�����������������������������������������������114
Problem�������������������������������������������������������������������������������������������������������114
Solution�������������������������������������������������������������������������������������������������������114
How It Works�����������������������������������������������������������������������������������������������114

ix
Table of Contents

Recipe 4-4. Implementing the Random Forest Model��������������������������������������116


Problem�������������������������������������������������������������������������������������������������������116
Solution�������������������������������������������������������������������������������������������������������116
How It Works�����������������������������������������������������������������������������������������������116
Recipe 4-5. Selecting the Best Model���������������������������������������������������������������118
Problem�������������������������������������������������������������������������������������������������������118
Solution�������������������������������������������������������������������������������������������������������118
How It Works�����������������������������������������������������������������������������������������������119

Chapter 5: Deep Learning–based Time Series Forecasting��������������127


Recipe 5-1. Time Series Forecasting Using LSTM��������������������������������������������128
Problem�������������������������������������������������������������������������������������������������������128
Solution�������������������������������������������������������������������������������������������������������128
How It Works�����������������������������������������������������������������������������������������������128
Recipe 5-2. Multivariate Time Series Forecasting Using the GRU Model����������136
Problem�������������������������������������������������������������������������������������������������������136
Solution�������������������������������������������������������������������������������������������������������136
How It Works�����������������������������������������������������������������������������������������������136
Recipe 5-3. Time Series Forecasting Using NeuralProphet������������������������������158
Problem�������������������������������������������������������������������������������������������������������158
Solution�������������������������������������������������������������������������������������������������������158
How It Works�����������������������������������������������������������������������������������������������158
Recipe 5-4. Time Series Forecasting Using RNN����������������������������������������������164
Problem�������������������������������������������������������������������������������������������������������164
Solution�������������������������������������������������������������������������������������������������������165
How It Works�����������������������������������������������������������������������������������������������165

Index�������������������������������������������������������������������������������������������������169

x
About the Authors
Akshay R Kulkarni is an artificial intelligence (AI) and machine learning (ML)
evangelist and thought leader. He has consulted several Fortune 500 and
global enterprises to drive AI and data science–led strategic
transformations. He is a Google developer, an author, and a regular
speaker at major AI and data science conferences (including the O’Reilly
Strata Data & AI Conference and Great Indian Developer Summit (GIDS)).
He is a visiting faculty member at some of the top graduate institutes in
India. In 2019, he was featured as one of India’s “top 40 under 40” data
scientists. In his spare time, Akshay enjoys reading, writing, coding, and
helping aspiring data scientists. He lives in Bangalore with his family.

Adarsha Shivananda is a data science and MLOps leader. He is working


on creating world-class MLOps capabilities to ensure continuous value
delivery from AI. He aims to build a pool of exceptional data scientists
within and outside organizations to solve problems through training
programs. He always wants to stay ahead of the curve. Adarsha has worked
extensively in the pharma, healthcare, CPG, retail, and marketing domains.
He lives in Bangalore and loves to read and teach data science.

Anoosh Kulkarni is a senior AI consultant. He has worked with global


clients across multiple domains to help them solve their business
problems using machine learning, natural language processing (NLP), and
deep learning. Anoosh is passionate about guiding and mentoring people
in their data science journey. He leads data science/machine learning
meet-ups and helps aspiring data scientists navigate their careers. He
also conducts ML/AI workshops at universities and is actively involved in
conducting webinars, talks, and sessions on AI and data science. He lives
in Bangalore with his family.
xi
About the Authors

V Adithya Krishnan is a data scientist and MLOps engineer. He has


worked with various global clients across ­multiple domains and helped
them to solve their business problems extensively using advanced ML
applications. He has experience across multiple fields of AI-ML, including
time series forecasting, deep learning, NLP, ML operations, image
processing, and data analytics. Presently, he is working on a state-of-the-
art value observability suite for models in production, which includes
continuous model and data monitoring along with the business value
realized. He presented a paper, “Deep Learning Based Approach for
Range Estimation,” written in collaboration with the DRDO, at an IEEE
conference. He lives in Chennai with his family.

xii
About the Technical Reviewer
Krishnendu Dasgupta is a co-founder of DOCONVID AI. He is a computer
science and engineering graduate with a decade of experience building
solutions and platforms on applied machine learning. He has worked
with NTT DATA, PwC, and Thoucentric and is now working on applied
AI research in medical imaging and decentralized privacy-preserving
machine learning in healthcare. Krishnendu is an alumnus of the MIT
Entrepreneurship and Innovation Bootcamp and devotes his free time as
an applied AI and ML research volunteer for various research NGOs and
universities across the world.

xiii
Preface
Before reading this book, you should have a basic knowledge of statistics,
machine learning, and Python programming. If you want to learn how to
build basic to advanced time series forecasting models, then this book
will help by providing recipes for implementation in Python. By the end
of the book, you will have practical knowledge of all the different types of
modeling methods in time series.
The desire to know the unknown and to predict the future has been
part of human culture for ages. This desire has driven mankind toward
the discipline of forecasting. Time series forecasting predicts unknown
future data points based on the data's previous (past) observed pattern. It
can depend not only on the previous target points and time (univariate)
but also on other independent variables (multivariate). This book is a
cookbook containing various recipes to handle time series forecasting.
Data scientists starting a new time series project but don’t have prior
experience in this domain can easily utilize the various recipes in this
book, which are domain agnostic, to kick-start and ease their development
process.
This book is divided into five chapters. Chapter 1 covers recipes for
reading and processing the time series data and basic Exploratory Data
Analysis (EDA). The following three chapters cover various forecasting
modeling techniques for univariate and multivariate datasets. Chapter 2
has recipes for multiple statistical univariate forecasting methods, with
more advanced techniques continued in Chapter 3. Chapter 3 also covers
statistical multivariate methods. Chapter 4 covers time series forecasting
using machine learning (regression-based). Chapter 5 is on advanced time
series modeling methods using deep learning.

xv
Preface

The code for all the implementations in each chapter and the required
datasets is available for download at ­github.com/apress/time-series-­
algorithm-recipes.

xvi
CHAPTER 1

Getting Started
with Time Series
A time series is a sequence of time-dependent data points. For example,
the demand (or sales) for a product in an e-commerce website can be
measured temporally in a time series, where the demand (or sales)
is ordered according to the time. This data can then be analyzed to
find critical temporal insights and forecast future values, which helps
businesses plan and increase revenue.
Time series data is used in every domain where real-time analytics is
essential. Analyzing this data and forecasting its future value has become
essential to these domains.
Time series analysis/forecasting was previously considered a purely
statistical problem. It is now used in many machine learning and deep
learning–based solutions, which perform equally well or even outperform
most other solutions. This book uses various methods and approaches to
analyze and forecast time series.
This chapter uses recipes to read/write time series data and perform
simple preprocessing and Exploratory Data Analysis (EDA).
The following lists the recipes explored in this chapter.

Recipe 1-1. Reading Time Series Objects

Recipe 1-2. Saving Time Series Objects

© Akshay R Kulkarni, Adarsha Shivananda, Anoosh Kulkarni, V Adithya Krishnan 2023 1


A. R. Kulkarni et al., Time Series Algorithms Recipes,
https://doi.org/10.1007/978-1-4842-8978-5_1
Chapter 1 Getting Started with Time Series

Recipe 1-3. Exploring Types of Time Series Data

Recipe 1-4. Time Series Components

Recipe 1-5. Time Series Decomposition

Recipe 1-6. Visualization of Seasonality

 ecipe 1-1A. Reading Time Series Objects


R
(Air Passengers)
Problem
You want to read and load time series data into a dataframe.

Solution
Pandas load the data into a dataframe structure.

How It Works
The following steps read the data.

Step 1A-1. Import the required libraries.


import pandas as pd
import matplotlib.pyplot as plt

 tep 1A-2. Write a parsing function


S
for the datetime column.
Before reading the data, let’s write a parsing function.

date_parser_fn = lambda dates: pd.datetime.strptime(dates,


'%Y-%m')

2
Chapter 1 Getting Started with Time Series

Step 1A-3. Read the data.


Read the air passenger data.

data = pd.read_csv('./data/AirPassenger.csv', parse_dates =


['Month'], index_col = 'Month', date_parser = date_parser_fn)
plt.plot(data)
plt.show()

Figure 1-1 shows the time series plot output.

Figure 1-1. Output

The following are some of the important input arguments for read_csv.

• parse_dates mentions the datetime column in the


dataset that needs to be parsed.

• index_col mentions the column that is a unique


identifier for the pandas dataframe. In most time series
use cases, it’s the datetime column.

• date_parser is a function to parse the dates (i.e., converts


an input string to datetime format/type). pandas reads the
data in YYYY-MM-DD HH:MM:SS format. Convert to this
format when using the parser function.
3
Chapter 1 Getting Started with Time Series

 ecipe 1-1B. Reading Time Series Objects


R
(India GDP Data)
Problem
You want to save the loaded time series dataframe in a file.

Solution
Save the dataframe as a comma-separated (CSV) file.

How It Works
The following steps read the data.

Step 1B-1. Import the required libraries.


import pandas as pd
import matplotlib.pyplot as plt
import pickle

Step 1B-2. Read India’s GDP time series data.


indian_gdp_data = pd.read_csv('./data/GDPIndia.csv', header=0)

date_range = pd.date_range(start='1/1/1960', end='31/12/2017',


freq='A')

indian_gdp_data ['TimeIndex'] = pd.DataFrame(date_range,


columns=['Year'])
indian_gdp_data.head(5).T

4
Chapter 1 Getting Started with Time Series

Step 1B-3. Plot the time series.


plt.plot(indian_gdp_data.TimeIndex, indian_gdp_data.
GDPpercapita)
plt.legend(loc='best')
plt.show()

Figure 1-2 shows the output time series.

Figure 1-2. Output

Step 1B-4. Store and retrieve as a pickle.


### Store as a pickle object
import pickle
with open('gdp_india.obj', 'wb') as fp:
        pickle.dump(IndiaGDP, fp)

### Retrieve the pickle object


with open('gdp_india.obj', 'rb') as fp:
     indian_gdp_data1 = pickle.load(fp)
indian_gdp_data1.head(5).T

Figure 1-3 shows the retrieved time series object transposed.

5
Chapter 1 Getting Started with Time Series

Figure 1-3. Output

Recipe 1-2. Saving Time Series Objects


Problem
You want to save a loaded time series dataframe into a file.

Solution
Save the dataframes as a CSV file.

How It Works
The following steps store the data.

 tep 2-1. Save the previously loaded time


S
series object.
### Saving the TS object as csv
data.to_csv('ts_data.csv', index = True, sep = ',')

### Check the obj stored


data1 = data.from_csv('ts_data.csv', header = 0)

### Check
print(data1.head(2).T)

6
Chapter 1 Getting Started with Time Series

The output is as follows.

1981-01-01
1981-01-02    17.9
1981-01-03    18.8
Name: 20.7, dtype: float64

 ecipe 1-3A. Exploring Types of Time Series


R
Data: Univariate
Problem
You want to load and explore univariate time series data.

Solution
A univariate time series is data with a single time-dependent variable.
Let’s look at a sample dataset of the monthly minimum temperatures
in the Southern Hemisphere from 1981 to 1990. The temperature is the
time-dependent target variable.

How It Works
The following steps read and plot the univariate data.

Step 3A-1. Import the required libraries.


import pandas as pd

import matplotlib.pyplot as plt

7
Chapter 1 Getting Started with Time Series

Step 3A-2. Read the time series data.


data = pd.read_csv('./data/daily-minimum-temperatures.csv',
header = 0, index_col = 0, parse_dates = True, squeeze = True)
print(data.head())

The output is as follows.

Date
1981-01-01    20.7
1981-01-02    17.9
1981-01-03    18.8
1981-01-04    14.6
1981-01-05    15.8
Name: Temp, dtype: float64

Step 3A-3. Plot the time series.


Let’s now plot the time series data to detect patterns.

data.plot()
plt.ylabel('Minimum Temp')
plt.title('Min temp in Southern Hemisphere From 1981 to 1990')
plt.show()

Figure 1-4 shows the output time series plot.

8
Chapter 1 Getting Started with Time Series

Figure 1-4. Time series plot

This is called univariate time series analysis since only one variable,
temp (the temperature over the past 19 years), was used.

 ecipe 1-3B. Exploring Types of Time Series


R
Data: Multivariate
Problem
You want to load and explore multivariate time series data.

Solution
A multivariate time series is a type of time series data with more features
that the target depends on, which are also time-dependent; that is, the
target is not only dependent on its past values. This relationship is used to
forecast the target values.

9
Chapter 1 Getting Started with Time Series

Let’s load and explore a Beijing pollution dataset, which is


multivariate.

How It Works
The following steps read and plot the multivariate data.

Step 3B-1. Import the required libraries.


import pandas as pd

from datetime import datetime


import matplotlib.pyplot as plt

Step 3B-2. Write the parsing function.


Before loading the raw dataset and parsing the datetime information as the
pandas dataframe index, let’s first write a parsing function.

def parse(x):
    return datetime.strptime(x, '%Y %m %d %H')

Step 3B-3. Load the dataset.


data1 = pd.read_csv('./data/raw.csv',  parse_dates = [['year',
'month', 'day', 'hour']],
                   index_col=0, date_parser=parse)

Step 3B-4. Do basic preprocessing.


Drop the No column.

data1.drop('No', axis=1, inplace=True)

10
Chapter 1 Getting Started with Time Series

Manually specify each column name.

data1.columns = ['pollution', 'dew', 'temp', 'press', 'wnd_


dir', 'wnd_spd', 'snow', 'rain']
data1.index.name = 'date'

Let’s mark all NA values with 0.

data1['pollution'].fillna(0, inplace=True)

Drop the first 24 hours.

data1 = data1[24:]

Summarize the first five rows.

print(data1.head(5))

The output is as follows.

                     pollution  dew  temp   press wnd_dir  


wnd_spd  snow  rain
date
2010-01-02 00:00:00      129.0  -16  -4.0  1020.0      SE    
1.79     0     0
2010-01-02 01:00:00      148.0  -15  -4.0  1020.0      SE    
2.68     0     0
2010-01-02 02:00:00      159.0  -11  -5.0  1021.0      SE    
3.57     0     0
2010-01-02 03:00:00      181.0   -7  -5.0  1022.0      SE     
5.36     1     0
2010-01-02 04:00:00      138.0   -7  -5.0  1022.0      SE     
6.25     2     0

11
Chapter 1 Getting Started with Time Series

This information is from a dataset on the pollution and weather


conditions in Beijing. The time aggregation of the recordings was hourly
and measured for five years. The data includes the datetime column, the
pollution metric known as PM2.5 ­concentration, and some critical weather
information, including temperature, pressure, and wind speed.

Step 3B-5. Plot each series.


Now let’s plot each series as a separate subplot, except wind speed
direction, which is categorical.

vals = data1.values

# specify columns to plot

group_list = [0, 1, 2, 3, 5, 6, 7]
i = 1

# plot each column


plt.figure()

for group in group_list:


    plt.subplot(len(group_list), 1, i)
    plt.plot(vals[:, group])
    plt.title(data1.columns[group], y=0.5, loc='right')
    i += 1

plt.show()

Figure 1-5 shows the plot of all variables across time.

12
Chapter 1 Getting Started with Time Series

Figure 1-5. A plot of all variables across time

 ecipe 1-4A. Time Series


R
Components: Trends
Problem
You want to find the components of the time series, starting with trends.

Solution
A trend is the overall movement of data in a particular direction—that is,
the values going upward (increasing) or downward (decreasing) over a
period of time.
Let’s use a shampoo sales dataset, which has a monthly sales count for
three years.

How It Works
The following steps read and plot the data.

13
Chapter 1 Getting Started with Time Series

Step 4A-1. Import the required libraries.


import pandas as pd
import matplotlib.pyplot as plt

Step 4A-2. Write the parsing function.


def parsing_fn(x):
    return datetime.strptime('190'+x, '%Y-%m')

Step 4A-3. Load the dataset.


data = pd.read_csv('./data/shampoo-sales.csv', header=0, parse_
dates=[0], index_col=0, squeeze=True, date_parser= parsing_fn)

Step 4A-4. Plot the time series.


data.plot()
plt.show()

Figure 1-6 shows the time series plot.

Figure 1-6. Output

14
Chapter 1 Getting Started with Time Series

This data has a rising trend, as seen in Figure 1-6. The output time
series plot shows that, on average, the values increase with time.

 ecipe 1-4B. Time Series


R
Components: Seasonality
Problem
You want to find the components of time series data based on seasonality.

Solution
Seasonality is the recurrence of a particular pattern or change in time
series data.
Let’s use a Melbourne, Australia, minimum daily temperature dataset
from 1981–1990. The focus is on seasonality.

How It Works
The following steps read and plot the data.

Step 4B-1. Import the required libraries.


import pandas as pd
import matplotlib.pyplot as plt

Step 4B-2. Read the data.


data = pd.read_csv('./data/daily-minimum-temperatures.csv',
header = 0, index_col = 0, parse_dates = True, squeeze = True)

15
Chapter 1 Getting Started with Time Series

Step 4B-3. Plot the time series.


data.plot()
plt.ylabel('Minimum Temp')
plt.title('Min temp in Southern Hemisphere from 1981 to 1990')
plt.show()

Figure 1-7 shows the time series plot.

Figure 1-7. Output

Figure 1-7 shows that this data has a strong seasonality component
(i.e., a repeating pattern in the data over time).

Step 4B-4. Plot a box plot by month.


Let’s visualize a box plot to check monthly variation in 1990.

month_df = DataFrame()
one_year_ser = data['1990']
grouped_df = one_year_ser.groupby(Grouper(freq='M'))
month_df = pd.concat([pd.DataFrame(x[1].values) for x in
grouped_df], axis=1)

16
Chapter 1 Getting Started with Time Series

month_df = pd.DataFrame(month_df)
month_df.columns = range(1,13)
month_df.boxplot()
plt.show()

Figure 1-8 shows the box plot output by month.

Figure 1-8. Monthly level box plot output

The box plot, Figure 1-8, shows the distribution of minimum


temperature for each month. There appears to be a seasonal component
each year, showing a swing from summer to winter. This implies a monthly
seasonality.

Step 4B-5. Plot a box plot by year.


Let’s group by year to see the change in distribution across various years.
This way, you can check for seasonality at every time aggregation.

grouped_ser = data.groupby(Grouper(freq='A'))
year_df  = pd.DataFrame()
for name, group in grouped_ser:

17
Chapter 1 Getting Started with Time Series

    year_df[name.year] = group.values
year_df.boxplot()
plt.show()

Figure 1-9 shows the box plot output by year.

Figure 1-9. Yearly level box plot

Figure 1-9 reveals that there is not much yearly seasonality or trends in
the box plot output.

 ecipe 1-4C. Time Series Components:


R
Seasonality (cont’d.)
Problem
You want to find time series components using another example of
seasonality.

Solution
Let’s explore tractor sales data to understand seasonality.

18
Chapter 1 Getting Started with Time Series

How It Works
The following steps read and plot the data.

Step 4C-1. Import the required libraries.


import pandas as pd
import matplotlib.pyplot as plt

Step 4C-2. Read tractor sales data.


tractor_sales_data = pd.read_csv("./data/tractor_sales
Sales.csv")
tractor_sales_data.head(5)

Step 4C-3. Set a datetime series to use as an index.


date_ser = pd.date_range(start='2003-01-01', freq='MS',
periods=len(Tractor))

Step 4C-4. Format the data.


tractor_sales_data.rename(columns={'Number of Tractor
Sold':'Tractor-­Sales'}, inplace=True)
tractor_sales_data.set_index(dates, inplace=True)
tractor_sales_data = tractor_sales_data[['Tractor-Sales']]
tractor_sales_data.head(5)

Step 4C-5. Plot the time series.


tractor_sales_data.plot()
plt.ylabel('Tractor Sales')
plt.title("Tractor Sales from 2003 to 2014")
plt.show()

19
Chapter 1 Getting Started with Time Series

Figure 1-10 shows the time series plot output.

Figure 1-10. Output

From the time series plot, Figure 1-10 shows that the data has a strong
seasonality with an increasing trend.

Step 4C-6. Plot a box plot by month.


Let’s check the box plot by month to better understand the seasonality.

month_df = pd.DataFrame()
one_year_ser = tractor_sales_data['2011']
grouped_ser = one_year_ser.groupby(Grouper(freq='M'))
month_df = pd.concat([pd.DataFrame(x[1].values) for x in
grouped_ser], axis=1)
month_df = pd.DataFrame(month_df)
month_df.columns = range(1,13)
month_df.boxplot()
plt.show()

Figure 1-11 shows the box plot output by month.

20
Chapter 1 Getting Started with Time Series

Figure 1-11. Monthly level box plot

The box plot shows a seasonal component each year, with a swing from
May to August.

 ecipe 1-5A. Time Series Decomposition:


R
Additive Model
Problem
You want to learn how to decompose a time series using additive model
decomposition.

Solution
• The additive model suggests that the
components add up.

• It is linear, where changes over time are constantly


made in the same amount.

21
Chapter 1 Getting Started with Time Series

• The seasonality should have the same frequency and


amplitude. Frequency is the width between cycles, and
amplitude is the height of each cycle.

The statsmodel library has an implementation of the classical


decomposition method, but the user has to specify whether the model is
additive or multiplicative. The function is called seasonal_decompose.

How It Works
The following steps load and decompose the time series.

Step 5A-1. Load the required libraries.


### Load required libraries
import pandas as pd
import matplotlib.pyplot as plt
from statsmodels.tsa.seasonal import seasonal_decompose
import statsmodels.api as sm

Step 5A-2. Read and process retail turnover data.


turn_over_data = pd.read_csv('./data/RetailTurnover.csv')
date_range = pd.date_range(start='1/7/1982', end='31/3/1992',
freq='Q')
turn_over_data['TimeIndex'] = pd.DataFrame(date_range,
columns=['Quarter'])

Step 5A-3. Plot the time series.


plt.plot(turn_over_data.TimeIndex, turn_over_data.Turnover)
plt.legend(loc='best')
plt.show()

22
Chapter 1 Getting Started with Time Series

Figure 1-12 shows the time series plot output.

Figure 1-12. Time series plot output

Figure 1-12 shows that the trend is linearly increasing, and there is
constant linear seasonality.

Step 5A-4. Decompose the time series.


Let’s decompose the time series by trends, seasonality, and residuals.

decomp_turn_over = sm.tsa.seasonal_decompose(turn_over_data.
Turnover, model="additive", freq=4)
decomp_turn_over.plot()
plt.show()

Figure 1-13 shows the time series decomposition output.

23
Chapter 1 Getting Started with Time Series

Figure 1-13. Time series decomposition output

Step 5A-5. Separate the components.


You can get the trends, seasonality, and residuals as separate series with
the following.

trend = decomp_turn_over.trend
seasonal = decomp_turn_over.seasonal
residual = decomp_turn_over.resid

 ecipe 1-5B. Time Series Decomposition:


R
Multiplicative Model
Problem
You want to learn how to decompose a time series using multiplicative
model decomposition.

24
Chapter 1 Getting Started with Time Series

Solution
• A multiplicative model suggests that the components
are multiplied up.

• It is non-linear, such as quadratic or exponential, which


means that the changes increase or decrease with time.

• The seasonality has an increasing or a decreasing


frequency and/or amplitude.

How It Works
The following steps load and decompose the time series.

Step 5B-1. Load the required libraries.


### Load required libraries
import pandas as pd
import matplotlib.pyplot as plt
from statsmodels.tsa.seasonal import seasonal_decompose
import statsmodels.api as sm

Step 5B-2. Load air passenger data.


air_passengers_data = pd.read_csv('./data/AirPax.csv')

Step 5B-3. Process the data.


date_range = pd.date_range(start='1/1/1949', end='31/12/1960',
freq='M')
air_passengers_data ['TimeIndex'] = pd.DataFrame(date_range,
columns=['Month'])
print(air_passengers_data.head())

25
Chapter 1 Getting Started with Time Series

The output is as follows.

   Year Month  Pax  TimeIndex
0  1949   Jan  112 1949-01-31
1  1949   Feb  118 1949-02-28
2  1949   Mar  132 1949-03-31
3  1949   Apr  129 1949-04-30
4  1949   May  121 1949-05-31

Figure 1-14 shows the time series output plot.

Figure 1-14. Time series output plot

Step 5B-4. Decompose the time series.


decomp_air_passengers_data = sm.tsa.seasonal_decompose
(air_passengers_data.Pax, model="multiplicative", freq=12)
decomp_air_passengers_data.plot()
plt.show()

Figure 1-15 shows the time series decomposition output.

26
Chapter 1 Getting Started with Time Series

Figure 1-15. Time series decomposition output

Step 5B-5. Get the seasonal component.


Seasonal_comp = decomp_air_passengers_data.seasonal
Seasonal_comp.head(4)
The output is as follows.

0    0.910230
1    0.883625
2    1.007366
3    0.975906
Name: Pax, dtype: float64

Recipe 1-6. Visualization of Seasonality


Problem
You want to learn how to visualize the seasonality component.

27
Chapter 1 Getting Started with Time Series

Solution
Let’s look at a few additional methods to visualize and detect seasonality.
The retail turnover data shows the seasonality component per quarter.

How It Works
The following steps load and visualize the time series (i.e., the seasonality
component).

Step 6-1. Import the required libraries.


import pandas as pd
import matplotlib.pyplot as plt

Step 6-2. Load the data.


turn_over_data = pd.read_csv('./data/RetailTurnover.csv')

Step 6-3. Process the data.


date_range = pd.date_range(start='1/7/1982', end='31/3/1992',
freq='Q')
turn_over_data['TimeIndex'] = pd.DataFrame(date_range,
columns=['Quarter'])

Step 6-4. Pivot the table.


Now let’s pivot the table such that quarterly information is in the
columns, yearly information is in the rows, and the values consist of
turnover information.

quarterly_turn_over_data = pd.pivot_table(turn_over_data,
values = "Turnover", columns = "Quarter", index = "Year")
quarterly_turn_over_data

28
Chapter 1 Getting Started with Time Series

Figure 1-16 shows the output by quarterly turnover.

Figure 1-16. Quarterly turnover output

Step 6-5. Plot the line charts.


Let’s plot line plots for the four quarters.

quarterly_turn_over_data.plot()
plt.show()

Figure 1-17 shows the quarter-level line plots.

29
Chapter 1 Getting Started with Time Series

Figure 1-17. Quarterly turnover line chart

Step 6-6. Plot the box plots.


Let’s also plot the box plot at the quarterly level.

quarterly_turn_over_data.boxplot()
plt.show()

Figure 1-18 shows the output of the box plot by quarter.

Figure 1-18. Quarterly level box plot

30
Other documents randomly have
different content
settled a pension upon the family of André, and, to wipe out the
imputed stain produced by his death as a spy, the honor of
knighthood was conferred upon his brother.

André's Monument in Westminster Abbey.


As related in the inscription on the pedestal of André's monument,
given in a foot-note, Mr. Buchanan caused his remains to be
disinterred and sent to England. Two small cedar-trees were growing
near the grave wherein lay his remains. A portion of one of these
was sent with the remains, and, at the suggestion of the consul, the
duke caused a snuff-box to be made of it for the Rev. Mr. Demorest,
of Tappaan, who gave Mr. Buchanan much assistance in his
undertaking. It was elegant in design, was lined with gold, and was
inscribed with the words:
"From his Royal Highness the Duke of York, to mark his sense of the
Rev. John Demorest's liberal attention upon the occasion of the
removal of the remains of the late Major André, at Tappaan, on the
10th of August, 1821."
The surviving sisters of André sent a silver cup to Mr. Demorest, with
a suitable inscription; also an inkstand to the British consul.
Two monuments have been erected at different times on the spot
where André was executed, each with the sole purpose of
commemorating this very important event in our national history,
and to mark the exact locality of its occurrence. One of these
monuments was set up by James Lee,[58] a public-spirited New York
merchant, nearly forty years ago. It consisted of a small bowlder,
upon the upper surface of which were cut the words, "André was
executed October 2, 1780." It was on the right side of a lane which
ran from the highway from Tappaan village to old Tappaan, on the
westerly side of a large peach-orchard, and about a mile from
Washington's headquarters. I visited the spot in 1849, and made a
drawing of this simple memorial-stone for my "Pictorial Field Book of
the Revolution." In a foot-note of that work (vol. i, p. 772) I said, "A
more elegant and durable monument should be erected on the
spot."

Bowlder-Monument.
A "more elegant and durable monument" was placed on the same
spot a few years ago by another public-spirited New York merchant,
Mr. Cyrus W. Field, and bears an inscription written by the late Rev.
Arthur Penrhyn Stanley, the Dean of Westminster. When that
eminent divine and earnest friend of our country and admirer of our
free institutions was about to visit the United States in 1878, he
made a list of the objects and localities which he desired to see
while here. Among these was the place of André's execution.
While Dean Stanley was visiting Mr. Field at his country residence on
the eastern bank of the Hudson, nearly opposite Tappaan, he with
his two traveling companions and their host crossed the river, and,
with one or two citizens of Tappaan, visited places of historic interest
in the vicinity. They found that nothing marked the place of André's
execution, and that it had even been a subject of controversy. The
bowlder-monument had been removed several years before. The
dean expressed his surprise and regret that no object indicated the
locality of such an important historical event, when Mr. Field said he
would erect a memorial-stone there at his own expense upon certain
conditions. A few days afterward (October, 1878) he wrote to a
citizen of Tappaan:
"I am perfectly willing to erect a monument on 'André Hill' [so
named by the people in commemoration of the event which occurred
there], and the dean will write an inscription, if the people who own
the land will make a grant of about twenty square feet for the
purpose."
So soon as it became known that Mr. Field proposed to erect a
memorial-stone at Tappaan, a correspondent of a New York morning
journal denounced the intention, upon the wholly erroneous
assumption that it was to be a "monument in honor of Major André,
the British spy." Other correspondents, equally uninformed, followed
with denunciations. A storm of apparently indignant protests, or
worse, ensued; and one writer, lacking courage to give his name,
made a threat that, if Mr. Field should set up a memorial-stone upon
the place where André was executed, "ten thousand men" were
ready to pull it down and cast it into the river! These writers, many
of whom concealed their real names, created considerable feeling in
the public mind unfavorable to the project, and elicited a multitude
of appeals to the patriotism and the prejudices of the American
people, to oppose what?—a phantom!
This intemperate and unwise correspondence continued several
weeks. There were calm defenders of Mr. Field's motives in
proposing to erect a monument, by persons who were well informed
and had a clear perception of the intent and importance of such an
act. The discussion was fruitful of some good. It had the salutary
effect of calling public attention to the claims of Nathan Hale, the
notable martyr spy of the Revolution, to a memorial tribute—a public
recognition of his virtues and his deeds—which had been so long
deferred by our people. These claims were now earnestly advocated,
not only by Mr. Field's critics, but by patriotic citizens. Considerable
sums of money were offered for the laudable purpose of erecting a
suitable monument in the city of New York to the memory of Hale.
Several persons offered one hundred dollars each.
Before the visit of Mr. Field and the dean, Mr. Henry Whittemore, a
public-spirited citizen of Tappan, and Secretary of the Rockland
County Historical Society, had found four living men who were
present at the disinterment of André's remains in 1821. With these
men he went to "André Hill," where they identified the place of the
spy's grave.[59] The requisite plot of ground was secured by Mr.
Field, who was compelled to buy many surrounding acres at an
exorbitant price. Then, relying upon the good sense, the intelligence,
and the patriotism of the American people for a just appreciation of
his motives, he proceeded to have a memorial-stone prepared.
Soon after Dean Stanley returned home he wrote the promised
inscription, and, in a letter to Mr. Whittemore (January, 1879), he
said:
Dean Stanley's Autograph.
"I have sent to Mr. Cyrus W. Field the inscription
suggested. Perhaps you will kindly see that the facts are
correctly stated. It is desirable that the inscription should
contain neither an attack nor a defense of André, but only
an expression of sympathy with him in his tragical fate,
and with Washington for the difficult circumstances in
which the judges were placed.
"A wreath of autumn leaves from the Hudson I had placed
on the monument in the abbey attracts universal
attention. I have also the silver medals of Washington's
headquarters, and the old Dutch church at Tappaan.
"I remain, yours gratefully,

"A.P. Stanley."[60]
On the 2d of October, 1879, the ninety-ninth anniversary of the
execution of André, the monument prepared by Mr. Field's order, and
placed over the spot where the spy was buried, was uncovered in
the presence of representatives of the Historical Societies of New
York, and Rockland County, of officers of the army of the United
States, of the newspaper press and other gentlemen, and a few
ladies. At noon, the hour of the day when André was executed, Mr.
Field directed the workmen to uncover the memorial. There was no
pomp or ceremony on the occasion. Not a speech was uttered, nor a
token of applause given.
From "André Hill" the company went with Mr. Whittemore to his
home in Washington's headquarters and the room in which André's
death-warrant was signed. While there the neglect of the memory of
Nathan Hale, shown by the American people, was spoken of, when
Mr. Field said:
"Gentlemen, if I may be granted permission, I will erect a
monument in memory of Nathan Hale on the spot where
he suffered death in the city of New York, if the place may
be found."
Several years ago Mr. Field made a similar offer to the New York
Historical Society.[61] More than thirty years before, he was a
contributor to the fund raised to erect the modest monument in
memory of Hale at South Coventry, delineated on page 26; and he
was next to the largest contributor to the fund for procuring the
bronze statue of a captor of André that surmounts the monument at
Tarrytown, which commemorates that important event.
The memorial-stone erected at Tappaan is composed of a shaft of
Quincy gray granite, standing upon a pedestal of the same material.
The whole structure is about nine feet in height from the ground to
the apex. It is perfectly chaste in design. There is no ornamentation.
The granite is highly polished. It stands upon an elevation, about
two miles from the Hudson River, and thirty yards from the
boundary-line between New York and New Jersey, and overlooks a
beautiful country.[62] On its west side it bears the following
inscription, written by Dean Stanley:
"HERE DIED, OCTOBER 2, 1780,
MAJOR JOHN ANDRÉ, OF THE BRITISH ARMY,
WHO, ENTERING THE AMERICAN LINES
ON A SECRET MISSION TO BENEDICT ARNOLD,
FOR THE SURRENDER OF WEST POINT,
WAS TAKEN PRISONER, TRIED AND
CONDEMNED AS A SPY.
HIS DEATH,
THOUGH ACCORDING TO THE STERN RULE OF
WAR,
MOVED EVEN HIS ENEMIES TO PITY;
AND BOTH ARMIES MOURNED THE FATE
OF ONE SO YOUNG AND SO BRAVE.
IN 1821 HIS REMAINS WERE REMOVED TO
WESTMINSTER ABBEY.
A HUNDRED YEARS AFTER THE EXECUTION
THIS STONE WAS PLACED ABOVE THE SPOT
WHERE HE LAY,
BY A CITIZEN OF THE UNITED STATES,
AGAINST WHICH HE FOUGHT,
NOT TO PERPETUATE THE RECORD OF STRIFE,
BUT IN TOKEN OF THOSE BETTER FEELINGS
WHICH HAVE SINCE UNITED TWO NATIONS,
ONE IN RACE, IN LANGUAGE, AND IN RELIGION,
WITH THE HOPE THAT THIS FRIENDLY UNION
WILL NEVER BE BROKEN."
On the north face:
"HE WAS MORE UNFORTUNATE THAN
CRIMINAL."
"AN ACCOMPLISHED MAN AND GALLANT
OFFICER."

GEORGE WASHINGTON.
The first of these two lines was quoted from a letter of Washington
to Count de Rochambeau, October 10, 1780. (See Sparks's "Life and
Writings of Washington," vol. vii, p. 241.) The second line is from the
sentence of a letter written by Washington to Colonel John Laurens
on the 13th of October. (See Sparks, vol. vii, p. 256.)
On the north face of the stone are the words:
"SUNT LACRYMÆ RERUM ET MENTEM MORTALIA TANGUNT."
The east front was left blank for another inscription.

Memorial at Tappaan.
Such, in a few sentences, is the story of the erection of the
memorial-stone at Tappaan by Mr. Field. The idea was the product of
spontaneous thought, elicited by a special occasion. The sole object
to be attained is the laudable and patriotic one of perpetuating, by a
visible record, the memory of one of the most important events in
our history, at the place of its occurrence. That event has two
prominent aspects, namely: the courage, patriotism, faith in the
American people, and the unswerving fidelity in the discharge of a
momentous trust, of our beloved Washington and his officers, in the
face of most extraordinary temptations to do otherwise; and the
execution as a spy of the adjutant-general of the British army, while
that army, twenty thousand strong, was lying only a few miles
distant, and supported by powerful ships of war.
These were the events to be commemorated by this memorial-stone,
and not the name or character of any individual. It was no more a
monument "in honor of Major André, the British spy," than was the
monument of white marble, twenty-five feet in height, which was
erected by patriotic men, in 1853, to mark the spot at Tarrytown
where the spy was captured, or the naming of the rivulet near which
it stands "André Brook." Surely every intelligent and right-minded
American, clearly comprehending the truth of the whole matter, will
award to Mr. Field the meed of praise for his generous and patriotic
deed.
An attempt was made on the night of November 3, 1885, to destroy
the beautiful memorial-stone at Tappaan by an explosion of
dynamite. The pedestal was shattered into pieces, but the shaft was
only shaken from its perpendicular position. This crime was the
logical result of persistent misrepresentation of the character and
intent of the memorial in some of the newspapers. Twice before,
attempts had been made to destroy it; the first time by a
defacement of the inscription by a misguided person who, on a dark
night, battered the letters, many of them almost beyond recognition.
The destroyer[63] left a small American flag hanging over the
monument from a stick, supported by a pile of stones, upon the
apex; also the following lines, the product, evidently, of one moved
by a spirit of conscious untruthfulness, or of profound ignorance of
the character of the object assailed:
"Too long hath stood the traitor's shaft,
A monument to shame,
Built up to praise the traitor's craft,
To sanctify ill fame.
Are freemen bound to still forbear,
And meekly still implore,
When conquered foes their altars rear
Within our very door.

"This vulgar and insulting stone


Would honor for all time,
Not sneaking André's death alone,
But black Ben Arnold's crime.
And they, who thus can glorify
The traitor and his deeds,
Themselves high treason would employ
If 'twould fulfill their needs.

"Americans! resolve, proclaim


That on our own dear land,
Never, while the people reign,
Shall treason's statue stand!
And he who dares erect it next,
On fair Columbia's breast,
With furtive or with false pretext,
Shall dangle from its crest!"
The second attempt to destroy the memorial-stone was made on a
dark night. Nitro-glycerine or dynamite was used for the purpose.
The explosion was heard for miles around. The perpetrator of the
deed was not discovered. The stones of the pedestal were shattered,
but the shaft remained in an upright position.
Mr. Field had the damages to the memorial repaired. He designed to
have the acres around it fashioned into a handsome little park. He
also proposed to erect within the grounds a fire-proof building for
the use of the Rockland County Historical and Forestry Society as a
depository of historical and other relics of that county, the building to
be presented to the society, and the park to the citizens of Tappaan,
as a free gift. The outrage of November 3, 1885, may frustrate this
generous plan.
Two days after that outrage, a New York morning journal of large
circulation and wide influence declared that "the malignity with
which the people about Tappaan regard Mr. Field's monument to
André appears to be settled and permanent." To this grave
indictment of the inhabitants of a portion of Rockland County as
participants in the crime, that people responded by resolutions
unanimously adopted at an indignation meeting held at the
Reformed Church at Tappaan on the evening of the 9th. They
denounced the charge as utterly untrue, expressed their belief that
no person in the vicinity had "the remotest connection" with the
crime; that it was desirable to have the place of André's execution
indicated by a memorial-stone with a suitable inscription, and
commended Mr. Field for his zeal in perpetuating events of the
Revolution in such a manner.[64]
In the foregoing narrative I have endeavored to present a brief,
plain, and truthful story of the memorial at Tappaan, about which so
much has been said and written. I have fashioned it from
trustworthy materials. I have simply recorded the facts, and leave
the readers to form their own conclusions.
The monument at Tarrytown has been alluded to. It was erected in
1853, on the spot where tradition says Major André was captured, to
commemorate that event. It bore upon a tablet the following
inscription:
Monument and Statue at Tarrytown.
"On this spot, the 23d of September, 1780, the spy, Major John
André, Adjutant-General of the British Army, was captured by John
Paulding, David Williams, and Isaac Van Wart, all natives of this
county. History has told the rest.
"The people of Westchester County have erected this monument as
well to commemorate a great event as to testify their high
estimation of that integrity and patriotism which, rejecting every
temptation, rescued the United States from most imminent peril by
baffling the acts of a spy and the plots of a traitor. Dedicated
October 7, 1853."
The citizens of Westchester County, desirous of giving more
significance to this monument, caused its conical shaft to be
removed, and in its place erected a bronze statue of a captor—a
young volunteer soldier. This statue is the work of the accomplished
sculptor, Mr. O'Donovan, of New York.
The monument and statue were unveiled in the presence of
thousands of spectators on the centennial of the event
commemorated—the 23d of September, 1880. On that occasion
Samuel J. Tilden presided. A prayer was offered by the venerable
son of one of the captors, Isaac Van Wart, and an oration was
pronounced by Chauncey M. Depew. General James Husted was the
marshal of the day.
On one face of the monument is the old inscription, and upon
another, next to the highway, is a fine bronze bas-relief representing
the scene of the capture. This also is from the atelier of Mr.
O'Donovan. An excellent picture of this work of art and of the statue
may be found in the "Memorial Souvenir of the Monument
Association," prepared by Dr. Nathaniel C. Husted, secretary of the
association.

FOOTNOTES:
[56] The original drawing from which the engraving was made
was received from London in 1849 by the author of this little
work, together with a copy of a profile likeness of André—simply
the head and shoulders—said to have been drawn by himself.
[57] Upon a panel is the following inscription: "Sacred to the
memory of Major John André, who, raised to the rank of Adjutant-
General of the British Army in America, and employed in an
important and hazardous enterprise, fell a sacrifice to his zeal for
his king and country, on the 2d of October, a.d. 1780, eminently
beloved and esteemed by the army in which he served, and
lamented even by his foes. His gracious sovereign, King George
the Third, has caused this monument to be erected."

After the removal of André's remains to Westminster Abbey, as


mentioned in the text, the following inscription was cut upon the
base of the pedestal:
"The remains of Major John André were, on the 10th of August,
1821, removed from Tappaan by James Buchanan, Esq., his
Majesty's Consul at New York, under instructions from his Royal
Highness the Duke of York, and, with the permission of the Dean
and Chapter, finally deposited in a grave contiguous to this
monument on the 28th of November, 1821."
[58] It was chiefly through the liberality and personal influence of
Mr. Lee that the funds were raised for procuring the fine bronze
equestrian statue of Washington, by H.K. Brown, at Union Square,
New York. That was the first statue erected in the open air in that
city, and is not surpassed in artistic merit by any since set up
there.
[59] Mr. Whittemore had procured this identification fully six
months before the visit of Mr. Field and his guests, with the view
to have a memorial-stone placed upon the spot. He had consulted
with the owner of the land about it. The latter believed it would
enhance the value of his property, and favored the project.
[60] Above may be seen a fac-simile of the last paragraph of
Dean Stanley's letter.
[61] The letter of Mr. Field conveying his generous offer to the
New York Historical Society (September, 1880) was referred to
the Executive Committee. They warmly recommended its
favorable consideration by the society. In their report, referring to
the event commemorated by the memorial-stone at Tappaan, the
committee said it was an "event which, perhaps, more signally
than any other act of his life, illustrates the wisdom and firmness
of Washington under circumstances of peculiar trial, in which
even his devoted followers were disposed to question his
humanity, if not his justice, and almost to fall in with the
sentimental calumny of the day, which has been so often
reviewed and refuted as to become ridiculous. The memorial-
stone of André's execution is a monument to Washington."
[62] The engraving is from the original drawing of the architect.
Just below the inscription, at the bottom of the shaft, is cut
"Arthur Penrhyn Stanley, Dean of Westminster."
[63] It was ascertained that the perpetrator of the crime was a
"crank"—a printer, in the city of New York—who, after eluding the
officers of the law for some time, finally died.
[64] A petition addressed to the Governor of the State, asking
him to assist in an effort to discover the perpetrator of the crime,
was signed by a large number of the most respectable citizens of
Rockland County.
MONODY ON MAJOR ANDRÉ.

Anna Seward.
THE AUTHOR OF THE MONODY.
Anna Seward, the abiding friend and ever-faithful correspondent of
Major André until his death, was a daughter of Thomas Seward, the
canon-resident of Lichfield Cathedral. She was born at Eyam, in
Derbyshire, England, in 1747. Her education, superior to that of
most girls of her time, was superintended by her father, who was a
graduate of Oxford, a man of great moral worth, and noted for his
scholarship.
Miss Seward evinced a taste and a genius for poetic composition at a
very early age, and before she reached the period of young
womanhood she attracted the attention of local literary characters.
She became a great favorite of Dr. Samuel Johnson, who was a
native of Lichfield and was a frequent guest at the house of her
father. On one occasion, when she was about fourteen years of age,
she wrote a clever poetical address of welcome to Dr. Johnson,
which greatly pleased the recipient. Miss Seward is often incidentally
mentioned in Boswell's "Life of Johnson." Writing of a visit at Mr.
Seward's in 1775, when Anna was twenty-eight years of age,
Boswell, Johnson's shadow, says, "And now, for the first time, I had
the pleasure of seeing his celebrated daughter, Miss Anna Seward, to
whom I have since been indebted for many civilities."
Miss Seward's first acquaintance with young André, her interest in
his love-affair with Honora Sneyd, and her pleasant epistolary and
personal intercourse with him until his departure for America, have
been referred to in the early portions of the brief notice of that
young soldier's career contained in this volume. During his service in
America she was his constant correspondent; and she first informed
him of the death of Honora a short time before his own tragic exit
from earth.
The circumstances attending the death of her friend inspired Miss
Seward to write her most notable and most admired poem, "Monody
on Major André." She was then thirty-three years old. It was printed
for the author at Lichfield early in 1781. Being consonant in its
utterances with the feelings of the British public at that time, it had a
large sale, and produced a powerful sensation. She received
congratulatory letters from literary people and others in various parts
of the kingdom. No man was more delighted with it than was Dr.
Johnson, "the colossus of English literature."
Johnson was a fierce Tory, and hated the Americans with a spirit of
savage ferocity. On one occasion, while at Lichfield, he said, "I am
willing to love all mankind, excepting an American." He called them
"rascals," "robbers and pirates," and angrily exclaimed, "I'd burn and
destroy them!" Boswell says Miss Seward, who was present at this
outburst of passion, and whose feelings were favorable to the
American cause, boldly rebuked Johnson, saying, "Sir, this is an
instance that we are most violent against those we have most
injured." This delicate but keen reproach irritated Johnson still more,
and, says Boswell, "he roared out another tremendous volley, which
one might fancy could be heard across the Atlantic." But Johnson
and Anna Seward remained good friends until a short time before
the death of the former. They corresponded with each other, and
frequently met in social circles.
I have said Dr. Johnson was delighted by Miss Seward's "Monody."
He exhibited that delight in the most public manner by writing and
publishing in the "Gentleman's Magazine," over his own signature,
the following poetic epistle to the author:
"To Miss Seward, on her Monody on Major André:
"Above the frigid etiquette of form,
With the same animated feelings warm,
I come, fair maid, enamored of thy lays,
With tribute verse, to swell the note of praise.
Nor let the gentle Julia's[65] hand disclaim
The bold intrusion of an honest strain.
Nor is it mine alone—'tis the full voice
Of such as honor with no vulgar choice,[66]
Of such as feel each glowing line along
Once the bright subject of an humble song.[67]
The treasures of the female heart make known
By copying the soft movements of her own.
Woman should walk arrayed in her own robe,
The hope, the boast, the blessing of the globe.
"Shrewsbury. S. Johnson."
Miss Seward's "Monody" was dedicated to Sir Henry Clinton. To it
were appended three letters written to her by young André
immediately after his betrothal to and personal separation from
Honora Sneyd. These I have appended to the "Monody," The printed
copy of that poem, before me, bears the autograph signature of
Anna Seward at the end.
It was not long after Johnson's poetical epistle to the author of the
"Monody" appeared before an interruption of the goodly feeling
between him and his fair friend occurred. In 1782 Johnson's "Lives
of the British Poets" appeared, in which he severely criticised the
poetry of her cherished friend Thomas Hayley. Ever ready and
prompt to defend heroically those she had learned to esteem, she
instantly took fire at the attack, and she wrote letters to her friends
which were far from complimentary to Johnson. To Hayley she
wrote:
"You have seen Dr. Johnson's 'Lives of the Poets.' They have excited
your generous indignation. A heart like Hayley's would shrink
astonished to perceive a mind so enriched with the power of genius
capable of such cool malignity. Yet the 'Gentleman's Magazine'
praised these unworthy efforts to blight the laurels of undoubted
fame. Oh, that the venom may fall where it ought!"
Animadversions by Miss Seward more severe than this found their
way, without her consent, into the public prints, and deeply offended
Dr. Johnson. The breach thus made was never healed. Miss Seward
refused to retract a word, but persisted in her utterances.
Sometimes, even after the death of Dr. Johnson, in 1784, they were
spiced with attacks upon his personal character. These attacks drew
from Boswell a defense of his dead friend, whom he almost adored,
and in 1793 he and Miss Seward carried on a spirited controversy in
the "Gentleman's Magazine."
Miss Seward's writings in verse and prose were quite voluminous.
The latter, consisting of her literary correspondence from 1784 to
1807, was published in six volumes in the latter year. Her poetical
works, with extracts from her literary correspondence, edited by Sir
Walter Scott, were published in three volumes in 1810. Next to her
"Monody," in point of excellence and popularity, was her "Elegy on
Captain James Cook," the famous circumnavigator of the globe. Of
this performance Sir Walter Scott said, "It conveyed a high
impression of the original power of the author."
The literary fame of Anna Seward has not been enduring, and she,
who was a conspicuous figure in the world of letters in England
during the last quarter of the eighteenth century, is now almost
forgotten. Her known social relations to Major André, and her
"Monody," have perpetuated her memory in the minds of Americans.
It is said that, when she was fully informed of all the circumstances
connected with the death of André, she was satisfied that she had
been unjust toward Washington in her animadversions upon his
character in her poem, and expressed a regret that she had so
misjudged him.
Miss Seward, in a letter to her friend Miss Ponsonby, related that
several years after the peace a friend of Washington's, an American
officer, introduced himself to her (Miss Seward), saying he was
commissioned by General Washington to call upon her and assure
her that no circumstance of his life had been so mortifying as to be
censured in the "Monody" on André as the pitiless author of his
ignominious fate; that he had labored to save him; and that he
requested his friend to leave with Miss Seward a package of papers
which he had sent, consisting of copies of the records of the court-
martial, etc. "The American officer referred to," says Sargent, "is
supposed to have been Colonel Humphreys."
Various opinions have been expressed concerning the writings of
Miss Seward. The literary circle of Lichfield, of which she was the
central figure, appears to have been a mutual-admiration society.
The productions of each member appear to have been eulogized by
every other member. Her friend, the celebrated Dr. Erasmus Darwin,
declared that she was "the inventress of epic elegy"; the eccentric
philosopher Day called her a "prodigy of genius"; while the wits of
London gently ridiculed the pretensions of the literary Lichfieldians.
Horace Walpole wrote: "Misses Seward and Williams, and a half a
dozen more of these harmonious virgins, have no imagination, no
novelty. Their thoughts and phrases are like their gowns—old
remnants cut and turned." The Rev. Alexander Dyce wrote: "She was
endowed with considerable genius, and with an ample portion of
that fine enthusiasm which sometimes may be taken for it; but her
taste was far from good, and her numerous productions (a few
excepted) are disfigured by florid ornament and elaborate
magnificence."
After Miss Seward's death, in 1809, there was published a small
volume with the title of "The Beauties of Anna Seward." She died a
maiden. The portrait preceding this brief memoir is a carefully drawn
copy with pen and ink of an engraving by A. Carden, from the
original picture painted in 1763, when she was sixteen years of age,
by Tilly Kettle, an English portrait-painter of note, who was then only
about twenty-three years of age.

FOOTNOTES:
[65] André in his correspondence with Miss Seward on the topic
of Honora addressed her as "Julia."
[66] A reading society at Shrewsbury is here alluded to.
[67] Alluding to an "Essay on Woman," written by Johnson.
MONODY

ON

MAJOR ANDRÉ.

By Miss SEWARD,

(AUTHOR OF THE ELEGY ON CAPTAIN COOK.)

TO WHICH ARE ADDED


LETTERS ADDRESSED TO HER
By MAJOR ANDRÉ,
IN THE YEAR 1769.

LICHFIELD:

PRINTED AND SOLD BY J. JACKSON, FOR THE AUTHOR;


SOLD ALSO BY ROBINSON, PATER-NOSTER ROW; CADELL AND EVANS, IN THE
STRAND, LONDON; PRINCE, OXFORD; MERRILL, CAMBRIDGE;
AND PRATT AND CLINCH, BATH.

M.DCC.LXXXI.

[Price, Two-Shillings-and-Six-Pence.]
TO

HIS EXCELLENCY,

SIR HENRY CLINTON,

KNIGHT OF THE BATH.

Sir: With the zeal of a religious Enthusiast to his murdered


Saint, the Author of this mournful Eulogium consecrates it
to the Memory of Major André, who fell a Martyr in the
Cause of his King and Country, with the firm Intrepidity of
a Roman, and the amiable Resignation of a Christian Hero.
Distant Awe and Reverence prevent her offering these
Effusions of Gratitude to the Beneficent and Royal Patron
of the André Family. May Mr. André's illustrious General,
the Guardian of his injured Honour, his conspicuous and
personal Friend, deign to accept them from One who was
once happy in the Friendship of the Glorious Sufferer.
Your Excellency's
Most obedient humble Servant,
Anna Seward.
MONODY
ON

MAJOR ANDRÉ.
Loud howls the storm! the vex'd Atlantic roars!
Thy Genius, Britain, wanders on its shores!
Hears cries of horror, wafted from afar,
And groans of Anguish, mid the shrieks of War!
Hears the deep curses of the Great and Brave,
Sigh in the wind, and murmur on the wave!
O'er his damp brow the sable crape he binds,
And throws his victor-garland[68] to the winds;
Bids haggard Winter, in her drear sojourn,
Tear the dim foliage from her drizzling urn;
With sickly yew unfragrant cypress twine,
And hang the dusky wreath round Honour's
shrine.
Bids steel-clad valour chace his dove-like Bride,
Enfeebling Mercy, from his awful side;
Where long she sat, and check'd the ardent rein,
As whirl'd his chariot o'er th' embattled plain;
Gilded with sunny smile her April tear,
Rais'd her white arm and stay'd th' uplifted
spear;
Then, in her place, bid Vengeance mount the car,
And glut with gore th' insatiate Dogs of War!—
With one pale hand the bloody scroll[69] he
rears,
And bids his nations blot it with their tears;
And one, extended o'er th' Atlantic wave,
Points to his André's ignominious grave!

And shall the Muse, that marks the solemn


scene,
"As busy Fancy lifts the veil between,"
Refuse to mingle in the awful train,
Nor breathe with glowing zeal the votive strain?
From public fame shall admiration fire
The boldest numbers of her raptur'd lyre
To hymn a Stranger?—and with ardent lay
Lead the wild mourner round her Cook's morai,
While André fades upon his dreary bier,
And Julia's[70] only tribute is her tear?
Dear, lovely Youth! whose gentle virtues stole
Thro' Friendship's soft'ning medium on her soul!
Ah no!—with every strong resistless plea,
Rise the recorded days she pass'd with thee,
While each dim shadow of o'erwhelming years,
With Eagle-glance reverted, Mem'ry clears.

Belov'd companion of the fairest hours


That rose for her in joy's resplendent bow'rs,
How gaily shone on thy bright Morn of Youth
The Star of Pleasure, and the Sun of Truth!
Full from their Source descended on thy mind
Each gen'rous virtue, and each taste refin'd.
Young Genius led thee to his varied fane,
Bade thee ask[71] all his gifts, nor ask in vain;
Hence novel thoughts, in ev'ry lustre drest
Of pointed wit, that diamond of the breast;
Hence glow'd thy fancy with poetic ray,
Hence music warbled in thy sprightly lay;
And hence thy pencil, with his colours warm,
Caught ev'ry grace, and copied ev'ry charm,
Whose transient glories beam on Beauty's cheek,
And bid the glowing Ivory breathe and speak.
Blest pencil! by kind Fate ordain'd to save
Honora's semblance from[72]her early grave,
Oh! while on[73]Julia's arm it sweetly smiles,
And each lorn thought, each long regret
beguiles,
Fondly she weeps the hand, which form'd the
spell,
Now shroudless mould'ring in its earthy cell!

But sure the Youth, whose ill-starr'd passion


strove
With all the pangs of inauspicious Love,
Full oft' deplor'd the Fatal Art, that stole
The jocund freedom of its Master's soul!
While with nice hand he mark'd the living grace,
And matchless sweetness of Honora's face,
Th' enamour'd Youth the faithful traces blest,
That barb'd the dart of Beauty in his breast;
Around his neck th' enchanting Portrait hung,
While a warm vow burst ardent from his tongue,
That from his bosom no succeeding day,
No chance should bear that Talisman away.
'Twas thus[74]Apelles bask'd in Beauty's blaze,
And felt the mischief of the steadfast gaze;
Trac'd with disorder'd hand Campaspe's charms,
And as their beams the kindling Canvas warms,
Triumphant Love, with still superior art,
Engraves their wonders on the Painter's heart.

Dear lost Companion! ever-constant Youth!


That Fate had smil'd propitious on thy Truth!
Nor bound th' ensanguin'd laurel on that brow
Where Love ordain'd his brightest wreath to
glow!
Then Peace had led thee to her softest bow'rs,
And Hymen strew'd thy path with all his flow'rs;
Drawn to thy roof, by Friendship's silver cord,
Each social Joy had brighten'd at thy board;
Science, and soft Affection's blended rays
Had shone unclouded on thy lengthen'd days;
From hour to hour thy taste, with conscious
pride,
Had mark'd new talents in thy lovely Bride;
Till thou hadst own'd the magic of her face
Thy fair Honora's least engaging grace.
Dear lost Honora! o'er thy early bier
Sorrowing the Muse still sheds her sacred tear!
The blushing Rose-bud in its vernal bed,
By Zephyrs fann'd, by glist'ring Dew-drops fed,
In June's gay morn that scents the ambient air,
Was not more sweet, more innocent or fair.
Oh! when such Pairs their kindred Spirit find,
When Sense and Virtue deck each spotless Mind,
Hard is the doom that shall the union break,
And Fate's dark billow rises o'er the wreck.

Now Prudence, in her cold and thrifty care,


Frown'd on the Maid, and bade the Youth
despair,
For Pow'r Parental sternly saw, and strove
To tear the lily-bands of plighted love;
Nor strove in vain;—but while the Fair-One's
sighs
Disperse, like April storms in sunny skies,
The firmer Lover, with unswerving truth,
To his first passion consecrates his Youth;
Tho' four long years a night of absence prove,
Yet Hope's soft Star shone trembling on his Love;
Till[75]hov'ring Rumour chas'd the pleasing
dream
And veil'd with Raven-wing the silver beam.
"Honora lost! my happy Rival's Bride!
"Swell ye full Sails! and roll thou mighty Tide!
"O'er the dark Waves forsaken André bear
"Amid the vollying Thunders of the War!
"To win bright Glory from my Country's foes,
"E'en in this ice of Love, my bosom glows.
"Voluptuous London! in whose gorgeous bow'rs
"The frolic Pleasures lead the dancing Hours,
"From Orient-vales Sabean-odours bring,
"Nor ask her roses of the tardy Spring;
"Where Paintings burn the Grecian Meed to claim
"From the high Temple of immortal Fame,
"Bears to the radiant Goal, with ardent pace,
"Her Kauffman's Beauty, and her Reynolds'
Grace;
"Where Music floats the glitt'ring roofs among,
"And with meand'ring cadence swells the Song,
"While sun-clad Poesy the Bard inspires,
"And foils the Grecian Harps, the Latian Lyres.

"Ye soft'ning Luxuries! ye polish'd Arts!


"Bend your enfeebling rays on tranquil Hearts!
"I quit the Song, the Pencil, and the Lyre,
"White robes of Peace, and Pleasure's soft Attire,
"To seize the Sword, to mount the rapid Car,
"In all the proud habiliments of War.—
"Honora lost! I woo a sterner Bride,
"The arm'd Bellona calls me to her side;
"Harsh is the music of our marriage strain!
"It breathes in thunder from the Western plain!
"Wide o'er the wat'ry world its echoes roll,
"And rouse each latent ardour of my soul.
"And tho' unlike the soft melodious lay,
"That gaily wak'd Honora's nuptial day,
"Its deeper tones shall whisper, e'er they cease,
"More genuine transport, and more lasting
peace!

"Resolv'd I go!—nor from that fatal bourne


"To these gay scenes shall André's step return!
"Set is the Star of Love, that ought to guide
"His refluent Bark across the mighty Tide!—
"But while my Country's Foes, with impious hand,
"Hurl o'er the blasted plains the livid brand
"Of dire Sedition!—Oh! let Heav'n ordain,
"While André lives, he may not live in vain!

"Yet without one kind farewell, could I roam


"Far from my weeping Friends, my peaceful
home,
"The best affections of my heart must cease,
"And gratitude be lost, with hope, and peace!
My lovely Sisters! who were wont to twine
"Your Souls' soft feeling with each wish of mine,
"Shall, when this breast beats high at Glory's call,
"From your mild eyes the show'rs of Sorrow fall?

"The light of Excellence, that round you glows,
"Decks with reflected beam your Brother's brows.
"Oh! may his Fame, in some distinguish'd day,
"Pour on that Excellence the brightest ray!
"Dim clouds of woe! ye veil each sprightly grace
"That us'd to sparkle in Maria's face.—
"My[76]tuneful Anna to her lute complains,
"But Grief's fond throbs arrest the parting strains.

"Fair as the silver blossom on the thorn,
"Soft as the spirit of the vernal morn,
"Louisa, chace those trembling fears, that prove
"Th' ungovern'd terrors of a Sister's love.
"They bend thy sweet head, like yon lucid flow'r,
"That shrinks and fades beneath the summer's
show'r—
"Oh! smile, my Sisters, on this destin'd day,
"And with the radiant omen gild my way!
"And thou, my Brother, gentle as the gale,
"Whose breath perfumes anew the blossom'd
vale,
"Yet quick of Spirit, as th' electric beam,
"When from the clouds its darting lightnings
stream,
"Soothe with incessant care our Mother's woes,
"And hush her anxious sighs to soft repose.—
"And be ye sure, when distant far I stray
"To share the dangers of the arduous day,
"Your tender faithful amity shall rest
"The[77] last dear record of my grateful breast.

"Oh! graceful Priestess at the fane of Truth,


"Friend of my Soul! and Guardian of my Youth!
"Skill'd to convert the duty to the choice,
"My gentle Mother!—in whose melting voice
"The virtuous precept, that perpetual flow'd,
"With music warbled, and with beauty glow'd,
"Thy Tears!—ah Heav'n!—not drops of molten
lead,
"Pour'd on thy hapless Son's devoted head,
"With keener smart had each sensation torn!—
"They wake the nerve where agonies are born!
"But oh! restrain me not!—thy tender strife,
"What wou'd it save?—alas!—thy André's life!
"Oh! what a weary pilgrimage 'twill prove
"Strew'd with the thorns of disappointed Love!
"Ne'er can he break the charm, whose fond
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like