This edition first published 2017

© 2017 John Wiley & Sons, Inc.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, except as permitted by law. Advice on how to obtain permission to reuse material from this title is available at http://www.wiley.com/go/permissions.

The right of Bertram K C Chan to be identified as the author(s) of this work has been asserted in accordance with law.

*Registered Offices*

John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, USA

*Editorial Office*

111 River Street, Hoboken, NJ 07030, USA

For details of our global editorial offices, customer services, and more information about Wiley products visit us at www.wiley.com.

Wiley also publishes its books in a variety of electronic formats and by print-on-demand. Some content that appears in standard print versions of this book may not be available in other formats.

*Limit of Liability/Disclaimer of Warranty*

The publisher and the authors make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties; including without limitation any implied warranties of fitness for a particular purpose. This work is sold with the understanding that the publisher is not engaged in rendering professional services. The advice and strategies contained herein may not be suitable for every situation. In view of on-going research, equipment modifications, changes in governmental regulations, and the constant flow of information relating to the use of experimental reagents, equipment, and devices, the reader is urged to review and evaluate the information provided in the package insert or instructions for each chemical, piece of equipment, reagent, or device for, among other things, any changes in the instructions or indication of usage and for added warnings and precautions. The fact that an organization or website is referred to in this work as a citation and/or potential source of further information does not mean that the author or the publisher endorses the information the organization or website may provide or recommendations it may make. Further, readers should be aware that websites listed in this work may have changed or disappeared between when this works was written and when it is read. No warranty may be created or extended by any promotional statements for this work. Neither the publisher nor the author shall be liable for any damages arising here from.

*Library of Congress Cataloguing-in-Publication Data*

*Names*: Chan, B. K. C. (Bertram Kim-Cheong), author.Title: Applied probabilistic calculus for financial engineering : an introduction using R / by Bertram K.C. Chan.Description: Hoboken, NJ : John Wiley & Sons, Inc., 2017. | Includes bibliographical references and index. | Identifiers: LCCN 2017024496 (print) | LCCN 2017037530 (ebook) | ISBN 9781119388081 (pdf) | ISBN 9781119388043 (epub) | ISBN 9781119387619 (cloth)Subjects: LCSH: Financial engineering–Mathematical models. | Probabilities. | Calculus. | R (Computer program language)Classification: LCC HG176.7 (ebook) | LCC HG176.7 .C43 2017 (print) | DDC 332.01/5192–dc23LC record available at https://lccn.loc.gov/2017024496

Cover image: (Top Image) © kWaiGon/Gettyimages; (Bottom Image) © da-kuk/Gettyimages

*Dedicated to the glory of God and to my better half*

*Marie Nashed Yacoub Chan*

*The Financial Challenges and Experience of a Typical Retiring Couple – Mr. and Mrs. Smith* (not their real name)

About 10 years ago, after a lifetime of steady work for some 40 years, Mr. John A. Smith and Mrs. Mary B. Smith of California were preparing for a life of active retirement, including extensive traveling worldwide. To take care of their future financial needs, they had decided to obtain the services of a local professional financial engineering and investment management company – XYZ (fictitious) – of California that conducts its transactions through a large national financial engineering corporation: LPL (Linsco – 1968 and Private Ledger – 1973).

To that end, Mr. and Mrs. Smith invested a sum of approximately $2,000,000 from their life savings, with the following twin goals:

- The preservation of their capital of $2 M
- Receiving a regular net monthly cash income of at least $10,000 from XYZ

Thus, if the original capital of $2 M were to be preserved (approximately unchanged), as well as to maintain a steady withdrawal of $10,000 per month, the average annual return of the investment of the $2 M will have to be on the order of (10,000 × 12)/2,000,000 = 0.06, or 6%.

The financial services management typically charges fees on the order of 1.5%. Thus, a rough estimate that the financial management should achieve would be on the order of 6% + 1.5%, or 7.5%.

How does a service such as XYZ/LPL achieve such a goal?

Approximately 10 years after their retirement, on Tuesday, November 15, 2016, the financial markets closed at

Dow (DJIA) | 18,923.06/+54.03/+0.29% |

Nasdaq | 5,275.62/+57.22/+1.10% |

S&P 500 | 2,180.39/+16.19/+ 0.75% |

Gold | $1,229.00 per oz +0.37% |

Over these 10 years, Mr. and Mrs. Smith had been receiving regularly a monthly payout from XYZ/LPL of $10,947.03! And, on the same day, the net balance of their portfolio investment account is as follows:

In other words, the balance at the end of that day stood at approximately $2.1 M! And the total payout received over these past 10 years comes to $10,947.03 per month or $10,947.03 × 12 = $131,364.36 per annum or $131,364.36 × 10 = $1,313,643.60 over the past decade!

Exclusive of the financial management at 1.5%! How can such an investment management be achieved? Indeed, that is the central theme of this book:

- The challenge in financial engineering

Whereas the nominal saving accounts of banks and credit unions in the United States have been paying at 0.1% to about 1.0%, how does a financial manager allocate the managed funds to generate, and sustain, an average return of about 7.5%? This is a typical simple example in Assets Allocation and Portfolio Optimization in Financial Engineering. It is the objective of this book to consider the underlying mathematical principles in meeting this challenge – in terms of Assets Allocation and Portfolio Optimization in Financial Engineering. This introductory text in financial engineering will include the use of the well-known and popular computer language R. Numerical worked examples are provided to illustrate the practical application of Applied Probabilistic Calculus in Financial Engineering leading to practical results in assets allocation and portfolio optimization in financial engineering using R.

This book is accompanied by a companion website:

- www.wiley.com/go/chan/appliedprobabilisticcalculus
The website includes:

- Solutions to all the exercises in the body of the text, with some supportive comments

Introduction to Financial Engineering

In today's understanding and everyday usage, *financial engineering* is a multidisciplinary field in finance, and in theoretical and practical economics involving financial theory, the tools of applied mathematics and statistics, the methodologies of engineering, and the practice of computer programming. It also involves the application of technical methods, especially in mathematical and computational finance in the practice of financial investment and management.

However, despite its name, financial engineering does *not* belong to any of the traditional engineering fields even though many financial engineers may have engineering backgrounds. Some universities offer a postgraduate degree in the field of financial engineering requiring applicants to have a background in engineering. In the United States, ABET (the Accreditation Board for Engineering and Technology) does *not* accredit financial engineering degrees. In the United States, financial engineering programs are accredited by the International Association of Quantitative Finance.

Financial engineering uses tools from economics, mathematics, statistics, and computer science. Broadly speaking, one who uses technical tools in finance may be called a financial engineer: for example, a statistician in a bank or a computer programmer in a government economic bureau. However, most practitioners restrict this term to someone educated in the full range of tools of modern finance and whose work is informed by financial theory. It may be restricted to cover only those originating new financial products and strategies. Financial engineering plays a critical role in the customer-driven derivatives business that includes quantitative modeling and programming, trading, and risk managing derivative products in compliance with applicable legal regulations.

A broader term that covers anyone using mathematics for practical financial investment purposes is “Quant”, which includes financial engineers.

The wide use of the open-source computer software R testifies to its versatility and its concomitant increasing popularity, bearing in mind that the ubiquitous application of R is most probably due to its suitability for personal mobile-friendly desktop/laptop/panel/tablet/device computer usage. The Venn diagram that follows illustrates the interactional relationship in this context.Three subjects enunciated in this book are as follows:

*Applied probabilistic calculus*(APC)*Assets allocation and portfolio optimization in financial engineering*(AAPOFE)*The computer language*(R)

The concomitant relationship may be graphically illustrated by the mutually intersecting relationships in the following Venn diagram, **APC** ∩ **AAPOFE** ∩ R.

Thus, this book is concerned with the distinctive subjects of importance and relevance within these areas of interest, including *Applied Probabilistic Calculus and Assets Allocation and Portfolio Optimization in Financial Engineering*, namely, **APC** ∩ **FE**, to be followed by critical areas of the computational and numerical aspects of *Applied Probabilistic Calculus for (Assets Allocation and Portfolio Optimization in) Financial Engineering: An Introduction Using* R, namely, **APC ∩ FE ∩** R. This is represented by the “red” area in Figure 1.1, being the common area of mutual intersection of the three areas of special interest.

In the case of the investment of Mr. and Mrs. Smith (as introduced in the Preface of this book), financial engineering by the investment management company XYZ established a portfolio consisting of four accounts:

**Account 1: A Family Trust**

- $648,857.13 (change for the day: +$150.75, +0.02%) 30.73% of Portfolio

**Account 2: Individuals Trust**

- $504,669.30 (change for the day: +3,710.04, +0.74%)

**Account 3: Traditional IRA for Person A**

- $476,096.53 (change for the day: $2,002.22, +0.42%)

**Account 4: Traditional IRA for Person B**

- $457,502.17 (change for the day: $142.00, +0.03%)

The positions of these accounts are as follows:

Account 1: | A. | Cash and cash equivalents $626,331.02 (97.58%) |

B. | Equities and options $15,839.25 (2.42%) | |

Account 2: | A. | Common stock – equities and options (22.71%) |

B. | Money market – cash and cash equivalents (55.22%) | |

C. | Mutual fund, ETFs, and closed-end funds (22.07%) | |

Account 3: | A. | Cash and cash equivalent $247,467.33 (52.2%) |

B. | Equities and options (3.42%) | |

C. | Money market sweeps $247,467.33 (44.38%) | |

Deposit cash account $247,447.91, account dividend 19.42 | ||

Account 4: | A. | Cash and cash equivalents (93.65%) |

B. | Mutual funds, ETPs, and closed-end funds (44.38%) |

At 11:30 p.m., Tuesday, November 15, 2016: the Smiths' account balance = $2,100,661.36 9

The dynamics and volatility of the financial market is well known.

For example, consider the Chicago Board of Options Exchange (CBOE) index:

CBOE Volatility Index®: Chicago Board Options Exchange index (symbol: VIX®) is the index that shows the market's expectation of 30-day volatility. It is constructed using the implied volatilities of a wide range of S&P 500 index options. This volatility is meant to be forward looking, is calculated from both calls and puts, and is a widely used measure of market risk, often referred to as the “investor fear gauge.”

The VIX volatility methodology is the property of CBOE, which is not affiliated with Janus.

Clearly, Figure 1.2 reflects the dynamic nature of a typical stock market over the past 20 years. One wonders if a rational financial engineering approach may be developed to sustain the two objectives at hand simultaneously:

- To maintain a steady level of investment
- To produce a steady income for the investors

The remainder of this book will provide rational approaches to achieve these joint goals.

Let us first examine the results of this investment opportunity, as seen over the past 10 years approximately.

*Investment Results of the XYZ–LPL* (Linsco (1968) and Private Ledger (1973)) is illustrated as follows:

*LPL Financial Holdings* (commonly referred to as *LPL Financial*) is the largest independent broker-dealer in the United States. The company has more than 14,000 financial advisors, over $500 billion in advisory and brokerage assets, and generated approximately $4.3 billion in annual revenue for the 2015 fiscal year. LPL Financial was formed in 1989 through the merger of two brokerage firms – Linsco (established in 1968) and Private Ledger (established in 1973) – and has since expanded its number of independent financial advisors both organically and through acquisitions. LPL Financial has main offices in Boston, Charlotte, and San Diego. Approximately 3500 employees support financial institutions, advisors, and technology, custody, and clearing service subscribers with enabling technology, comprehensive clearing and compliance services, practice management programs and training, and independent research.

LPL Financial advisors help clients with a number of financial services, including equities, bonds, mutual funds, annuities, insurance, and fee-based programs. LPL Financial does not develop its own investment products, enabling the firm's investment professionals to offer financial advice free from broker/dealer-inspired conflicts of interest.

- Revenue: US$4.37 billion (2014)
- Headquarters: 75 State Street, Boston, MA, USA
- Traded as: NASDAQ: LPLA (https://en.wikipedia.org/wiki/LPL_Financial)

Over the past 10 years, the Smiths' received, on a monthly basis, a net income of $10,947.03. Thus, annually, the income has been

And, the total income for the past 10 years has been

Illustrated hereunder in Figure 1.3 is a snapshot of one of the four investment accounts of the Smiths'. Note the following special features of this portfolio:

- The green area represents the investment amount: As portions of the capital were being periodically withdrawn (to satisfy U.S.A. Federal Regulations), the actual investment amount decreases in time. This loss has been more than made up by the blue area!
- The blue area is the portfolio value of the account.

This showed that, as steady income is being generated, the portfolio value grows ** more** than the amounts continually withdrawn –

Clearly, the goals of the investment have been achieved!

While the exact algorithms used by XYZ/LPL is proprietary, the following investment strategies are clear:

- Have each investment account placed in high-yield corporate bonds, and then SET a maximum limit of 3% draw down (loss) limit for each investment account.
- If draw down > limit of 3%, then move investment account over to cash or money market accounts – to preserve the overall capital of the portfolio.
- Stay in the cash or money market accounts, until the following three conditions of the market become available before returning to the high-yield corporate bonds where opportunity becomes available once again:
- Favorable conditions have returned – when comparing high-yield corporate bonds and the interest rates of 10-year Treasury notes, namely, when condition favoring the relative interest rates of money.
- Favorable conditions have returned – when comparing the volumes of money entering and leaving the market, namely, whether investors are “Pulling Back.”
- When the direction of the market becomes clear.

It certain does not escape ones attentions that these set of conditions are rather tenuous, at best.

One should, therefore, seek more robust paths to follow.

*Modern portfolio theory* **(** MPT **)**, also known as *mean-variance analysis*, is an algorithm for building a portfolio of assets such that *the expected return is maximized for a given level of risk*, defined as variance. Its key feature is that an asset's risk and return should not be assessed by itself, *but by how it contributes to a portfolio's overall risk and return*.

(Economist Harry Markowitz introduced MPT in a 1952 paper for which he was later awarded a Nobel Memorial Prize in Economic Science!)

In MPT, it is assumed that investors are *risk averse*, namely, if there exist two portfolios that offer the same expected return, rational investors will prefer the less risky one. Thus, an investor will accept increased risk only if compensated by higher expected returns. Conversely, an investor who wants higher expected returns must accept more risk. That is,

(1.1)

It is reasonable to assume that a *rational* investor will not invest in a portfolio if there exists another available portfolio with a more favorable profile. Portfolio return is the proportion-weighted combination of the constituent assets' returns.

Asset allocation is the process of organizing investments among different kinds of asset categories, such as stocks, bonds, derivatives, cash, and real estate, in order to accommodate and achieve a practical combination of risks and returns, that is consistent with an investor's specific goals. Usually, the process involves portfolio optimization, which consists of three general steps:

Step I: | The investor specifies asset classes and models forward-looking assumptions for each asset classes' return and risk as well as movements among the asset classes. For a scenario-based approach, returns are simulated based on all the forward-looking assumptions. |

Step II: | One arrives at an optimization algorithm in which allocations to different asset classes are set. These allocations are known as the asset mix. |

Step III: | The asset mix return and wealth forecasts are projected over various investment probabilities, and scenarios predict and demonstrate the potential outcomes. Thus, an investor may inspect an estimate of what the portfolio value would be (say) 2 years into the future if its returns were in the bottom 10% of the projected range during this period. Mean-variance optimization (MVO) is commonly used for creating efficient asset allocation strategies. But MVO has its limitations – illustrated herein as follows. |

The following are the characteristic properties of the methodology of MVO:

- It does not take into account “fat-tailed” asset class return distributions, which matches mast real-world historical asset class returns. For example, consider the monthly total returns of the S&P 500 Index, dating back to 1926: There are 1,025 months between January 1926 and May 2011. The monthly arithmetic mean and standard deviation of the S&P 500 Index over this time period are 0.943 and 5.528%, respectively. For a normal distribution, the return that is three standard deviations away from the mean is −15.64%, calculated as (0.943%–3 × 5.528%).
In a standard normal distribution, 68.27% of the data values are within one standard deviation from the mean, 95.45% within two standard deviations, and 99.73% within three standard deviations: Figure 1.4

This implies that there is a 0.13% probability that returns would be three standard deviations below the mean, where 0.13% is calculated as

In other words, the normal distribution estimates that there is a 0.13% probability of returning less than −15.64%, which means that only 1.3 months out of those 1,025 months between January 1926 and May 2011 are

*expected*to have returns below −15.64%, where 1.3 months is arrived at by multiplying the 0.13% probability by 1,025 months of return data.However, when examining historical data during this period, there are 10 months where this occurs, which is

or almost 8 times more than the model prediction!

The following are the 10 months in question:

Month Return (%) Jun 1930 −16.25 Oct 2008 −16.79 Feb 1933 −17.72 Oct 1929 −19.73 Apr 1932 −19.97 Oct 1987 −21.54 May 1932 −21.96 May 1940 −22.89 Mar 1938 −24.87 Sep 1931 −29.73 The normal distribution model also assumes a

*symmetric bell-shaped curve*, and this seems to imply that the model is not well suited for asset classes with asymmetric return distributions. The histogram of the data, shown in Figure 1.5, plots the number of historical returns that occurred in the return range of each bar.The curve plotted over the histogram graph shows the probability predicted by the normal distribution. In Figure 1.5, the left tail of the histogram is longer, and there are actual historical returns that the normal distribution does not predict.

Xiong and Idzorek showed that skewness (asymmetry) and excess kurtosis (larger than normal tails) in a return distribution may have a significant impact on the optimal allocations in a portfolio selection model where a downside risk measure, such as Conditional Value at Risk (CVaR), may be used as the risk parameter. Intuitively, besides lower standard deviation, investors should prefer assets with positive skewness and low kurtosis. By ignoring skewness and kurtosis, investors who rely on MVO alone may be creating portfolios that are riskier than they may realize.

- The traditional MVO assumes that covariation of the returns on different asset classes is linear. That is, the relationship between the asset classes is consistent across the entire range of returns. However, the degree of covariation among equity markets tends to go up during global financial crises. Furthermore, a linear model may well be an inadequate representation of covariation when the relationship between two asset classes is based at least in part on optionality such as the relationship between stocks and convertible bonds. Fortunately, nonlinear covariation may be modeled using a scenario- or simulation-based approach.
- The traditional MVO framework is limited by its ability to only optimize asset mixes for one risk metric, standard deviation. As already indicated, using standard deviation as the risk measure ignores skewness and kurtosis in return distributions. Alternative optimization models that incorporate downside risk measures may have a significant impact on optimal asset allocations.
- The traditional MVO is a single-period optimization model that uses the arithmetic expected mean return as the measure of reward. An alternative is to use expected geometric mean return. If returns were constant, geometric mean would equal arithmetic mean. When returns vary, geometric mean is lower than arithmetic mean. Moreover, while the expected arithmetic mean is the forecasted result for the next one period, the expected geometric mean forecasts the long-term rate of return. Hence, for investors who regularly rebalance their portfolios to a given asset mix over a long period of time, the expected geometric mean is the relevant measure of reward when selecting the asset mix.

In spite of its limitations, the normal distribution has many attractive properties:

It is easy to work within a mathematical framework, as its formulas are simple.

The normal distribution is very intuitive, as 68.27% of the data values are within one standard deviation on either side of the mean, 95.45% within two standard deviations, and 99.73% within three standard deviations, and so on.

For the first step of an asset allocation optimization process, the investor/analyst begins by specifying asset classes and then models forward-looking assumptions for each asset class's return and risk as well as relative movements among the asset classes. Generally, one may use an index, or a blended index, as a proxy to represent each asset class, although it is also possible to incorporate an investment such as a fund as the proxy or use no proxy at all. When a historical data stream, such as an index or an investment, is used as the proxy for an asset class, it may serve as a starting point for the estimation of forward-looking assumptions.

In the assumption formulation process, it is critical for the investor to ascertain what should be the return patterns of asset classes and the joint behavior among asset classes. It is common to assume these return behaviors may be modeled by a parametric return distribution function, namely, that they may be expressed by mathematical models with a small number of parameters that define the return distribution. The alternative is to directly use historical data without assuming a return distribution model – this process is known as “bootstrapping.”

The normal distribution, also known as the Gaussian distribution, takes the form of the familiar symmetrical bell-shaped distribution curve commonly associated with MVO. It is characterized by ** two** parameters: mean and standard deviation.

- Mean is the probability-weighted arithmetic average of all possible returns and is the measure of reward in MVO.
- Variance is the probability-weighted average of the square of difference between all possible returns and the mean. Standard deviation is the square root of variance and is the measure of risk in MVO.
- The prefix “log” means that the natural logarithmic form of the return relative, ln(1+
*R*), is normally distributed. The lognormal distribution is asymmetrical, skewing to the right, because the logarithm of 0 is −∞, the lowest return possible is −100%, which reflects the fact that an unleveraged investment cannot lose more than 100%.

The lognormal distribution have the following attractive features:

- It is very easy to work with in a mathematical framework.
- It is scalable; therefore, mean and standard deviation can be derived from a frequency different from that of the return simulation.
- Limitations of the model include its inability to model the skewness and kurtosis empirically observed in historical returns. That is, the lognormal distribution assumes that the skewness and excess kurtosis of ln(1 +
*R*) are both zero.

The Johnson model distributions are a four-parameter parametric family of return distribution functions that may be used in modeling skewness and kurtosis. Skewness and kurtosis are important distribution properties that are zero in the normal distribution and take on limited values in the lognormal model (as implied by the mean and standard deviation).

There are the following four parameters in a Johnson distribution:

- Mean
- Standard deviation
- Skewness
- Excess kurtosis

Mean and standard deviation may be described similar to their definitions.

Skewness and excess kurtosis are measures of asymmetry and peakedness.

Consider the following example:

To reduce portfolio risk, one may simply hold combinations of instruments that are not perfectly positively *correlated*:

(1.10)

Thus, investors may reduce their exposure to individual asset risk by selecting a *diversified* portfolio of assets: ** diversification may allow for the same portfolio expected return with reduced risk**.

(These ideas had been first proposed by Markowitz and later reinforced by other Theoreticians (applied mathematicians and economists) who had expressed ideas in the limitation of variance through portfolio theory.)

Thus, if all the asset pairs have correlations of 0 (namely, they are perfectly uncorrelated), the portfolio's return variance is the sum of all assets of the ** square** of the fraction held in the asset times the asset's return variance, and the portfolio standard deviation is the square root of this sum.

Further detailed discussions of many of these ideas and approaches will be presented in Chapters 5 and 6.

A certain investment company advertised openly investment programs such as the *Managed Payout Funds*, which claim to enable interested investors to enjoy regular monthly payments after ones retirement, without giving up control of ones funds!

Such type of funds will be briefly assessed hereunder.

One particular fund claims the following:

- To have been designed to provide the investor with regular monthly payouts that, over time, keep pace with inflation, and to help one cover expenses in retirement.
- To accomplish, the fund aims to strike a balance between how much income it will generate and how much principal growth it will follow.
- To provide regular monthly payments automatically to the investor.
- To reset the payment amounts in January every year. And payments are expected to remain the same from month to month. The fund targets future annual distribution rate of 4%.
- Finally, the fund is NOT guaranteed: thus one may loose some of the capital invested!

Many of the theoretical approaches in financial engineering depend on the time/volume inflationary characteristics of the asset values or prices of commodities. As a classical example, consider the value-time and trading-volumes characteristics of the Dow Jones Industrial Average (DJIA), illustrated in Figures 1.6 and 1.7, respectively.

Here, the following questions are obvious to be raised:

- How high will the DJIA index go, and at what rates?
- How high will the daily traded shares volumes go?

Figures 1.6 and 1.7 seem to indicate, in the long run, both will increase.

Recently, the following article seems to indicate that, for both parameters, “the sky is the limit”!

- By J.L. Yastine
- November 28, 2016

A massive stock market rally is on our doorstep according to several noted economists and distinguished investors.

Ron Baron, CEO of Baron Capital, is calling for Dow 30,000.

Larry Edelson of *Money and Markets* is calling for Dow 31,000.

And Jeffrey A. Hirsch, author of *Stock Trader's Almanac*, is calling for Dow 38,000.

However, Paul Mampilly's “Dow 50,000” predication is garnering national attention…not because it's a bold prediction, but rather because every one of Mampilly's past predictions have been spot on.

Like when he predicted the tech crash of 1999 and the time he called the financial collapse of 2008 – months before they unraveled.

Mampilly's predictions paid off big as the $6 billion hedge fund he managed was named by *Barron's* as one of the “World's Best.”

And Mampilly became legendary when he won the prestigious Templeton Foundation investment competition by making a 76% return ($38 million in profit on a $50 million stake), during the 2008 and 2009 economic crisis.

In a new video presentation, Mampilly states: “Stocks are on the cusp of an historic surge. The Dow will rally to 50,000. I've never been more certain of anything in my career.”

Indeed, Mampilly uses a historic chart to prove Dow 50,000 is inevitable. (In fact, one can see how the Dow could even rally to 200,000.)

The drive behind this stock market rally?

“A little-known, yet powerful economic force that has driven every bull market for the last 120 years,” Mampilly explains. “I've used this same force to predict the stock market collapse of 2000 and 2008…and to make personal gains of 634%, 696% and even 2,539% along the way.”

And while these gains are impressive, Mampilly states they are nothing compared to what is ahead.

“The last time this scenario unfolded, it sent a handful of stocks as high as 27,000%, 28,000% and even 91,000%.”

The key is to buy the right stocks before the rally.

Clearly one needs to be disciplined in investing: both in *asset allocation* as well as in *portfolio optimization*.

In financial trading and investment environment today in which computerization and specialized mathematical algorithms can and do play significant roles, some investment agencies, as well as individual investors, have found it almost irresistible not to wander into and along these paths. Two such well-known paths are day trading and algorithmic trading. It should not escape once attention that serious investors should be aware of the high chances for losses in these, and similar, “get rich quick” schemes. For the sake of completeness, one should mention two such well-known schemes:

- Day trading
- Algorithmic trading

The following are brief description of these schemes.

*Day trading* is the speculation in stocks, bonds, options, currencies, and future contracts and other securities, by buying and selling financial instruments within the *same* trading day. Once, day trading was an activity exclusive to professional speculators and financial companies. The common use of “buying on margin” (using borrowed funds) greatly increases gains and losses, such that substantial gains or losses may occur in a very short period of time.

*Algorithmic trading* is a method of placing a large order by sending small portions of the order out to the market over time. It is an automated method of executing an order using automated preprogrammed trading instructions providing preset instructions accounting for variables such as price, volume, and time. It claims to be a way to minimize the costs, market impacts, and risks in the execution of an order – thus eliminating human intervention and decisions in the process.

The remainder of this book is developed along the following steps:

- Chapter 2 will present a full discourse on the probabilistic calculus developed for modeling in financial engineering.
- Chapter 3 will discuss classical mathematical models in financial engineering, including modern portfolio theories.
- Chapter 4 will discuss the use of R programming in data analysis, providing a practical tool for the analysis.
- Chapter 5 will present the methodologies of asset allocation, using R.
- Chapter 6 will discuss financial risk modeling and portfolio optimization using R.

- In finance and economics, it is tacitly assumed that inflation will continue, and will most probably continue indefinitely, with the following concomitant result:
The price of good and services such as

- food items, cars, services, and so on
*will increase indefinitely*, - the purchasing power of money, namely, the value of the $
*will decrease indefinitely*, and - working wages and salaries
*will increase indefinitely*.- Discuss the rationale behind each of these phenomena.
- If these phenomena hold true indefinitely, show how one may, and should, allocate one's assets, and manage one's investment portfolios, so that one has a maximum opportunity to accumulate wealth.

- food items, cars, services, and so on
- Besides allocating one's assets in terms of buying/selling stocks, bonds, and other financial instruments, discuss the likely challenges associated with investing in the following:
- Foreign financial entities, for example, buying stocks of overseas corporations such as financial opportunities in Europe, in China (being part of the
**BRIC**group –**B**razil,**R**ussia,**I**ndia, and China). It is anticipated that, by 2050, China and India will most likely become the world's dominant suppliers of manufactured goods and services! - Commodities (such as grains, oils, foreign currencies, precious metals, etc.).
- Real estates: properties and lands.
- Services such as hospitals, retirement homes, and other commercial entities.

- Foreign financial entities, for example, buying stocks of overseas corporations such as financial opportunities in Europe, in China (being part of the