
- 370 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
eBook - ePub
About this book
After the fundamental volume and the advanced technique volume, this volume focuses on R applications in the quantitative investment area. Quantitative investment has been hot for some years, and there are more and more startups working on it, combined with many other internet communities and business models. R is widely used in this area, and can be a very powerful tool. The author introduces R applications with cases from his own startup, covering topics like portfolio optimization and risk management.
Frequently asked questions
Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
- Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
- Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access R for Programmers by Dan Zhang in PDF and/or ePUB format, as well as other popular books in Business & Information Technology. We have over one million books available in our catalogue for you to explore.
Information
III
FINANCIAL STRATEGY PRACTICE
Chapter 5
Bonds and Repurchase
There are not only stocks in the great financial market, but also bonds, which take a large part of the market. In this chapter, we will focus on how to use R language to analyze bonds and make bond investments and arbitrages. The low-risk bond investment can be a better choice of investment and financing.
5.1 Treasury Bonds
Question
How do you trade treasury bonds?

Introduction
Treasury bonds are based on the national credit and it sets the benchmark interest rate for various market economy pricings. We need to have knowledge of treasury bonds to understand the policies and the market.
Recently, I have read a book titled China is a History of Finance (《中国是部金融史》). It approaches the falls and rises of more than 2,000 years’ feudal dynasty in China from the perspective of finance. In the history of China, wars were started again and again, which cost a lot. At that time, the treasury bond of western finance had not been introduced yet. The feudal government accumulated wealth by producing new coins or increasing the issuance of old coins, which caused inflations of 200%–2,000%. People were robbed of their wealth. If the feudal dynasty could be a little merciful, issuing treasury bonds, paying their people back in due time, and giving some hope to them, the history may be completely different.
5.1.1 A Basic Introduction to Treasury Bonds
Treasury bond is a debtor-creditor relationship formed when a country, based on its credit, raises funds from the public according to the general principle of debts. A treasury bond is a government debt issued by the central government to raise financial funds. It is a certificate of credit rights and indebtedness provided by the central government to the investors, where the government promises to pay the interests at stated periods and pay the principal at its maturity. For its issuer is a country, it is of the highest credit level and it is recognized as the safest investment instrument.
Treasury bond is the main form of national credit. The central government issues treasury bonds usually with the purpose of making up the national fiscal deficit, or raising funds for some costly construction projects, some special economic policies or even for wars. A treasury bond is secured by the tax income of the central government, so it is of low risk and high liquidity, but it bears a lower interest rate than other bonds.
The interest rate of treasury bond is the benchmark interest rate in the capital market, while the bank savings deposit cannot function as this credit instrument. Issued by the central government, a treasury bond is a credit certificate only next to currency and it nearly functions as quasi-money. Due to its best cashability and its most convenience, the interest rate of treasury bond is the lowest. Therefore, it objectively functions as the benchmark. In the capital asset pricing model (CAPM), the riskless return is converted by the interest rate if short-term treasury bond.
The regulated market operations in capital market should keep the position of the treasury bond interest rate as the benchmark. Those market credit relations that harm the benchmark position of treasury bond should be nonstandard. And the bank saving deposit does not have this credit function of treasury bond. On the premise of the treasury bond’s existence, if the credit relationship of the financial market is not twisted, the interest rate of bank saving deposit should not and is not allowed to become the benchmark interest rate. In reality, it will be uncommon if the interest rate of treasury bond is higher than that of the bank saving deposit.
Next we will draw a plot of a 1-year bond and a 1-year fixed term deposit, for an intuitive comparison. Export the data of 2002–2015 from Wind. The data format is as follow:
2002-01-04,2.5850, 2002-01-07,2.6009, 2002-01-08,1.9156, 2002-01-09,1.9040, 2002-01-10,1.8987, 2002-01-11,1.8757, 2002-01-14,1.6794, 2002-01-15,1.7265, 2002-01-16,1.7403, 2002-01-17,1.7165,
There are three columns of the data:



The system environment used here:


Let’s draw a plot with R language.
# Load the class library > library(xts) > library(ggplot2) # Read data from bondSaving.csv > bs<-read.csv("bondSaving.csv",header=TRUE) # Re-define the column names: bond for treasury bond and saving for deposit > names(bs)<-c("date","bond","saving") # Converted to time series format > bsxts<-xts(bs[-1],order.by = as.Date(bs$date)) # The null value is filled backward > bsxts<-na.locf(bsxts,fromLast=FALSE) # Draw a plot as shown in Figure 5-1 > g<-ggplot(aes(x=Index, y=Value, colour=Series),data=fortify(bsxts,melt= TRUE)) > g<-g+geom_line() > g In Figure 5.1, the x-axis means time and y-axis the value of interest rate. Let’s compare the yields of the 1-year bond upon maturity and the 1-year saving from 2002 to 2015. The steep curve (bond) is the ChinaBond Treasury Bond Yield Upon Maturity, while the flat curve (saving) is the 1-year fixed term deposit issued by People’s Bank of China. For most of the time, the interest rate of treasury bond is higher than the deposit. Why is so? To find the answer, we need to get a more profound understanding of China’s economy.
5.1.2 Significance of Treasury Bonds
5.1.2.1 The Necessity to Issue Treasury Bonds
5.1.2.1.1 To cover military spending
During war times, the military spending is massive, so treasury bonds will be issued to raise funds for war if there is no other way. Treasury bond for military spending is a common way for every government to raise funds during war, which is also the origin of treasury bonds.

Figure 5.1 1-Year bond and 1-year fixed term deposit.
In ancient China, to raise funds for military spending, the government did not issue bonds, but currency.
5.1.2.1.2 To balance fiscal revenue and expenditure
Usually, fiscal revenue and expenditure can be balanced by increasing tax revenues, increasing currency issuance or issuing treasury bonds.
Increasing tax revenues: Taxes are collected from people and spent on people, which is surely a good way. However, if the taxes surpass certain limits and they go beyond what enterprises and individuals can bear, it will harm the production development and thus the future tax income.
Increasing currency issuance: This is the simplest way, but also the worst way, because it will lead to serious inflation, which will severely impact the economy.
When it is difficult to increase taxes and we do not adopt currency issuance increasing, it can be a possible measure to issue treasury bonds to make up the fiscal deficit. Governments can collect idle money from organizations and individuals by issuing bonds, so as to help their countries through the tough financially difficult times. However, the treasury bonds for deficit covering must be issued in a moderate volume; otherwise, it may result in severe deflation.
5.1.2.1.3 To raise funds for constructions
When the government needs large amounts of mid-term and long-term funds to construct the infrastructure and the public facilities, it will issue treasury bonds of mid-term or long-term, which will help convert part of the short-term funds to the mid-term or long-term funds for the large-scale construction projects of the country, so as to stimulate its economy development.
5.1.2.1.4 To pay the treasury bonds at maturity
When there is a treasury bond at maturity, the government may issue a new treasury bond to raise fund and pay the debt for the previous bond. This can reduce and diffuse the debt burden of the country at the peak of debt payment.
5.1.2.2 Classification of Treasury Bonds
By the forms of bonds, the treasury bonds issued in China can be classified into three types: certificate treasury bonds, physical treasury bonds and book-entry treasury bonds.


Table of contents
- Cover
- Half Title
- Title Page
- Copyright Page
- Table of Contents
- Foreword
- Preface
- Acknowledgments
- Author
- SECTION I FINANCIAL MARKET AND FINANCIAL THEORY
- SECTION II DATA PROCESSING AND HIGH PERFORMANCE COMPUTING OF R
- SECTION III FINANCIAL STRATEGY PRACTICE
- Epilogue
- Appendix: Docker Installation in Ubuntu
- Index