Quantitative trading - page 10

 

Using R in real time financial market trading



Using R in real time financial market trading

In this informative video, the presenter delves into the practical application of using the programming language R in real-time financial market trading, specifically focusing on trading foreign currencies. They begin by discussing the appeal of trading currencies, highlighting their manageability and the dominance of a few key pairs in global currency trade. It is emphasized that trading foreign currencies takes place in the over-the-counter market, as opposed to on regulated exchanges. The presenter acknowledges the challenges of identifying anomalies in currency movements due to the market's liquidity and randomness.

The concept of over-the-counter trading is explained, noting that it differs from other types of trading as it prioritizes factors such as the counterparty and the quoted price over execution and latency. The video then covers standard financial market terminology, including the use of candles for visualizing data and the distinction between trading long (buying low and selling high) and trading short (selling borrowed stock at a higher price and repurchasing it at a lower price for profit).

To demonstrate the real-time analysis of financial market trading using R, the presenter walks through two examples. The first example focuses on testing the probability of the next candle's direction based on consecutive bullish or bearish candles. This hypothesis is examined using knowledge of candle patterns and their potential impact on market trends.

The video further explores the methodology of testing hypotheses in real-time financial market trading using R. An example is presented wherein data is pre-processed, and a table of consecutive candles is created to assess the probability of a change in candle direction. Trading costs are set to zero initially, and a profit balance is established and tested on a model date. However, the importance of rigorously testing entries and exits in a trading environment is highlighted, as setting trading costs to two points results in losing money and achieving market neutrality.

Considerations such as slippage and trading costs are addressed, with the speaker emphasizing the need to account for these factors and suggesting the incorporation of an error margin. A more complex example involving the cyclical nature of the Eurodollar is introduced, with a focus on measuring cyclicality based on turning points and price movement. The speaker stresses the importance of maintaining a uniform x-axis in financial market analysis to avoid distorting market movements over weekends.

The video delves into a mean reversion trading strategy, which involves identifying instances where a market has experienced rapid upward movement and anticipating a short-term trend reversal. The distribution of prices and candle movements are analyzed to determine suitable parameters for implementing this strategy. Testing is conducted with zero trading costs initially, followed by a small trading cost of 2 pubs. The results are cautiously optimistic, but the speaker acknowledges the presence of potential statistical issues that require further investigation and real market testing.

Regression analysis is introduced as a method for smoothing data points, but the challenges of predicting future trends when the regression line changes with additional data are noted. Basic back testing and forward testing using R are discussed, highlighting the limitations of testing with only one instrument and the need for a more comprehensive approach.

The presenter then shares insights on incorporating R code into real-time trading environments. They emphasize the importance of recalculating regression values frequently to adapt to market changes rather than relying on overfitting models for long-term success. The code includes decision-making parameters for buying or selling based on candle differences and price changes, as well as an exit strategy based on reaching a certain profit threshold. The presenter demonstrates the backtesting process and expresses confidence in obtaining positive results.

The importance of using a Mark-to-Market Equity curve rather than a Trade Equity curve for evaluating trading systems is highlighted. The limitations of the Trade Equity curve in reflecting the cash position of a system while trades are active are discussed. The presenter showcases two graphs comparing the two types of curves, revealing periods of system failure and significant drawdown. The need for a stop-loss strategy to mitigate losses is emphasized, and the code necessary to implement such a strategy is shared. The presenter acknowledges that a flaw in the exit strategy led to holding onto positions for too long, resulting in substantial losses.

The video then delves into the integration of R code into executing algorithms and the utilization of a Windows package on the modeling side. The presenter explains that their real money trading occurs on Linux servers, which are seamlessly connected to the CIRA platform through a shared memory space. This setup enables the exchange of data, including FIX, trades, and candles, between their system and the platform. The speaker reveals that they manage risk by simultaneously trading between four and eight different instruments. However, they caution against relying solely on probability in real-world trading, as it may cause traders to miss out on valuable opportunities throughout the day.

In conclusion, this video provides valuable insights into the practical implementation of R in real-time financial market trading, specifically focusing on trading foreign currencies. The presenter covers various aspects, including over-the-counter trading, standard financial market terminology, testing hypotheses, mean reversion trading strategies, considerations such as slippage and trading costs, and the integration of R code into executing algorithms. While highlighting the potential benefits of algorithmic trading, the video also acknowledges the need for rigorous testing, careful consideration of statistical issues, and the importance of risk management strategies in real-world trading scenarios.

  • 00:00:00 Ellen discusses how she uses R in trading foreign currencies. She explains why she chose to trade currencies, stating that they are manageable instruments to analyze, with about seven or eight pairs that perform 97-98% of the world's currency trade. Ellen also notes that since foreign currencies are over-the-counter instruments, they cannot be traded on an exchange. She acknowledges that finding anomalies in currency movements can be extremely difficult due to the liquidity and randomness of the market.

  • 00:05:00 The speaker explains the concept of over-the-counter trading, highlighting that it is an unregulated exchange, unlike other types of trading. The speaker explains that this type of trading emphasizes less on execution and latency and more on other factors such as the counterparty and the price quoted. The speaker then moves on to explain some of the standard terminology used in the financial market, such as candles and trading long versus trading short. Candles are used as a convenient tool for visualizing a range of data, while trading long is buying low and selling high, and trading short is selling borrowed stock for a higher price and then buying it back when the price drops to make a profit.

  • 00:10:00 The speaker discusses the concept of trading up or down in the forex market, where traders are always trading one instrument to get some xq. He also mentioned that he will not be showing viewers how to forecast the market or provide secret sauce, but instead will walk them through two examples of the kind of things he and his team analyze. The first example is a simple question of what the probability of the next candle being up or down is when having X consecutive bullish or bearish candles. The speaker leverages on the knowledge of up candles and down candles to test his hypothesis and assess if there are any dynamics in the market to predict market trends.

  • 00:15:00 The speaker explains their approach to testing hypotheses in real-time financial market trading using R. They demonstrate an example of pre-processing data and creating a table of consecutive candles, which shows the probability of a change in candle direction. The speaker then sets their trading costs to zero and creates a profit balance, which they test on a model date. However, they note that setting trading costs to two points leads to losing money and being market neutral, making it important to rigorously test entries and exits in a trading environment.

  • 00:20:00 The speaker discusses the importance of considering slippage in the market when trading and building in an error margin to account for it. They also mention the difference in trading costs depending on the broker and trade volume. The speaker then moves on to a more complex example of testing the cyclical nature of the Eurodollar and explains how they measure cyclicality according to time between turning points and price movement. They emphasize the importance of using a uniform x-axis in financial market analysis to avoid distorting market movements over weekends. The speaker offers to share code and data for this example with viewers.

  • 00:25:00 The speaker explains how he normalizes financial market data series by adding row numbers as the x-axis instead of using date and time. He then performs a kernel regression to smooth out the curve and finds the peaks and drops using some code. He tests the cyclicality of the peaks and clusters them in the lower quadrant to show that the significant turning points of Eurodollar happen within 30 hours. The speaker discusses different ways of trading, including forecasting the next turning point and making it a slightly more challenging problem.

  • 00:30:00 The speaker explains a mean reversion trading strategy, which involves looking for opportunities where a market has gone up too far and too fast, leading to a short-term trend reversal. The speaker analyzes the distribution of prices and candle movements to determine where to draw the line for this strategy, and then tests it by setting up trades with zero cost and later with a small trading cost of 2 pubs. The results are cautiously optimistic, and the speaker suggests further testing in real market conditions. However, the speaker notes that there may be statistical issues with this strategy that require further investigation.

  • 00:35:00 The speaker discusses using regression to smooth data points, but cautions that the regression line changes backwards as more data points are added to the series, making it difficult to predict future trends. He also explains that basic back testing and forward testing with R is limited to one instrument at a time and not ideal for multiple instruments or market-specific financial parameters. To address this issue, he uses a trading platform that allows him to copy and paste his R code directly into the platform and avoid lengthy coding and debugging processes.

  • 00:40:00 The speaker discusses the basic code used for incorporating R in real-time trading environments. They mention that the code is largely a copy and paste of the code they had in their R studio, focusing on recalculating regression values frequently in order to adapt to changes rather than overfitting the model and expecting it to work long term. The code includes a decision to buy or sell based on certain parameters, such as candle differences and price changes, and a strategy to exit the position when the profit reaches a certain amount. The speaker then shows how they ran a backtest with the code and expects good results.

  • 00:45:00 The presenter discusses the importance of using a Mark-to-Market Equity curve over a Trade Equity curve while evaluating trading systems. He explains that a Trade Equity curve doesn't reveal the cash position of a system while the trade is running, so it's difficult to model this in R. He shows two graphs, one with the trade equity curve and the other with the Mark-to-Market Equity curve, which reflect how the system faltered during some periods, leading to a significant drawdown. He concludes that applying a stop-loss strategy would have helped exit losses in time and shows the code that would enable one to make that change. The final testing of the model failed due to inadequate exit strategy that led to holding on for too long, creating heavy losses.

  • 00:50:00 The speaker talks about how they embed their code into executing algos and use a Windows package on the modeling side. Their real money runs on Linux servers and is wrapped within this package. They use a shared memory space between their system and the CIRA platform to interchange data. They can take FIX and trades and candles and pass them to their system for analysis, split the results back into CIRA, and make trading decisions. They can use this system to manage risk by trading between four and eight different instruments at the same time. They caution that while probability is important, relying on it for real-world trading may cause traders to miss out on opportunities throughout the day.
Using R in real time financial market trading
Using R in real time financial market trading
  • 2015.05.28
  • www.youtube.com
Autochartist CEO, Ilan Azbel explains how R can be used in real-time market analysis to build automated trading systems - recorded at a live presentation a t...
 

Introduction to Quantitative Trading - Lecture 1/8


Introduction to Quantitative Trading - Lecture 1/8

This comprehensive course serves as an in-depth introduction to the fascinating world of quantitative trading, equipping students with the knowledge and skills necessary to excel in this dynamic field. Quantitative trading revolves around the utilization of mathematical models and computer programs to transform trading ideas into profitable investment strategies. It all begins with a portfolio manager or trader who starts with an initial intuition or a vague trading concept. Through the application of mathematical techniques, these intuitions are transformed into precise and robust mathematical trading models.

The process of quantitative trading involves subjecting these models to rigorous analysis, back testing, and refinement. Statistical tests and simulations are employed to evaluate their performance and ensure their reliability. This meticulous testing phase is crucial for identifying and addressing any flaws or weaknesses in the models before they are put into action.

Once a quantitative investment model has proven its potential profitability, it is implemented on a computer system, enabling automated execution of trades. This integration of mathematical models into computer programs lies at the heart of quantitative trading, combining the power of mathematics with the efficiency of computer science. Throughout the course, students explore various investment strategies drawn from popular academic literature, gaining insights into their underlying mathematical principles and learning how to translate them into actionable trading models.

The curriculum of this course encompasses a wide range of topics, equipping students with the quantitative, computing, and programming skills essential for success in the field of quantitative trading. Students delve into the intricacies of mathematical modeling, statistical analysis, and algorithmic trading. They also gain proficiency in programming languages commonly used in quantitative finance, such as Python and R, enabling them to implement and test their trading models effectively.

By completing this course, students not only gain a holistic overview of the quantitative trading landscape but also develop the necessary skills to navigate it with confidence. They become adept at transforming trading ideas into mathematical models, rigorously testing and refining these models, and ultimately implementing them in real-world trading scenarios. With their solid foundation in quantitative and computational techniques, students are well-prepared to pursue careers in quantitative trading, algorithmic trading, or other related fields where the fusion of mathematics and technology drives success.

Introduction to Quantitative Trading - Lecture 1/8
Introduction to Quantitative Trading - Lecture 1/8
  • 2013.10.01
  • www.youtube.com
http://en.cqi.sg/introduction-to-quantitative-investment-201310/This course introduces students to quantitative trading. A "quant" portfolio manager or a tra...
 

Introduction to Quantitative Trading - Lecture 2/8


Introduction to Quantitative Trading - Lecture 2/8

In this lecture, the speaker emphasizes the importance of technology and programming in quantitative trading. They discuss how technology and programming skills are essential for co-opting quantitative trading strategies and conducting backtesting. The speaker highlights the significance of mathematics and computer programming in this field. They introduce basic Java programming and mathematical programming using Java, and emphasize the need for programming skills in quantitative trading due to the requirement of backtesting.

The speaker discusses the challenges involved in simulating and analyzing the future performance of a strategy. They mention that historical profit and loss (PNL) is not a reliable indicator for training or deciding whether to change a strategy. Instead, they suggest using simulation and parameter calibration, which require heavy programming, to find optimal parameters and test a strategy's sensitivity to them. They also stress the importance of using the same software for research and live trading to avoid translation errors.

The speaker discusses the responsibilities of a quant trader and emphasizes the need for efficient prototyping of trading ideas. They suggest spending most of the time brainstorming and coming up with ideas, while minimizing the time spent on testing and programming. They mention the importance of having a toolbox of building blocks to quickly prototype new strategies.

The speaker addresses the challenges of using popular tools like Excel, MATLAB, and R in quantitative trading, stating that they are not built for sophisticated mathematical strategies. They recommend using other programming languages like Java, C-sharp, and C++ that have libraries for constructing and implementing trading strategies.

The speaker specifically discusses the limitations of using R for quantitative trading. They mention that R is slow, has limited memory, and limited possibilities for parallelization. They also highlight the lack of debugging tools and standard interfaces for communication between different programs.

The speaker emphasizes the importance of technology and using appropriate tools in quantitative trading. They mention that tools like R and MATLAB can significantly improve mathematical programming and provide access to libraries for faster computations. They stress the need for a good trading research toolbox that allows for easy combination of modules, parallel programming, and automated data cleaning and parameter calibration.

The speaker discusses the advantages of using newer technologies like Java and C# for quantitative trading. They mention that these languages eliminate the need for debugging for issues like memory leaks and segmentation faults, which improves productivity. They demonstrate Java programming and provide hands-on lab sessions for the participants.

The speaker explains how to fix input for a Java program by correcting the imports and demonstrates mathematical programming using the algo quant library. They guide the participants through copying and pasting code from the website to their computers for running.

The speaker addresses technical questions from the audience regarding downloading and running the code used in the lecture. They demonstrate the classical version of a Hidden Markov Chain using the webinar function.

The speaker explains the concept of a Markov chain and demonstrates a simple two-state model with transition probabilities. They explain how Markov chains are used as random number generators to simulate observations and estimate model parameters. They encourage the audience to experiment with creating their own Markov chain models.

The speaker discusses the importance of communication and collaboration in quantitative trading and encourages team members to check in with each other and provide updates on their progress. They mention the possibility of using higher-order Markov models and invite questions and screen sharing during live discussions.

The lecturer discusses the challenges of estimating parameters in quantitative trading models with limited observations. They explain that more data is required for accurate estimation, and recommend using larger state models or increasing the number of observations. They discuss the Baum-Welch algorithm for training hidden Markov models and introduce the concept of backtesting.

The speaker demonstrates a simple moving average crossover strategy in AlgoQuant and explains the process of creating strategies, simulators, and running simulations. They highlight the importance of testing and performance analysis using measures such as profit and loss, information ratio, maximum drawdown, and more.

The speaker explains explore different trading strategies and test their performance through simulation. The speaker explains that simulation allows traders to assess the potential profitability and risks associated with a strategy before deploying it in live trading. By simulating different market conditions and scenarios, traders can gain insights into the strategy's performance and make informed decisions.

The speaker also emphasizes the significance of transaction costs in trading strategies. Transaction costs, such as brokerage fees and slippage, can have a substantial impact on the overall profitability of a strategy. Therefore, it is crucial to take transaction costs into account during simulation and backtesting to obtain a realistic assessment of a strategy's performance.

Furthermore, the lecturer introduces the concept of risk management in quantitative trading. They explain that risk management involves implementing strategies to control and mitigate potential losses. Risk management techniques may include setting stop-loss orders, position sizing, and diversification. It is essential to incorporate risk management principles into trading strategies to safeguard against significant financial losses.

The speaker concludes by reiterating the importance of continuous learning and improvement in quantitative trading. They encourage participants to explore different strategies, analyze their performance, and iterate based on the results. By leveraging technology, programming skills, and a systematic approach to strategy development, traders can enhance their profitability and success in the financial markets.

Overall, the lecture focuses on the significance of technology, programming, simulation, and risk management in quantitative trading. It highlights the need for experimentation, continuous learning, and the use of specialized tools to develop and refine trading strategies.

Part 1

  • 00:00:00 The speaker begins by addressing potential questions from the previous lecture and where to find the course materials. The focus of this lecture is on the importance of technology and programming in quantitative trading, as it is essential to co-opting quantitative trading strategies and conducting backtesting. The speaker emphasizes the significance of both mathematics and computer programming and proceeds to introduce some basic Java programming and mathematical programming using Java. The hands-on session includes co-opting strategies for backtesting, and the speaker asks if everyone has installed bin and algo quant on their computers and has passed the Maven test. Traditionally, for other types of trading, such as value investing, or trading based on gut feelings, you would not need much programming, but it is essential in quantitative trading due to the requirement of backtesting.

  • 00:05:00 The speaker discusses the importance of computer programming in quantitative trading, particularly in simulating and analyzing future performance of a strategy. They mention that historical PNL is not a reliable indicator for training or deciding whether or not to change a strategy. Instead, they suggest using simulation and parameter calibration, which require heavy programming, to find optimal parameters and test a strategy's sensitivity to them. They also emphasize the importance of using the same software for research and live trading to avoid possible translation errors. Ultimately, the speaker highlights that computer programming skills are critical in the financial trading industry and can greatly impact profits.

  • 00:10:00 The lecturer discusses the ideal responsibilities of a quant trader, which involve coming up with trading ideas and prototyping them quickly, while leaving the mechanical tasks, such as testing computing, PNL properties, and parameter calibration, to a computer system. Ideally, a trader would only spend about 10% of their time coding up their strategies and would rely on building blocks or templates in order to prototype strategies quickly and efficiently, without having to code everything from scratch. The lecturer emphasizes the importance of spending most of the time brainstorming and coming up with trading ideas, while minimizing the time spent testing and programming.

  • 00:15:00 The speaker emphasizes the importance of having a toolbox of building blocks that researchers can use to quickly prototype new strategies. He mentions that Algocron offers different building blocks such as bear market indicators based on conditional probabilities and co-integration to control baskets. He stresses the idea that creating strategies should be like playing with Legos, where researchers can put building blocks together to construct a new strategy. The speaker explains that despite spending most of their time coming up with ideas, traders have to do backtesting and data cleaning, which can be challenging. They need to process large amounts of data from different sources and need to extract useful information, such as price earning ratios, while handling missing or bad data. The process requires significant programming, and if strategies are event-driven, researchers may need to have a news and announcement schedule database.

  • 00:20:00 The speaker discusses the complications involved in simulating a trading strategy with an order book. One issue is slippage, which means that just because someone wants to buy something at a certain price doesn't mean they can actually buy it at that price due to the market moving. Another issue is execution assumptions in order book modeling. The simulation process is cumbersome and time-consuming, especially if using script languages like MATLAB or R. Parameter calibration and simulation can take up to hundreds of hours, and bugs in the software code can prolong the process further. The process of code debugging is long and frustrating and can lead to giving up on the trade, not because of incorrect code but because of running out of time or frustration.

  • 00:25:00 The speaker discusses the reality of quantitative trading and the tools that traders use. They explain that a lot of coin traders are quant analysts who spend almost 90% of their time programming and debugging, which is not what the job is supposed to be. The reason for this is that the research tools used by traders are primitive, and the popular ones include Excel, MATLAB, R, and commercial software. However, the speaker argues that these tools are not built for quantitative trading, and they are not useful for building sophisticated mathematical strategies. They suggest that other programming languages like Java, C-sharp, and C++ have libraries to put together and construct change strategies that traders can use instead.

  • 00:30:00 The speaker discusses the disadvantages of using R for quantitative trading. One of the main issues is that R is very slow as it is an interpreted language, which means that the interpreter executes line by line. In addition, there is a limited amount of memory available, which makes it impossible to load a significant amount of data into the memory for analysis. Moreover, the possibility of parallelization is very limited, making it difficult to run simulations on thousands of CPUs. The speaker mentions that using R for parallel computing is difficult, and its IDE is not as advanced as other languages like Java and C-sharp. There are also no debugging tools available, making it difficult to identify issues, and there is no standard interface for communication between different programs.

  • 00:35:00 The speaker discusses the advantages and disadvantages of using R as a quantitative trading strategy tool. He highlights that R has limited object-oriented programming support and most code is written using procedural language, but it has significant advantages over general-purpose languages. The biggest challenge with R is that there is no way to ensure that the source code is error-free, and this can be frustrating when debugging code. The speaker emphasizes the importance of technology, explaining that relying on weaponry (tools and research) is crucial in trading warfare. A smart person without technology cannot expect to compete with someone using technology, like parallel computing and machine learning, to search for profitable trading strategies.

  • 00:40:00 The speaker discusses the importance of technology in quantitative trading. Using tools like R and MATLAB can significantly improve mathematical programming and provide access to a wide range of libraries that allow for faster mathematical computations. Having a good trading research toolbox is essential for constructing and backtesting strategies quickly to capture market opportunities. The ideal toolbox should allow traders to easily combine modules, perform parallel programming, and generate performance statistics without having to spend a lot of time programming. Data cleaning should also be automated, and parameter calibration should be done automatically. The focus should be on coding up strategies rather than spending time on mechanical programming tasks.

  • 00:45:00 The importance of using a good tool for programming is discussed. The speaker mentions that using newer technologies like Java and C# eliminates the need for debugging for issues like memory leaks and segmentation faults, which speeds up productivity significantly. In addition, the class starts a hands-on lab session where they explore a Markov model experiment, and the speaker guides the participants through the process of copying and pasting code from the website to their lap bins for running. The class includes participants with programming experience, so they skip the basics of Java programming.

  • 00:50:00 The speaker explains how to fix the input for a Java program by correcting the imports using the ctrl shift i command. He then proceeds to demonstrate how mathematical programming can be done in Java using the algo quant library and shows a simple markov chain model that can be run in a new package and class. The speaker encourages attendees to ask questions and ensures that everyone is able to follow along with the demonstration.

  • 00:55:00 The speaker addresses some technical questions from the audience on how to download and run the code used in the lecture. He proceeds to demonstrate the classical version of Hidden Markov Chain using the webinar function, for which he keeps only pi a1 and b1, and deletes the other code.

Part 2

  • 01:00:00 The speaker explains the two-state model with transition probabilities, which is a simple example of a Markov chain. He illustrates the transition probabilities in a visual diagram and explains the probability of observing certain values at each state. The speaker then goes on to explain how a Markov chain is essentially a random number generator, and demonstrates how to simulate this particular Markov chain to generate observations.

  • 01:05:00 The speaker explains the concept of a Markov chain and how it's used as a random number generator to generate observations of stock prices. The initial state probabilities and transition probabilities of a two-state Markov chain are given as an example, but in real-life situations, these parameters need to be estimated based on observations. The speaker demonstrates how to estimate these parameters using the Webinar Models hidden Markov chain algorithm for parameter estimation. The estimated model can then be compared to the actual model for accuracy.

  • 01:10:00 The speaker discusses the importance of estimating parameters in quantitative trading. He notes that in reality, only prices or returns are observed, and the true model is unknown, so the best option is to estimate the parameters of the model. He mentions a good algorithm for estimating the parameters, the webinar algorithm, which closely matches the real models, and is useful for trading. The speaker encourages the audience to experiment with creating their own Markov chain models by changing the parameters, generating different observations, and performing various estimations to understand how they match true values under different conditions.

  • 01:15:00 The speaker discusses an upcoming live discussion on markov modeling and programming, inviting questions and screen sharing during the discussion. The task at hand is to generate different observations using a personal markov model and estimate different parameters to check whether the estimated model matches the real model. The goal is to determine how good the model of the market is since ultimately traders rely on it. The speaker encourages adding in extreme values and stress scenarios to see how the markov chain behaves.

  • 01:35:00 The instructor and students in the course discuss technical details related to licensing and experiments. The instructor advises one student to replace their long-term license with a newly downloaded one and suggests experimenting with different parameters to determine the point at which estimated models are useful for training purposes in quantitative trading. Other students report issues with experiments and licensing, which are addressed in detail.

  • 01:40:00 The speaker encourages the audience to create their own Markov chain and experiment with transition probabilities. They suggest using a two-state model for a three-state model and using creativity and imagination to create unusual transition probabilities such as zero or a "sync state" where one cannot transition out once entered. The speaker emphasizes the importance of creativity and imagination in quantitative trading and suggests using them to see how the estimation procedure behaves with unique phase change Markov chains.

  • 01:45:00 The speaker discusses the importance of communication and collaboration in quantitative trading, specifically when conducting experiments and analyzing data. They emphasize the need for team members to constantly check in with each other and provide updates on their progress, noting that individuals may have different approaches or ideas for the same problem. The speaker also mentions the possibility of using higher-order Markov models in their experiments and asks if anyone has explored this option.

  • 01:50:00 The lecturer discusses the importance of generating test cases to check whether the estimated model matches the real model. The real model is the one that is used to generate observations while the estimated model is created using the observations. The experiment aims to determine if the estimated model is close enough to the real model. The lecturer suggests generating different test cases to see how the estimation performs and highlights the significance of testing with a smaller number of observations.

  • 01:55:00 The speaker discusses the challenges with accurately estimating quantitative trading models with limited observations. It is noted that in statistics, algorithms are centered around convergence, meaning that estimation becomes more accurate as the number of observations increases. However, the speaker emphasizes that it is difficult to determine how close a model is to reality since you only have the estimated model and not the true values. Additionally, the concept of computing the probability of generating observed values with a given model is introduced, which is a crucial aspect of maximum likelihood estimation.

Part 3

  • 02:00:00 The lecturer discusses the challenges of estimating probabilities in a two-state model with limited data. The estimation for transition probabilities is inaccurate when there are only 100 observations. However, with 10,000 observations, accuracy increases, but the problem remains because most assets do not last for 40 years, which is the amount of data you would need for that many observations. The two-state model has 12 parameters, and as the number of parameters increases, more data is required for accurate estimation. Therefore, it is essential to have a large amount of data to estimate probabilities accurately, which is not practical in trading, especially when building complex models. The lecturer recommends building 3 or 4 state models or increasing the number of observations to overcome this challenge.

  • 02:05:00 The speaker discusses the difficulty of estimating for Markov chain models in quantitative trading. Increasing the number of variables makes the estimation process even more difficult, and using a parametric family of distributions instead of specifying operations like this can reduce the number of parameters significantly. However, the Baum-Welch algorithm, which is used to train a continuous hidden Markov model (HMM), can be challenging. The speaker then moves on to discuss the next experiment: backtesting.

  • 02:10:00 The demo being shown simulates a simple moving average crossover on the stock XOM, and the program is set up to download data on the stock from Yahoo and simulate trading from 1990 to 2012. The structure of how to set up the data source is explained, with the Yahoo data source plugin being the easiest and simplest to use for those who do not have access to professional data sources. This demo provides a useful example of how to program and test trading strategies.

  • 02:15:00 The speaker explains the process of creating strategies, simulators, and all the books needed to run a simulation. The example given is a moving average crossover strategy which involves computing the faster moving average using the last 20 days of data and the slower moving average using the last 250 days of data. The speaker notes that one can examine the source code for the implementation of the strategy, simulator, and trade plotters in AlgoQuant, which is open source software. Additionally, the speaker explains that the software's open accessibility allows users to independently verify its code and make modifications for customization. Finally, the speaker explains that there are various measures that can be used for performance analysis including profit and loss, information ratio, Sharpe ratio, maximum drawdown, mass exposure, and omega.

  • 02:20:00 The speaker demonstrates how to use different performance analyzers in Lwan to compute different measures, such as drawdown, and generate a report on the strategy's performance. The code listens to events that it cares about, such as price updates, and generates new orders based on the latest information. The speaker suggests using the debugger to better understand the code's behavior and see how it responds to price updates and generates orders.

  • 02:25:00 The speaker demonstrates how to use a debugger to monitor a trading strategy and watch for crossovers as signals. He explains how to place a breakpoint and stop when a real crossover signal occurs, showing an example where the faster moving average crosses above the slower moving average. The strategy then enters a long position, buying one unit of the product XOM at the market price. Later on, when the faster moving average crosses below the slower moving average, the strategy enters a short position, selling two units of XOM at the market price. The speaker shows a graph of the buy order and explains the difference between buying at the market order versus placing a limit order triggered by a desired price.

  • 02:30:00 The speaker goes over a simulation of a simple moving average crossover strategy in AlgoQuant. They demonstrate how to use historical data to generate buy and sell signals and compute orders for maintaining a desired position. The strategy listens to dev update signals and subscribes to the order book signal for this task. The speaker notes that while historical testing is not sufficient, it is a good starting point, and the simple moving average crossover can be generalized into other scenarios. They also mention that a strategy is just a function, and show the math for computing the order.

  • 02:35:00 The speaker discusses the importance of simulation and experimentation when attempting to create a trading strategy using mathematical analysis. He demonstrates the use of a GMA21 strategy, which has been previously proven mathematically, but produces unfavorable results when tested through simulation due to transaction costs. The speaker emphasizes the importance of software and programming in experimenting with and fine-tuning trading strategies to avoid losses in real-world trading scenarios, highlighting that different parameters can be tested for different stocks to find the most effective strategy.

  • 02:40:00 The lecturer discusses the importance of experimentation to confirm theoretical predictions in quantitative trading. Students are encouraged to use the provided software to experiment with different numbers and to create their own trading strategies. The lecturer walks students through the implementation of a gma21 strategy, which buys when the current price is higher than the last price and sells when the current price is lower than the last price, illustrating how to compute orders and send them to brokers for execution. Students are then tasked with creating their own strategies and experimenting with them on historical data.

  • 02:45:00 The speaker presents the simplest trading strategy that can be easily implemented, making it a plug-and-play solution. The speaker invites questions from the audience and encourages them to reach out if they need further clarification.

  • 02:55:00 The speaker discusses a special case of the geometric moving average, which is when M equals one. This case simplifies the strategy to only compare the current returns with zero, and while this strategy may not necessarily make money, it serves as a good example for educational purposes. The speaker encourages the audience to finish the exercise for this strategy offline so they can feel comfortable with coding and testing using algocoin system for the upcoming exercises on mathematics and programming.
 

Financial Engineering Playground: Signal Processing, Robust Estimation, Kalman, Optimization



Financial Engineering Playground: Signal Processing, Robust Estimation, Kalman, Optimization

In this captivating video, Daniel Palomar, a professor in the department of electrical, electronic, and computer engineering at HKUST, sheds light on the wide-ranging applications of signal processing in the realm of financial engineering. Palomar dispels the misconception surrounding financial engineering and emphasizes the ubiquity of signal processing techniques within this field. He highlights the relevance of various topics such as random matrix theory, particle filters, Kalman filters, optimization algorithms, machine learning, deep learning, stochastic optimization, and chance constraints.

Palomar delves into the distinctive properties of financial data, known as stylized facts, that remain consistent across different markets. He explains how financial engineers employ returns rather than prices to model the stock market. Linear and logarithmic returns, despite their minor differences, are widely used due to the small magnitude of returns. These returns are analyzed to determine their stationarity, with non-stationarity being a prominent characteristic of financial data. The speaker also addresses other stylized facts such as heavy-tailed distributions, skewness in low-frequency returns, and the phenomenon of volatility clustering.

The importance of modeling stock returns in finance is emphasized, with particular focus on volatility. Palomar draws parallels between the returns signal and a speech signal, exploring potential collaborations between financial modeling and speech signal processing. Different frequency regimes in modeling, including high-frequency modeling, are discussed, highlighting the challenges posed by the need for real-time data and powerful computing resources.

The limitations of models that solely focus on modeling returns without considering the covariance or variance of returns are also examined. The speaker emphasizes the significance of capturing the information and structure provided by covariance and variance models, which can enable more profitable decision-making. Palomar introduces the concept of modeling the variance and covariance of returns using a residual composed of a normalized random term and an envelope term capturing the covariance of the residuals. However, modeling a multivariate residual with a large coefficient matrix requires more sophisticated models.

The video explores the challenges of estimating parameters in the face of limited data and an abundance of parameters, which can lead to overfitting. To address this, low rank sparsity is introduced as a means of analyzing the Vega model and formulating constraints. Palomar discusses the concept of robustness and the inadequacy of assuming a Gaussian distribution for financial engineering due to heavy tails and small sample regimes. He explains that traditional sample estimators based on the Gaussian distribution yield subpar results, necessitating reformulation without such assumptions. Techniques like shrinkage and regularization are presented as effective means of addressing heavy tails, with their successful implementation in finance and communications.

Robust estimation, a tool used in finance to improve accuracy despite outliers, is explored. The speaker introduces elliptical distributions for modeling heavy-tailed distributions and explains how weights can be calculated for each sample using an iterative method. The Tyler estimator, which normalizes samples and estimates the probability density function (PDF) of the normalized sample, is discussed as a means of removing the tail's shape. The Tyler estimator, in combination with robust estimators, enhances the accuracy of covariance matrix estimation. The inclusion of regularization terms and the development of algorithms further contribute to improved observations and estimation of covariance matrices.

Palomar delves into financial concepts such as Wolfe estimation, Tyler estimation, and cointegration. While Wolfe estimation represents a significant improvement, it still relies on the assumption of a Gaussian distribution. Tyler estimation, an appealing alternative, requires a sufficient number of samples for models with multiple dimensions. Cointegration, a crucial concept in finance, suggests that predicting the relative pricing of two stocks may be easier than predicting individual prices, opening opportunities for pairs trading. The distinction between correlation and cointegration is explored, with correlation focusing on short-term variations and cointegration pertaining to long-term behavior.

The video unveils the concept of a common trend and its relationship to spread trading. The common trend is described as a random walk shared by two stocks that have a common component. By subtracting the common trend from the spread between the stock prices, traders obtain a residual with a zero mean, which serves as a reliable indicator for mean reversion. This property becomes instrumental in spread trading strategies. The speaker explains that by setting thresholds on the spread, traders can identify undervalued situations and capitalize on the price recovery, thus profiting from the price difference. Estimating the gamma parameter and identifying co-integrated stocks are essential steps in this process, which can be accomplished using techniques like least squares.

The speaker delves into the role of the Kalman filter in scenarios where a change in the regime leads to the loss of cointegration due to varying gamma. The adaptability of the Kalman filter to these variations is highlighted through a comparison with least squares and rolling least squares methods. It is demonstrated that the Kalman filter outperforms the other techniques, as it maintains a steady tracking around zero, while least squares exhibits fluctuations that result in losses over a period of time. Thus, the speaker recommends employing the Kalman filter for robust estimation in financial engineering.

A comparison between the performance of least squares and Kalman filter models is presented, confirming the effectiveness of the Kalman method in financial engineering. The speaker then delves into the application of hidden Markov models for detecting market regimes, enabling traders to adjust their investment strategies based on the prevailing market conditions. Portfolio optimization is introduced as a fundamental concept, involving the design of portfolios that balance expected return and variance of the portfolio return. The speaker draws parallels between portfolio optimization and beamforming and linear filtering models, as they share similar signal models.

The video discusses how communication and signal processing techniques can be applied to finance. The concept of signal-to-noise ratio in communication is compared to the Sharpe ratio in finance, which measures the ratio of portfolio return to volatility. The speaker introduces the Markowitz portfolio, which seeks to maximize expected return while minimizing variance. However, due to its sensitivity to estimation errors and reliance on variance as a risk measure, the Markowitz portfolio is not widely used in practice. To address this, sparsity techniques from signal processing can be employed, particularly in index tracking, where only a subset of stocks is used to track an index, rather than investing in all constituent stocks. The speaker proposes improvements to sparsity techniques in reducing tracking errors.

The video delves into the concept of "purse trading" and highlights the role of portfolios in trading. Using the value at risk (VaR) model, the speaker explains how portfolio trading can be achieved by constructing a portfolio of two stocks with specific weights. The PI matrix and beta matrix are introduced as tools that provide a subspace of mean-reverting spreads, enabling statistical arbitrage. The incorporation of the beta matrix in optimization facilitates the identification of the optimal direction within the subspace, resulting in superior outcomes compared to using beta alone. The speaker also mentions his book, "A Signal Processing Perspective on Financial Engineering," which serves as an entry point for signal processing professionals interested in the field of finance.

Towards the conclusion of the video, different approaches to trading in financial engineering are explored. The speaker distinguishes between strategies that capitalize on small variations and trends and those that focus on exploiting noise. These two families of investment strategies offer distinct avenues for generating profits. The speaker also touches upon the challenges posed by the lack of data for applying deep learning techniques in finance, as deep learning typically requires substantial amounts of data, which may be limited in financial contexts. Additionally, the concept of estimating vector dimensions for more than two stocks is discussed, with the speaker providing insights into various approaches.

In the final segment, the speaker addresses the issue of market dominance by big companies and its impact on the financial market. The speaker highlights the potential influence that large companies with significant financial resources can have when they make substantial investments. This concentration of power raises important considerations for market dynamics and the behavior of other market participants.

The video briefly touches on the topic of order execution in finance. It explains that when dealing with large orders, it is common practice to break them into smaller pieces and execute them gradually to avoid disrupting the market. This aspect of finance involves intricate optimization techniques and often draws upon principles from control theory. The speaker emphasizes the mathematical nature of order execution and mentions the existence of numerous academic papers on the subject.

As the video draws to a close, the speaker invites the audience to raise any further questions during the coffee break, acknowledging their presence and participation. The video serves as a valuable resource, providing insights into the application of signal processing in financial engineering. It offers perspectives on improving estimations, optimizing portfolios, and detecting market regimes through the lens of signal processing techniques.

Overall, the video provides a comprehensive overview of the various applications of signal processing in financial engineering. It emphasizes the importance of modeling stock returns, variance, and covariance in finance while addressing the challenges of parameter estimation, overfitting, and the limitations of traditional financial models. The concepts of robust estimation, cointegration, portfolio optimization, and sparsity techniques are discussed in detail. By highlighting the parallels between communication and signal processing in finance, the speaker underscores the relevance and potential for collaboration between these two domains. The video concludes by shedding light on trading strategies, machine learning in finance, and the significance of market dynamics influenced by big companies.

  • 00:00:00 Daniel Palomar, a professor in the department of electrical, electronic, and computer engineering at HKUST, discusses the topic of financial engineering and how there is a misconception about what it is. Palomar explains that signal processing is everywhere within financial engineering, and various topics such as random matrix theory, particle filter, Kalman filter, optimization algorithms, machine learning, deep learning, stochastic optimization, and chance constraints are relevant. He also touches on stylized facts about financial data and explains that financial data has special properties that are consistent across different markets.

  • 00:05:00 The video explains how financial engineers model the stock market using returns instead of prices. There are two types of returns: linear and log returns, but they are almost the same since returns are usually small numbers. Returns can be plotted to see if they are stationary or not, and the stylized fact of finance is its non-stationarity. Other stylized facts include heavy tails, which means that the tails of the historical histogram of returns are heavy, not thin like a Gaussian distribution. Financial engineers also need to model skewness, especially in low frequencies of returns. Lastly, the video explains the concept of volatility clustering and its importance in financial modeling.

  • 00:10:00 The speaker discusses the importance of modeling stock returns in finance. They explain that volatility plays a crucial role in modeling, particularly in modeling the standard deviation, or envelope, of the returns signal. The speaker notes that the returns signal looks similar to a speech signal, and ponders if enough overlap exists between financial modeling and speech signal processing to inspire collaboration. Different frequency regimes exist in modeling and high frequency modeling, in particular, requires expensive subscriptions and powerful computers due to the vast amount of time-critical data. The section concludes by mentioning different financial modeling models, such as the IID model and the factor model, and touches on the importance of understanding correlations in time in modeling.

  • 00:15:00 The speaker discusses the limitations of financial models that only focus on modeling returns and not the covariance or variance of returns. They explain that by only looking at the returns, you may be losing information and structure that others can capture to make money. The speaker then introduces the idea of modeling the variance and covariance of the returns using a residual that is composed of two factors: a normalized random term with unit variance and an envelope term that captures the covariance of the residuals. They note that models for the scalar residual are well-established, but modeling a multivariate residual with a 500 by 500 matrix coefficient requires much more complex models.

  • 00:20:00 The speaker explains the challenges of estimating parameters with not enough data and too many parameters, leading to overfitting. To solve this problem, it is necessary to impose low rank sparsity to analyze the Vega model and formulate some constraints. The speaker introduces the concept of robustness, where we consider that the Gaussian distribution is not adequate for financial engineering because of heavy tails and small sample regimes. Traditional sample estimators based on Gaussian distribution result in poorly performing estimators. To address this issue, we need to reformulate everything without assuming a Gaussian distribution, and heavy tails can be addressed by shrinkage or regularization methods, which have been used in various industries, including finance and communications.

  • 00:25:00 The speaker discusses robust estimation, which is a tool used in finance to make more accurate estimations despite various outliers in data. The speaker explains that elliptical distributions can be used to model heavy-tailed distributions, and the weights of each sample can be calculated through an iterative method. Additionally, the speaker explains the Tyler estimator, which normalizes samples and estimates the PDF of the normalized sample so that the shape of the tail is removed. This estimator can be used alongside robust estimators to provide a more accurate estimation of covariance matrices. The speaker then explains how regularization terms can be included, and algorithms can be developed to obtain a better understanding of the observations, with a graph depicted to show the error in estimation of covariance matrices against the number of samples.

  • 00:30:00 The speaker discusses financial concepts such as Wolfe estimation, Tyler estimation, and cointegration. Wolfe estimation is a big improvement, but still makes the assumption of Gaussian distribution. Tyler estimation is a nice alternative but requires at least 40 samples for a 14-dimensional model. Cointegration, a specific concept in finance, is the idea that the relative pricing of two stocks may be easier to predict than the individual prices, allowing traders to make money through pairs trading. The difference between correlation and cointegration is that correlation is about short-term variations while cointegration is more about long-term behavior. The speaker illustrates these concepts with various plots and graphs.

  • 00:35:00 The speaker explains the concept of a common trend and how it relates to spread trading. The common trend is a random walk that two stocks with a common component share. By subtracting the common trend from the spread between the stock prices, the trader is left with a residual that is zero mean, making it a good indicator for mean reversion, a property that can be used for spread trading. The trader sets two thresholds on the spread and buys when it is undervalued and sells when it recovers, making money off the difference. Least-squares can be used to estimate the gamma, but it requires finding the two stocks that are co-integrated and the value of gamma. The speaker shows an example of a real spread trading scenario.

  • 00:40:00 The speaker explains how Kalman comes in when there is a change in the regime and cointegration is lost due to changing gamma, and how it adapts to these variations. The speaker uses two stocks as an example to compare the tracking of the MU and gamma using least squares, Kalman, and a rolling least squares, and concludes that Kalman works the best. The green line for Kalman tracking stays around zero, while the black line for least squares goes up and down, causing money to be lost for a period of two years. Therefore, the speaker suggests using Kalman for robust estimation in financial engineering.

  • 00:45:00 The speaker compares the performance of the least squares and Kalman training models and concludes that the Kalman method works well in financial engineering, while the least squares model tapers after a certain point. He discusses the use of hidden Markov models in detecting market regimes, which helps change investment strategies depending on whether the market is in a good or bad state. Furthermore, he explores the concept of portfolio optimization and explains that portfolios are vectors with weights that tell investors how much money to invest in a stock. The expected return and variance of the portfolio return are also key factors used to design portfolios. The speaker draws a comparison with beamforming and linear filtering models, which use similar signal models to portfolio optimization.

  • 00:50:00 The speaker discusses how communication and signal processing techniques can be applied to finance. The concept of signal-to-noise ratio in communications is similar to the Sharpe ratio in finance, which is a ratio of portfolio return to volatility. Portfolio optimization, specifically Markowitz portfolio, which involves maximizing expected return and minimizing variance, is introduced as a simple convex problem. The speaker also notes that Markowitz portfolio is not often used in practice due to its sensitivity to estimation errors and reliance on variance as a measure of risk. However, sparsity techniques from signal processing can be applied to index tracking, where instead of buying hundreds of stocks to track an index, only a subset of stocks is used. Finally, the speaker proposes an improvement to sparsity techniques in tracking errors.

  • 00:55:00 The speaker discusses "purse trading" and the use of portfolios in trading. Using the VaR (value at risk) model, the speaker explains how portfolio trading can be done with two stocks and a portfolio of two components with weight one and minus gamma. The speaker then introduces the PI matrix and beta matrix, which gives a subspace of mean-reverting spreads that can be used for statistical arbitrage. The use of the beta matrix in optimization helps in finding the best direction within the subspace and yields better results than just using the magical beta alone. The speaker also promotes his book, "A Signal Processing Perspective on Financial Engineering," which is an entry point for signal processing people interested in the field of finance.

  • 01:00:00 The speaker discusses different approaches to trading in financial engineering, including trading on the spread using the end of the price trend and small variations. He explains that there are two families of strategies for investment: those that make money based on the trend and small variations, and those that make money with the noise, by ignoring the trend when forming a spread. The speaker also discusses machine learning in finance and explains that the lack of data poses a problem for using deep learning in finance, as deep learning requires a large amount of data, which is often limited in finance. Finally, he discusses the notion of cointegration and explains different approaches to estimating vector dimensions for more than two stocks.

  • 01:05:00 The speaker discusses the issue of big companies having too much money, which can drive the market when they invest. They also mention the topic of order execution in finance, where large orders are chopped into small pieces and sent slowly to avoid disrupting the market. This branch of finance involves a lot of optimization and can get very mathematical, with many papers on the topic in control theory. The speaker suggests taking further questions into the coffee break and thanks the audience for attending.
Financial Engineering Playground: Signal Processing, Robust Estimation, Kalman, Optimization
Financial Engineering Playground: Signal Processing, Robust Estimation, Kalman, Optimization
  • 2019.10.31
  • www.youtube.com
Plenary Talk by Prof. Daniel P Palomar on "Financial Engineering Playground: Signal Processing, Robust Estimation, Kalman, HMM, Optimization, et Cetera"Plen...
 

"Kalman Filtering with Applications in Finance" by Shengjie Xiu, course tutorial 2021



"Kalman Filtering with Applications in Finance" by Shengjie Xiu, course tutorial 2021

In the video titled "Kalman Filtering with Applications in Finance," the concept of state-based models and their application in finance is explored. The speaker introduces the Kalman filter as a versatile technique for predicting the state of a system based on prior observations and correcting the prediction using current observations. The video also covers the Common Smoother and the EM algorithm, which are used to analyze historical data and learn the parameters of a state-based model for finance.

The video begins by illustrating the concept of state-based models using the example of a car driving along an axis with hidden positions. The presenter explains how state-based models consist of transition and observation matrices that map the state into the observed space. These models can handle multiple states or sensors recording positions simultaneously. The hidden state follows a Markov property, leading to an elegant form of probability.

The speaker then delves into the Kalman filter algorithm and its application in finance. The algorithm involves prediction and correction steps, where uncertainty is represented by the variance of a Gaussian function. The common gain, which determines the weight between the prediction and observation, is highlighted as a crucial factor. The simplicity and computational efficiency of the Kalman filter are emphasized.

An experiment comparing the reliability of GPS and odometer data in predicting the location of a car is discussed, demonstrating the effectiveness of the Kalman filter even when certain data sources are unreliable. However, it is noted that the Kalman filter is designed for linear Gaussian stabilized models, which limits its applicability.

The video also introduces the Common Smoother, which provides a smoother performance than the Common Filter and solves the filter's downward trend problem. The need to train parameters in finance and the concept of time-varying parameters are discussed. The Expectation-Maximization (EM) algorithm is presented as a means to learn the parameters when the hidden states are unknown.

The speaker explains the EM algorithm, which consists of the E-step and M-step, to calculate the posterior distributions of latent states and optimize the objective function for parameter estimation. The application of the state-based model in finance, specifically for intraday trading volume decomposition, is highlighted.

Various variants of the Kalman filter, such as the extended Kalman filter and unscented Kalman filter, are mentioned as solutions for handling non-linear functionality and noise. Particle filters are introduced as a computational method for complex models that cannot be solved analytically.

The video concludes by discussing the limitations of analytical solutions and the need for computational methods like Monte Carlo methods. The speaker acknowledges the demanding nature of these processes but highlights the fascinating aspects of Kalman filtering.

Overall, the video provides an in-depth exploration of state-based models, the Kalman filter, and their applications in finance. It covers the fundamental concepts, algorithmic steps, and practical considerations, while also mentioning advanced variants and computational methods. The speaker highlights the relevance and power of state-based models in revealing hidden information and emphasizes the continuous advancements in the field.

  • 00:00:00 The video presenter introduces the concept of state-based models using a simple example of a car driving along an axis with hidden positions denoted as "z-axis." The hidden states, denoted as "jt" in time t, are unknown to the observer, just like in the stock market where the state of the market is hidden. The presenter describes two models related to state-based models, the common filter, and the common smoother, and how to learn the parameters within the state-based model automatically. Finally, the video discusses the applications of state-based models in finance. The state equation and observation equation are introduced, where the state is dependent on the previous node only, and each observation relies on relevant hidden states.

  • 00:05:00 The speaker explains state-based models and how they consist of transition and observation matrices that map the state into the observed space, which can be different. The state and observation can be vectors with multiple states or sensors recording the position simultaneously, which allows for a more generic form. The hidden state follows a Markov property, which leads to an elegant form of probability. The speaker clarifies the concepts of prediction, filtering, and smoothing and how they combine to create the forward algorithm in the Kalman filter. The Kalman filter is composed of two components: prediction and correction, and it was first designed by Kalman and used in the Apollo project to track spacecraft. It's now widely used in many areas, including time series forecasting in finance.

  • 00:10:00 The Kalman Filtering algorithm is introduced and its application in finance is discussed. The algorithm involves predicting the state of a system based on prior observations and then correcting the prediction using current observations. The uncertainty in the prediction is represented by the variance of a Gaussian function, and the correction is done by multiplying the prediction and observation Gaussian distributions. The importance of the common gain, which determines the weight between the prediction and the observation, is emphasized. The algorithm is shown to be quite simple and involves only a few lines of code.

  • 00:15:00 The lecturer discusses an experiment in which the reliability of GPS and the odometer were compared in a state equation. The results showed that the Kalman Filter approach was successful in predicting the location of a car, even when the GPS was not reliable during specific sections of the journey. The lecturer also discussed the pros and cons of the Kalman Filter and noted its computational efficiency and the fact that it is widely used in real-time applications. However, one of its limitations is that it is designed for linear Gaussian stabilized models. The lecturer also briefly discussed the Common Smoother and its use in analyzing historical data.

  • 00:20:00 The performance of the common smoother in finance is presented using the example of a car driving through a tunnel. The common smoother provides a much smoother performance than the common filter and solves the filter's downward trend problem, providing a better approximation. Before running the common smoother, the forward common filter function must be implemented. The section also covers the concept of parameters in finance, the need to train them, and how they can be time-varying. Learning theory is introduced, including maximum likelihood estimation and the expectation-maximization algorithm for finding parameters when the hidden states are unknown. The EM algorithm consists of two steps, the expectation step and the maximization step, to calculate the posterior distributions of latent states and the expected value of the guess.

  • 00:25:00 The speaker discusses the EM algorithm and how it can be used to learn the parameters of a state-based model for finance. The algorithm consists of two steps: the E-step, where the posterior probability is calculated using the common filter and smoother, and the M-step, where the objective function is maximized to find the new estimate parameters. The parameters are continually looped and optimized until they converge. The speaker also explains how this model can be applied to finance, specifically with regards to intraday trading volume decomposition, where the daily and periodic components are separated using the model. The speaker notes that implementing the model is straightforward using existing packages such as marks in R.

  • 00:30:00 The speaker discusses the state model used in finance, which consists of a hidden state with both daily and periodic components, and an observation model that combines the daily and periodic terms to form the trading volume. The model is analyzed using a Kalman filter and smoother, and the EM algorithm is used to learn the parameters efficiently. The model can also be used for time series forecasting by predicting the future daily term and keeping the seasonal term the same. The state-based model is useful in finding hidden information and can be applied to other financial applications as well.

  • 00:35:00 The speaker discusses the power of state-based models and how they can reveal hidden information in observations. The Kalman filter is a versatile and useful technique that can be applied in virtually any area, including finance. While the Kalman filter is designed for easier cases, other variants can be used for more complicated models. The extended Kalman filter and unscented Kalman filter are two examples of variants that can handle non-linear functionality and noise. Additionally, particle filters are used when the model is too complicated for analytical solutions. While the Kalman filter was developed in the 1960s, it remains an optimal solution to the state-based model in a very specific case, with linear transition functions and Gaussian noise.

  • 00:40:00 The speaker discusses the limitations of solving integrals analytically and the need for heavy computational methods like Monte Carlo methods for certain tasks such as particle filtering. He notes that this was not possible in the past, but is now thanks to the current state of technology. The speaker also mentions that while it is a demanding process, it is a fascinating topic, referring to Kalman filtering.
"Kalman Filtering with Applications in Finance" by Shengjie Xiu, course tutorial 2021
"Kalman Filtering with Applications in Finance" by Shengjie Xiu, course tutorial 2021
  • 2021.05.20
  • www.youtube.com
"Kalman Filtering with Applications in Finance" by Shengjie Xiu, tutorial in course IEDA3180 - Data-Driven Portfolio Optimization, Spring 2020/21.This talk g...
 

"Thrifting Alpha: Using Ensemble Learning To Revitalize Tired Alpha Factors" by Max Margenot


"Thrifting Alpha: Using Ensemble Learning To Revitalize Tired Alpha Factors" by Max Margenot

In the video titled "Thrifting Alpha: Using Ensemble Learning To Enhance Alpha Factors," Max Margenot, a data scientist at Quantopian, shares his insights on leveraging ensemble learning to enhance the performance of alpha factors. Margenot emphasizes the significance of constructing a portfolio by combining independent signals, resulting in improved and novel outcomes. He introduces the concept of factor modeling, addresses the complexities of assessing model performance, and explores the creative utilization of ensemble learning for efficient asset allocation.

Margenot begins by introducing the concept of "thrifting alpha," which aims to revitalize tired alpha factors using ensemble learning. Alpha factors represent unique and interesting returns in finance, differentiating them from risk factors such as market returns. The objective is to create a portfolio by combining independent signals to generate new and improved results. He also provides a brief overview of the Capital Asset Pricing Model and explains how Quantopian serves as a free platform for quantitative research.

Factor modeling is a key focus of Margenot's presentation. He highlights how a portfolio's returns consist of market returns and additional unexplained factors. By incorporating classic factors such as small-big (small market cap vs. large market cap firms) and high minus low for book to price ratio, the model can assess market risk and expand its analysis to other return streams. The goals of factor modeling include diversifying uncorrelated signals, reducing overall portfolio volatility, and increasing returns.

The speaker discusses the growing popularity of factor modeling in portfolio construction processes, citing a Blackrock survey that indicates 87% of institutional investors incorporate factors into their investment strategies. Margenot outlines the five main types of factors that portfolios revolve around: value, momentum, quality, volatility, and growth. He also explains the concept of long/short equity, where positions are taken on both long and short positions based on factor values. The objective is to use these exposures to create a well-balanced portfolio.

Margenot delves into the universe in which the algorithm is applied, emphasizing the importance of aligning the statistical model with the execution of trades. If the trades cannot be executed due to constraints, such as shorting limitations, the strategy's mandate is violated. Margenot favors dollar-neutral strategies that ultimately end up market neutral. He constructs portfolios where only the highest and lowest values matter, aiming to capture the highest expected returns. Combining multiple factors involves a composition of a combined rank, providing flexibility within the portfolio.

Assessing model performance and dealing with unexplained returns pose challenges, as Margenot explains. He discusses the importance of a reliable universe with sufficient liquidity and introduces the Q 1500 universe, designed to filter out unwanted elements. Instead of predicting prices, Margenot emphasizes the importance of understanding which stocks are better than others and capturing relative value. He demonstrates the use of the pipeline API within their framework to compute momentum, providing examples of vector calculations.

The speaker focuses on creating a momentum factor that considers both long-term and short-term trends. Margenot standardizes returns and penalizes the long-term aspect to address the risk of short-term reversals. He utilizes a package called Alpha Ones to evaluate the signal across different time scales and constructs a portfolio using the momentum factor. Margenot emphasizes the importance of determining a reasonable time scale and discusses the factors he works with. He highlights the workflow of defining a universe, alpha factors, and combining alphas to construct a long/short equity portfolio.

Margenot discusses the combination of different alpha factors and their portfolio construction, emphasizing that the combination of independent signals should ideally result in a stronger overall signal. He presents dynamic and static aggregation methods for combining factors and constructing a portfolio. Static aggregation involves an equal-weighted portfolio of different factors, while dynamic aggregation adjusts the weights of factors based on their performance. Standardizing factors is essential to ensure comparability within each individual factor.

Ensemble learning is a key topic discussed by Margenot. He explains that finding a consistently upward trending training algorithm can be challenging, as it should go beyond simple beta. To overcome this limitation, he employs ensemble learning to aggregate multiple individual signals. Margenot specifically utilizes AdaBoost, a well-known technique in ensemble learning, to train decision trees based on six features. These decision trees predict whether an asset will go up or down, and the final prediction is determined by the majority output of a thousand decision trees. This approach allows for more accurate and robust forecasting.

Margenot further elaborates on evaluating signal alpha by revitalizing tired alpha factors through ensemble learning. He trains decision trees over a month and attempts to predict returns or whether the market will be up or down in the future. By aggregating the performance of the classifiers, he extracts feature importances from the weighted sum of the decision trees and evaluates the signal alpha lens. However, Margenot acknowledges the need to incorporate commissions and slippage into the evaluation process, as they can significantly impact the final results.

Incorporating commission and slippage considerations into algorithms is an essential aspect highlighted by Margenot. He emphasizes that real-world trading costs should be taken into account to ensure the viability of the signals. He demonstrates the potential negative returns and drawdowns in a backtester due to the limited training window for a machine learning classifier and high turnover rate. Margenot suggests exploring alternative ensemble learning methods or platform implementations to potentially improve performance in the future. He also mentions the tools he utilized for alpha factor analysis and portfolio analysis.

Throughout the video, Margenot introduces various tools and resources that can aid in implementing ensemble learning techniques. He recommends checking out the zipline backtesting engine and utilizing the Quantiopian platform, which provides access to it. Margenot suggests employing Scikit-learn and the Ensembles package, which are valuable for machine learning, statistics, and classifiers. He also mentions that he shares lectures, algorithms, and template solutions on his GitHub, providing free access to his expertise for data scientists and traders.

Towards the end of the presentation, Margenot discusses the process of revamping existing alpha factors using ensemble learning. He emphasizes that even if an alpha factor initially does not yield positive results, it can be improved upon. He highlights the pipeline's importance in defining computations and explains how training components on historical data enables predicting market movements 20 days in advance. While cross-validation can be challenging with historical data, Margenot suggests training forward and predicting on the next dataset as a workaround.

Margenot concludes by discussing the practical aspects of implementing ensemble learning to improve alpha factors. He advises training the ensemble classifier over a longer period and predicting over a longer period as well. He suggests employing a factor weighting scheme and other constraints to allocate resources among different strategies. Margenot advocates for training a single model on all the interpreters within the pipeline, treating each factor as part of a unified model. He also humorously mentions the possibility of factors doing the opposite of their intended purpose by adding a negative sign, highlighting that it rarely occurs.

In summary, Max Margenot's video provides valuable insights into the realm of ensemble learning and its application in enhancing alpha factors. By combining independent signals and utilizing ensemble learning techniques, data scientists and traders can optimize their investment strategies through advanced machine learning approaches. Margenot's practical advice, demonstrations, and recommended tools offer guidance to those seeking to leverage ensemble learning for more accurate and profitable decision-making in trading strategies.

  • 00:00:00 In this section, Max Margenot, a data scientist at Quantopian, introduces the concept of "drifting alpha" which aims to revitalize tired alpha factors using ensemble learning. He explains that alpha factors refer to novel and interesting returns in finance, while risk factors are the usual returns everyone is familiar with, such as the market. The goal is to create a portfolio by combining independent signals to get something new and better results. He also briefly explains Capital Asset Pricing Model and how Quantopian operates as a free platform for quantitative research.

  • 00:05:00 In this section, the speaker introduces the idea of a factor model, which attempts to understand the risks of a portfolio. The speaker explains that a portfolio's returns are made up of the returns of the market and something else that is new and unexplained. The classic factors added to a factor model include small - big, which refers to small market cap firms versus large market cap firms, and high minus low for book to price ratio. By assessing market risk and adding more factors, one can extend the model and look at exposure against other return streams. Ultimately, diversifying uncorrelated signals, lowering volatility in the overall portfolio, and increasing returns are the goals in factor modeling.

  • 00:10:00 In this section, the speaker discusses how factor modeling is becoming increasingly common in portfolio construction processes. According to a Blackrock survey, 87% of institutional investors are incorporating factors into their investment process. The five main types of factors that portfolios revolve around are value, momentum, quality, volatility, and growth. The speaker also talks about long/short equity, which involves going long on some equity and short on others using factor value to determine where they go long or short. Ultimately, the goal is to use these exposures to create a portfolio.

  • 00:15:00 In this section, Max Margenot discusses the universe in which the algorithm is applied. The algorithm applies a statistical model and executes trades in line with the model. If the trades cannot be made due to constraints, such as not being able to short, then the mandate of the strategy is violated. Margenot prefers dollar-neutral strategies, which generally end up market neutral, and constructs portfolios where only the highest and lowest values matter to capture the highest expected returns. Combining multiple factors involves a composition of a combined rank, which involves a lot of room to wiggle with and is why he is defining it specifically in this way.

  • 00:20:00 In this section, the speaker discusses the challenges of assessing a model's performance and how unexplained returns can be more daunting than explained losses or drawdowns. He talks about the importance of having a reliable universe that has sufficient liquidity and how they created the Q 1500 universe to filter out unwanted elements. The speaker also explains how calculating prices is challenging, and instead of predicting prices, he focuses on understanding which stocks are better than others. He then explains the notion of relative value and how capturing it is more critical than being in an up or down market. Finally, he defines an example of a vector and how he uses the pipeline API within their framework to compute momentum.

  • 00:25:00 In this section of the video, Max Margenot discusses his approach to creating a momentum factor that takes into account both long-term and short-term trends. He standardizes returns and penalizes the long-term aspect to address the risk of short-term reversal. He uses a package called Alpha Ones to evaluate the signal over different time scales and ultimately constructs a portfolio using the momentum factor. Margenot explains the importance of deciding on a reasonable time scale and discusses the factors he's working with. He also emphasizes the workflow of defining a universe, alpha factors, and combining alphas to construct a long/short equity portfolio.

  • 00:30:00 In this section, Max Margenot discusses the combination of different alpha factors and their portfolio construction, noting that the combination of independent signals ideally leads to a stronger overall signal. He presents dynamic and static aggregation methods for combining factors and constructing a portfolio, with static aggregation being the equal-weighted portfolio of different factors, while dynamic aggregation involves changing the weights of factors based on their performance. Additionally, he emphasizes the importance of standardizing the factors to ensure that they are comparable within each individual factor.

  • 00:35:00 In this section of the video, Max Margenot talks about ensemble learning and how it can be used to allocate between constructed assets in a creative way. He explains that it is difficult to come up with a good training algorithm that consistently goes up in a novel way that isn't just beta. To overcome this limitation, he uses ensemble learning to aggregate many different individual signals. He uses AdaBoost, an old favorite in ensemble learning, to train decision trees based on his six features, predicting whether something is going to go up or down. He then takes the winner combination out of a thousand different decision trees and takes the sine of that outcome, voting yay or nay based on the majority output.

  • 00:40:00 In this section, Max Margenot discusses how to evaluate a signal alpha by using ensemble learning to revitalize tired alpha factors. He trains decision trees over a month and tries to predict returns or whether he will be up or down a month into the future, relying on the classifiers' aggregate performance. He then extracts feature importances from the weighted sum of the decision trees and evaluates the signal alpha lens. While the adaboost value has a high probability of leading to a high return, he acknowledges the need to bring this into something like a des Baux alpha lens, which incorporates commissions and slippage.

  • 00:45:00 In this section of the video, the presenter discusses the importance of incorporating commission and slippage into algorithms to ensure that the signals are still good after the fact. He then shows the negative returns and drawdowns in a backtester due to the limited training window for a machine learning classifier and high turnover rate. The presenter suggests that using a different ensemble learning method or platform implementation may result in better performance in the future. Finally, he lists the tools he used for alpha factor analysis and portfolio analysis.

  • 00:50:00 In this section, Max Margenot talks about using Pi-elle and Cool to calculate the intention behind an algorithm's trade and how it can help fulfill that intention by the time the position is closed. He recommends checking out the zipline backtesting engine and using the Quantiopian platform to access it. He also suggests using Scikit-learn and Ensembles package, which is great for machine learning, statistics, and classifiers. Max Margenot is a lecturer at Quantopian and provides free access to his lectures, algorithms, and template solutions on his GitHub.

  • 00:55:00 In this section, Max Margenot, a quantitative researcher, discusses his process of using ensemble learning to revamp existing alpha factors. He explains that even if an alpha factor did not work initially, it is still possible to build upon it and improve it. He also touches on the importance of the pipeline in the process of defining computations, and how by training required components on historical data, it is possible to predict up or down 20 days in advance. However, Margenot points out that cross-validation is challenging to implement when dealing with historical data, but his technique is to train forward and predict on the next dataset.

  • 01:00:00 In this section, Max Margenot talks about using ensemble learning to improve alpha factors. He explains that every time he trains the ensemble classifier, the weights assigned to each factor are different based on the past month's performance. He suggests training over a longer period and predicting over a longer period. He also suggests using a factor weighting scheme and other constraints to allocate among different strategies. Margenot also talks about training a single model on all the interpreters within the pipeline for all the factors, rather than treating each factor as an individual model. He jokes about the possibility of factors doing the opposite of what they are supposed to do when a negative sign is added and explains that it never happens.

  • 01:05:00 In this section, the speaker discusses their rebalancing process, which takes place once a month, as they feel it is more faithful to their research process. They also acknowledge that noisy data may be affecting their predictions, as they're only getting a 1% edge on the given training set. The speaker also considers the idea of adding in an up or down feature to their model, but feels it's more effort than it's worth. They briefly discuss the use of neural nets, acknowledging their power but also stating that they prefer the more interpretable methods they are currently using. Finally, the speaker ends by discussing the importance of using machine learning as a tool for classification or regression, rather than discovery.

  • 01:10:00 In this section of the video, the speaker discusses the usefulness of using adaboost to handle outliers when dealing with a large number of disparate things. The speaker also mentions using ensemble learning to predict things with high returns and low returns without breaking them into any sort of baskets until after the prediction is made. They mention the option of using a third thing for prediction. However, they suggest starting with two things to avoid dealing with much else.
"Thrifting Alpha: Using Ensemble Learning To Revitalize Tired Alpha Factors" by Max Margenot
"Thrifting Alpha: Using Ensemble Learning To Revitalize Tired Alpha Factors" by Max Margenot
  • 2017.07.25
  • www.youtube.com
This talk was given by Max Margenot at the Quantopian Meetup in San Francisco on July 18th, 2017. Video work was done by Matt Fisher, http://www.precipitate....
 

MIT 18.S096 Topics in Mathematics w Applications in Finance - 1. Introduction, Financial Terms and Concepts



1. Introduction, Financial Terms and Concepts

In this informative video, viewers are taken on a journey through various financial terms and concepts to establish a solid foundation in finance. The course caters to both undergraduate and graduate students who are interested in pursuing a career in this field. It aims to provide an introduction to modern finance and equip students with essential knowledge.

The lecturer begins by delving into the history of financial terms and concepts, shedding light on important terms such as Vega, Kappa, and volatility. Vega is explained as a measure of sensitivity to volatility, while Kappa measures the volatility of price changes over time. The lecturer emphasizes that the field of finance has undergone a remarkable transformation in the last three decades, driven by the integration of quantitative methods.

The video also explores the evolution of the trading profession and the changes it has experienced in the past 30 years. It touches upon the diverse trading products available in the market and how they are traded. The lecturer then delves into the causes of the 2008 financial crisis, attributing it to the deregulation of the banking sector, which allowed investment banks to offer complex products to investors.

The significance of financial markets is emphasized, as they play a crucial role in connecting lenders and borrowers, while also providing opportunities for investors to generate higher returns on their investments. The video highlights the different players in the financial markets, including banks, dealers, mutual funds, insurance companies, pension funds, and hedge funds.

Throughout the video, various financial terms and concepts are discussed in detail. Hedging, market making, and proprietary trading are explained, and terms like beta and alpha are introduced. Beta is described as the difference in return between two assets, while alpha represents the difference in return between a stock and the S&P 500 index. The lecturer also touches upon portfolio management in relation to alpha and beta.

The video provides insights into different types of trades and how they are executed. It explains the role of hedging and market making in protecting investors. Additionally, the video features Mr. White, who elaborates on financial terms and concepts used in the markets. Delta, gamma, and theta are discussed in the context of stock trading, and the importance of understanding volatility exposure, capital requirements, and balance sheet risks is highlighted. Mr. White also explores various methods used to analyze stocks, including fundamental analysis and arbitrage.

The video mentions a policy change by the Federal Reserve to reduce quantitative easing, which has caused cautiousness among investors and resulted in a stock market sell-off. It emphasizes the challenging nature of pricing financial instruments and managing risks using mathematical models. The lecturer stresses the need to constantly update trading strategies due to the dynamic nature of the market.

The concept of risk and reward is thoroughly examined, and the video demonstrates how human behavior can sometimes lead to unexpected outcomes in financial decision-making. An example is presented, where the audience is given two options with different probabilities and potential gains or losses, highlighting the varying preferences individuals may have.

As the video concludes, viewers are encouraged to sign up for a future class, and optional homework assignments related to compiling a list of financial concepts are suggested. This comprehensive video serves as an excellent introductory guide to financial terms and concepts, providing a solid starting point for those interested in the field of finance.

  • 00:00:00 This video introduces financial concepts, terms, and formulas, and provides an introduction to modern finance. The class is open to undergraduate students, and graduate students are welcome. The goal is to provide a foundation for students who want to pursue a career in finance.

  • 00:05:00 This lecture discusses the history of financial terms and concepts, including Vega, Kappa, and volatility. Vega is a measure of a book or portfolio's sensitivity to volatility, and Kappa is a measure of how volatile a price can change over time. The lecture also notes that finance was not always a quantitative profession, and that the last 30 years have been a transformation in the field due to the introduction of quantitative methods.

  • 00:10:00 This video provides background on the financial industry, including how the trading profession has changed over the last 30 years. It also covers the different forms of trading products and how they are traded.

  • 00:15:00 The 2008 financial crisis was largely caused by the deregulation of the banking sector, which made it easier for investment banks to offer complex products to investors.

  • 00:20:00 The financial markets are essential for bridging the gap between lenders and borrowers, and for helping investors generate higher returns or yields on their investments. There are different types of players in the markets, including banks, dealers, mutual funds, insurance companies, pension funds, and hedge funds.

  • 00:25:00 Financial terms and concepts are discussed in this video, including hedging, market making, and proprietary trading. Beta is explained as the difference in return between two assets, alpha is the difference in return between a stock and the S&P 500 index, and portfolio management is discussed in relation to alpha and beta.

  • 00:30:00 This video explains how different types of trades are executed, and how hedging and market making can help protect investors.

  • 00:35:00 In this video, Mr. White explains the different financial terms and concepts used in the markets. Delta, gamma, and theta are all important concepts to understand when trading stocks. Volatility exposure, capital requirements, and balance sheet risks are also discussed. Finally, Mr. White explains the different methods used to analyse stocks, including fundamental analysis and arbitrage.

  • 00:40:00 The policy change by the Federal Reserve refers to a plan to reduce the amount of quantitative easing they are doing. This has caused the stock market to sell off, as investors become more cautious about the future. Mathematical models are used to price financial instruments and to risk manage, both of which are challenging tasks. In addition, trading strategies must be constantly updated due to the fast-evolving nature of the market.

  • 00:45:00 The presenter discusses the concepts of risk and reward, and shows how human behavior can lead to unexpected results in financial decisions. He then presents two options - one with an 80% chance of losing money and one with a 100% chance of winning - and asks the audience which they would choose. Most of the audience choose the option with the higher expected value, but a minority choose choice b, which has the lower chance of winning but the potential to lose more money.

  • 00:50:00 The video discusses financial terms and concepts, and provides an example of how people might learn from their experiences. The video also suggests the optional homework of compiling a list of financial concepts.

  • 00:55:00 This video introduces financial terms and concepts, including the concepts of derivatives, Monte Carlo methods, and electronic trading. Jake provides two examples of projects he worked on, one involving estimating the noisy derivative of a function, and the other involving better predicting prices of currencies.

  • 01:00:00 This video introduces financial terms and concepts, and asks viewers to sign up for a future class.
1. Introduction, Financial Terms and Concepts
1. Introduction, Financial Terms and Concepts
  • 2015.01.06
  • www.youtube.com
MIT 18.S096 Topics in Mathematics with Applications in Finance, Fall 2013View the complete course: http://ocw.mit.edu/18-S096F13Instructor: Peter Kempthorne,...
 

2. Linear Algebra



2. Linear Algebra

The video extensively covers linear algebra, focusing on matrices, eigenvalues, and eigenvectors. It explains that eigenvalues and eigenvectors are special vectors that undergo scaling when a linear transformation is applied. Every n by n matrix has at least one eigenvector, and using an orthonormal matrix, it becomes possible to break down a matrix into directions, simplifying the understanding of linear transformations. The video also introduces Singular Value Decomposition (SVD) as another tool for understanding matrices, particularly for a more general class of matrices. SVD allows for the representation of a matrix as the product of orthonormal matrices and a diagonal matrix, which saves space for matrices with lower rank. Furthermore, the video highlights the significance of eigenvectors in measuring data correlation and defining a new orthogonal coordinate system without altering the data itself.

In addition to the aforementioned concepts, the video delves into two important theorems in linear algebra. The first is the Perron-Frobenius theorem, which states that a non-symmetric matrix possesses a unique eigenvalue with the largest absolute value, along with a corresponding eigenvector with positive entries. This theorem has practical applications in various fields. The second theorem discussed is the Singular Value Decomposition (SVD), which enables the rotation of data into a new orientation represented by orthonormal bases. SVD is applicable to a broader range of matrices and allows for simplification by eliminating unnecessary columns and rows, particularly in matrices with significantly lower rank compared to the number of columns and rows.

The video provides detailed explanations, examples, and proofs of these concepts, emphasizing their relevance in different fields of engineering and science. It encourages viewers to understand the underlying principles and engage with the material.

  • 00:00:00 In this section, the professor begins by reviewing linear algebra, assuming that the viewers have taken a course on it previously. He tailors the lecture notes to be a review for those who took the most basic linear algebra course. The lecture primarily focuses on matrices and their significance. The professor explains that a matrix is a collection of numbers that can be used to arrange data such as stock prices. A matrix is also an operator that defines a linear transformation from an n-dimensional vector space to an m-dimensional vector space. The professor also introduces the concept of eigenvalues and eigenvectors and discusses how they can be applied to data sets to yield important properties and quantities.

  • 00:05:00 In this section, the YouTube video explains the concept of eigenvalues and eigenvectors and their importance to linear algebra. It is defined as a real number and vector that satisfies the condition of A times v being equal to lambda times V, and v being an eigenvector corresponding to lambda. The determinant of (A-lambda I) equals 0 if A-lambda I does not have full rank, and det(A-lambda I) is a polynomial of degree n for square matrices. The video also highlights that there always exists at least one eigenvalue and eigenvector, and the geometrical meaning of this concept is explained from a linear transformation point of view, where A takes the vector in R^3 and transforms it into another vector in R^3.

  • 00:10:00 In this section of the video, the concept of eigenvalues and eigenvectors are introduced as special vectors that, when a linear transformation is applied, just get scaled by some amount, which is known as lambda. It is established that every n by n matrix has at least one eigenvector, and an orthonormal matrix can be used to break down a matrix into directions, making the linear transformation easy to understand. Finally, it is explained that matrices that can be broken down into these directions are the most important in linear algebra, and those directions are defined by the matrix U, while D defines how much it will scale.

  • 00:15:00 In this section, the concept of diagonalizable matrices is introduced. While not all matrices are diagonalizable, there is a special class of matrices that always are, and most matrices that will be studied in the course fall into this category. A matrix is considered diagonalizable if it breaks down into n directions, and this is especially true for symmetric matrices, which have real eigenvalues and are always diagonalizable. Theorem 2 is discussed, which provides a proof for the diagonalizability of symmetric matrices.

  • 00:20:00 In this section, the speaker explains how to diagonalize symmetric matrices, which involves eigenvalues and eigenvectors. The speaker then emphasizes the importance of remembering Theorems 1 and 2 for real symmetric matrices. While diagonalization is possible for symmetric matrices, it is not always possible for general matrices. Therefore, the speaker introduces an alternative tool that can be used for all matrices to distill important information through simple operations such as scaling.

  • 00:25:00 In this section, the speaker introduces Singular Value Decomposition as the second tool of understanding matrices, which is similar to diagonalization but has a slightly different form. The theorem states that for any m by n matrix, there always exists two orthonormal matrices, U and V, and a diagonal matrix, sigma, such that the matrix can be decomposed as U times sigma times V transposed. The speaker explains that this works for all general m by n matrices, whereas eigenvalue decomposition only works for diagonalizable n by n matrices. Additionally, the speaker mentions that SVD gives a frame of vectors for which A acts as a scaling operator, and the spaces for the vectors are different from each other.

  • 00:30:00 In this section, the speaker discusses diagonalization and eigenvalue decomposition, and how they work within their respective frames. They compare it to the singular value decomposition, which is applicable to a more general class of matrices. They also touch on the proof of the singular value decomposition, which relies on eigenvalue decomposition. The speaker emphasizes the importance and ubiquity of both forms of decomposition in many fields of engineering and science, and encourages viewers to try to imagine and understand the concepts behind the theory.

  • 00:35:00 In this section of the video, the concept of eigenvalues and eigenvectors is explained. By assuming that all but the first r eigenvalues are zero, the eigenvalues are rewritten as sigma_1^2, sigma_2^2, sigma_r^2, and 0. The eigenvectors are then defined as u_1, u_2 up to u_r, where u_i is calculated by dividing A times v_i by its corresponding eigenvalue sigma_i. With this, a matrix U is defined comprising of u_1 up to u_n, and matrix V is defined as v_1 up to v_r, and v_r+1 up to v_n. Multiplying these matrices results in a diagonal matrix, where the first r diagonal entries are sigma_1 to sigma_r, and the remaining entries are zero.

  • 00:40:00 In this section, the speaker provides a tutorial on linear algebra and explains how to define the matrix U and V by applying A times V/sigma (where A is A transpose times A). The diagonal of the matrix is then filled with sigma values and the columns are defined by the dot product of U transpose with the lambda values and V. The speaker also addresses a mistake in the computation, correcting it and revealing the simplicity of the process.

  • 00:45:00 In this section, the professor teaches how to find the singular value decomposition of a matrix, which can be a powerful tool. To obtain the singular value decomposition, you need to find the eigenvalues and eigenvectors of the matrix and arrange them properly. Although it can be a bit cumbersome to do by hand, it is a useful exercise. There are also more efficient ways of computing this on a computer if needed. The professor provides an example of finding the singular value decomposition of a 2x3 matrix and shows the steps to obtain it.

  • 00:50:00 In this section, the professor explains the process of finding the singular value decomposition of a matrix. He demonstrates how to find the eigenvectors of a matrix and proceeds to show how to decompose the matrix into the U, sigma, and V transpose form. He emphasizes that the eigenvectors that correspond to an eigenvalue of zero are not important and can be dropped which saves computation. The professor concludes this section by stating a different form of singular value decomposition.

  • 00:55:00 In this section, the simplified form of SVD is introduced. A becomes equal to U times sigma times V transpose, where U is still an m by m matrix, sigma is also m by m, and V is an m by n matrix. This works only when m is less than or equal to n. The proof is the same, and the last step is to drop irrelevant information. This form simplifies matrices by removing unnecessary columns and rows, making it very powerful for matrices with a much lower rank than the number of columns and rows. An example of this is stock prices with five companies and 365 days of a year. The reduced form saves a lot of space and will be the form seen most of the time. The eigenvectors help measure the correlation of the data and define a new, orthogonal coordinate system without changing the data itself.

  • 01:00:00 In this section, the professor explains how the singular value decomposition (SVD) rotates the data into a different orientation represented by the orthonormal basis that you are transforming to. The correlations between different stocks are represented by how these points are oriented in the transformed space. Additionally, the professor mentions the Perron-Frobenius theorem, which looks theoretical, but Steve Ross found a result that makes use of this theorem called Steve Ross recovery theorem. The theorem states that for an n by n symmetric matrix whose entries are all positive, there exists a largest eigenvalue, lambda_0.

  • 01:05:00 In this section, the speaker introduces a well-known linear algebra theorem that has many theoretical applications, including probability theory and combinatorics. The theorem states that for a non-symmetric matrix, there exists a unique eigenvalue with the largest absolute value, which is a real number. Furthermore, there is an eigenvector with positive entries corresponding to this eigenvalue. The theorem has been used in many contexts, and the speaker briefly describes how it works when the matrix is symmetric. The proof involves several observations, including the fact that the largest positive eigenvalue dominates the smallest negative eigenvalue if all eigenvalues have positive entries.

  • 01:10:00 In this section, the speaker explains how the positive entries of a matrix have an impact on the eigenvectors of the matrix. If a vector has non-positive entries or negative entries, flipping the sign of the entries and obtaining a new vector will increase the magnitude, which cannot happen in a matrix with positive entries. The eigenvector of a matrix with positive entries should also have positive entries, and this theorem holds true even in more general settings. The speaker will review this concept later, but it will come into play later on.
2. Linear Algebra
2. Linear Algebra
  • 2015.01.06
  • www.youtube.com
MIT 18.S096 Topics in Mathematics with Applications in Finance, Fall 2013View the complete course: http://ocw.mit.edu/18-S096F13Instructor: Choongbum LeeThis...
 

3. Probability Theory



3. Probability Theory

This comprehensive video series on Probability Theory covers a wide range of topics, providing a deep understanding of fundamental concepts and their practical applications. The professor begins by refreshing our knowledge of probability distributions and moment-generating functions. He distinguishes between discrete and continuous random variables and defines important terms like probability mass function and probability distribution function. The professor also illustrates these concepts with examples, including the uniform distribution.

Next, the professor delves into the concepts of probability and expectation for random variables. He explains how to compute the probability of an event and defines the expectation (mean) of a random variable. The professor also discusses the notion of independence for random variables and introduces the normal distribution as a universal distribution for continuous random variables.

In exploring the modeling of stock prices and financial products, the professor points out that using the normal distribution alone may not accurately capture the magnitude of price changes. Instead, he suggests modeling the percentage change as a normally distributed variable. Furthermore, the professor discusses the log-normal distribution and its probability density function, highlighting that its parameters mu and sigma are derived from the normal distribution.

The video series proceeds to introduce other distributions within the exponential family, such as Poisson and exponential distributions. These distributions possess statistical properties that make them useful in real-world applications. The professor explains how these distributions can be parametrized and emphasizes the relationship between the log-normal distribution and the exponential family.

Moving on, the professor explores the statistical aspects and long-term behavior of random variables. He explains the concept of moments, represented by the k-th moments of a random variable, and emphasizes the use of the moment-generating function as a unified tool for studying all the moments. Additionally, the professor discusses the long-term behavior of random variables by observing multiple independent random variables with the same distribution, leading to a graph that closely resembles a curve.

The video series then focuses on two important theorems: the law of large numbers and the central limit theorem. The law of large numbers states that the average of independent and identically distributed random variables converges to the mean in a weak sense as the number of trials increases. The probability of deviation from the mean decreases with a larger number of trials. The central limit theorem demonstrates that the distribution of the average of independent random variables approaches a normal distribution, regardless of the initial distribution. The moment-generating function plays a key role in showcasing the convergence of the random variable's distribution.

Convergence of random variables is further discussed, highlighting how the moment-generating function can control the distribution. The professor introduces the concept of a casino rake as a means of generating profits and discusses the influence of variance on belief in one's capabilities. The proof of the law of large numbers is explained, emphasizing how averaging a larger number of terms reduces variance.

In the context of a casino, the speaker explains how the law of large numbers can be applied. It is noted that a gambler may have a slight disadvantage in individual games, but with a large sample size, the law of large numbers ensures that the average outcome tends towards the expected value. The idea of a casino taking a rake is explored, highlighting how player advantage and belief in mathematical principles can influence outcomes.

Finally, the video series delves into the weak and strong laws of large numbers and discusses the central limit theorem. The weak law states that the average of independent and identically distributed random variables converges to the mean as the number of trials approaches infinity. The strong law of large numbers provides a stronger form of convergence. The central limit theorem explains the convergence of the distribution of the average to a normal distribution, even when the initial distribution is different.

Overall, this video series offers an extensive exploration of Probability Theory concepts, including probability distributions, moment-generating functions, laws of large numbers, central limit theorem, and their practical implications.

  • 00:00:00 In this section, the professor introduces the topic of probability theory, giving an overview of probability distributions and focusing on the moment-generating function. He distinguishes between discrete and continuous random variables and defines the probability mass function and probability distribution function. The professor clarifies that the sample space is usually considered to be the real numbers for continuous random variables, and provides examples of probability mass functions and probability distribution functions, including a uniform distribution. Overall, this section serves as a refresher for those familiar with the basics of probability theory.

  • 00:05:00 In this section, the professor discusses the concepts of probability and expectation for random variables. He explains that the probability of an event can be computed as either the sum of all points in the event or the integral over the set. He also defines the expectation, or mean, for random variables as the sum or integral over all possible values of the random variable multiplied by that value. The professor then goes on to explain the concept of independence for random variables, distinguishing between mutually independent events and pairwise independent events. Finally, he introduces the normal distribution as a universal distribution for continuous random variables.

  • 00:10:00 In this section of the video on Probability Theory, the speaker discusses the use of normal distribution as a means of modeling stock prices or financial products, and how it is not always a good choice due to not taking into account the order of magnitude of the price itself. Instead, the speaker delves into the idea that normally distributed should be the percentage change to model stock prices better. The speaker mentions that the normally distributed price increments will produce a normally distributed price rather than having any tendency.

  • 00:15:00 In this section, the professor explains how to find the probability distribution of Pn when the price changes are log-normally distributed. He defines a log-normal distribution Y as a random variable such that log Y is normally distributed. Using the change of variable formula, he shows how to find the probability distribution function of the log-normal distribution using the probability distribution of normal. The professor also explains why taking the percentage change as the model for the price changes is not a good choice in the long run, as it can take negative values and make the price go up or down to infinity eventually.

  • 00:20:00 In this section, the professor discusses the log-normal distribution and its definition. The probability density function of X is equal to the probability density function of Y at log X times the differentiation of log X which is 1 over X. The distribution is referred to in terms of the parameters mu and sigma, which came from the normal distribution. However, when skewed, it is no longer centered at mu, and taking the average does not give the mean, which is not e to the sigma.

  • 00:25:00 In this section, the professor introduces other distributions besides normal and log-normal distributions, such as Poisson and exponential distributions, which belong to a family of distributions called exponential family. This family has some good statistical properties that make them useful in real-world applications. The professor explains that all distributions in this family can be parametrized by a vector called "theta", and that the probability density function can be written as a product of three functions: h(x), t_i(x), and c(theta). The professor then goes into how log-normal distribution falls into the exponential family by using the formula 1 over x sigma square root 2 pi, e to the minus log x [INAUDIBLE] squared.

  • 00:30:00 In this section, the speaker discusses the two main things of interest when studying a random variable: statistics and long-term/large-scale behavior. Statistics are represented by the k-th moments of the random variable, where the k-th moment is defined as the expectation of X to the k. The speaker explains that a unified way to study all the moments together is through the moment-generating function, which contains all the statistical information of a random variable. The second main topic is the long-term or large-scale behavior of a random variable, which can be observed through several independent random variables with the exact same distribution. When numbers are super large, a graph can be plotted to show how many random variables fall into each point, which will look very close to a curve.

  • 00:35:00 In this section, the speaker discusses probability theory and the long-term behavior or large scale behavior of random variables. The two theorems discussed are the law of large numbers and central limit theorem. The moment-generating function is also introduced and is defined as the expectation of e to the t times x, where t is some parameter. The function gives the k-th moment of the random variable and is for all integers. The speaker notes that the existence of the moment-generating function is important as it classifies random variables.

  • 00:40:00 In this section, the theorem that if two random variables have the same moment-generating function, then they have the same distribution is discussed. However, it is cautioned that this does not mean that all random variables with identical k-th moments for all k have the same distribution, as the existence of moment-generating functions is required. Another statement is mentioned, which says that if the moment-generating function exists for a sequence of random variables and it converges to the moment-generating function of some other random variable X, then the distribution of this sequence gets closer and closer to the distribution of X.

  • 00:45:00 In this section, the professor discusses the concept of convergence of random variables and explains that the distributions of the random variables converge to the distribution of one random variable. The moment-generating function is a powerful tool to control the distribution, as seen in the given theorems. The professor then introduces the law of large numbers, where X is defined as the average of n random variables, and explains that if these variables are independent, identically distributed with mean mu and variance sigma square, then the probability that X is less than or equal to a certain value tends to the probability of that value.

  • 00:50:00 In this section, the speaker discusses the law of large numbers and its application in the casino. When a large number of identical independent distributions are averaged, their values will be very close to the mean. While playing blackjack in a casino, the gambler has a small disadvantage with a probability of winning at 48%. From the gambler’s point of view, only a small sample size is taken, making the variance take over in a short time period. However, from the casino’s point of view, they have a very large sample size and as long as there is an advantage in their favor, they will continue to win money. Poker is different from the casino games as it is played against other players, not the casino.

  • 00:55:00 In this section, the idea of a casino taking a rake as a means of making money is discussed, with the fees paid by the players accumulating to create profits for the casino. It is posited that if a player is better than their opponent and this edge is greater than the fee charged by the casino, the player can win using the law of large numbers. Despite this, when the variance is significant, belief in one's capabilities can decrease; however, having faith in mathematics may be all that is needed to stay the course. The proof of the law of large numbers is then explained, with an example illustrating how averaging a larger number of terms decreases variance.

  • 01:00:00 In this section, the weak law of large numbers is discussed, which states that if you have independent and identically distributed (IID) random variables, the average converges to the mean in a weak sense as the number of trials goes to infinity. The probability of deviation from the mean decreases as the number of trials increases. The strong law of large numbers is also briefly touched upon, which has a stronger convergence than the weak law. The central limit theorem is the next topic, which explores what happens when the number of trials is replaced by the square root of the number of trials in the random variable.

  • 01:05:00 In this section, the professor explains how the central limit theorem answers a question regarding the distribution of Yn with mean 0 and variance sigma squared. He stated that when taking many independent events and finding their average, in this sense, their distribution converges to a normal distribution. He further stated a theorem about the convergence of the distribution of Yn to normal distribution with mean 0 and variance sigma. Regardless of the initial distribution, the convergence to the normal distribution occurs.

  • 01:10:00 In this section, the goal is to prove that the moment-generating function of Y_n converges to the moment-generating function of the normal for all t, pointwise convergence. The moment-generating function of the normal is e to the t square sigma square over 2. The moment-generating function of Y_n is equal to the expectation of e to t Y_n. The product of e to the t, 1 over square root n, X_i minus mu becomes the product for 1 to n, expectation e to the t times square root n. The n-th power of that equals the expectation of e to the t over square root n, X_i minus mu to the n-th power. The Taylor expansion is used, and as n goes to infinity, all these terms will be smaller order of magnitude than n, 1 over n.

  • 01:15:00 In this section, the speaker discusses the law of large numbers and the central limit theorem as ways to estimate the mean of a random variable. By taking many independent trials of a random variable and using them to estimate the mean, the law of large numbers states that the estimate will be very close to the actual mean if the number of trials is large enough. The central limit theorem then explains how the distribution of this estimate is around the mean, with normal distributions having very small tail distributions. However, the speaker notes that for some distributions, it's better to take a different estimator than the maximum likelihood estimator.
3. Probability Theory
3. Probability Theory
  • 2015.04.23
  • www.youtube.com
MIT 18.S096 Topics in Mathematics with Applications in Finance, Fall 2013View the complete course: http://ocw.mit.edu/18-S096F13Instructor: Choongbum LeeThis...
 

5. Stochastic Processes I



5. Stochastic Processes I

In this video on Stochastic Processes, the professor delivers a comprehensive introduction and overview of discrete-time and continuous-time stochastic processes. These probabilistic models are used to analyze random events occurring over time. The video showcases examples of simple random walk and Markov chain processes to illustrate how they address questions related to dependence, long-term behavior, and boundary events. Additionally, the Perron-Frobenius theorem is discussed, emphasizing the significance of eigenvectors and eigenvalues in determining the system's long-term behavior. The video concludes by introducing the concept of martingale processes, which serve as fair game models.

The video begins by introducing the concept of martingales in stochastic processes, which are designed to maintain an unchanged expected value. An example of a martingale is a random walk, which exhibits fluctuation while consistently maintaining an expected value of 1. The video also explains stopping times, which are predetermined strategies dependent only on the stochastic process values up to a specific point. The optional stopping theorem states that if a martingale and a stopping time tau exist, the expected value at the stopping time will be equal to the initial value of the martingale. This theorem underscores the fairness and equilibrium nature of martingale processes.

Throughout the video, various topics are covered in detail. Discrete-time and continuous-time stochastic processes are introduced, illustrating their representation through probability distributions over different paths. Examples such as a simple random walk and a coin toss game help elucidate the properties and behaviors of these processes. The importance of Markov chains is discussed, emphasizing how the future state depends solely on the current state, simplifying the analysis of stochastic processes. The notion of stationary distribution is explored, showcasing the Perron-Frobenius theorem, which establishes the existence of a unique eigenvector corresponding to the largest eigenvalue, representing the system's long-term behavior.

The video concludes by emphasizing the connection between martingales and fair games. It is noted that a martingale process ensures that the expected value remains unchanged, signifying a balanced game. Conversely, games like roulette in casinos are not martingales as the expected value is less than 0, resulting in expected losses for the players. Finally, a theorem is mentioned, suggesting that if a gambler is modeled using a martingale, regardless of the strategy employed, the balance will always be equal to the initial balance. Furthermore, the expectation of X_tau, the value at the stopping time, is always 0, indicating that, when modeled by a martingale, the player is not expected to win.

Overall, the video provides a comprehensive overview of stochastic processes, their properties, and their applications in modeling and analyzing random events.

  • 00:00:00 In this section, the professor provides an introduction to stochastic processes, a collection of random variables indexed by time. She distinguishes between discrete-time and continuous-time stochastic processes and explains that they can be represented by a set of probabilities over different paths. She gives examples of three stochastic processes, including one in which f(t) equals t with probability 1, one in which f(t) is equal to t for all t with probability 1/2, or f(t) is equal to -t for all t with probability 1/2, and one in which for each t, f(t) is equal to t or -t with probability 1/2.

  • 00:05:00 In this section, the speaker discusses the concept of stochastic processes and the different types of questions that are studied in relation to them. Stochastic processes are used to model real-life situations, such as stock prices, and involve random variables that are dependent on each other. The three main types of questions studied include dependencies in the sequence of values, long-term behavior, and boundary events. The speaker explains how each type of question relates to stochastic processes and their probability distribution.

  • 00:10:00 In this section, the topic of stochastic processes is introduced, which refers to the analysis of random events that occur over time. Specifically, the focus is on discrete-time stochastic processes, one of the most important of which is the simple random walk. This is defined as a sequence of random variables, X sub t, which is the sum of independent identically distributed (IID) variables, Y_i, that can take values of 1 or -1 with a probability of 1/2. The trajectory of the random walk can be visualized as a sequence of movements, either up or down, depending on the value of Y_i. This model will provide a foundation for understanding continuous-time stochastic processes later on in the course.

  • 00:15:00 In this section, the professor discusses the behavior of a simple random walk over a long period of time. As per the central limit theorem, the closer to 0 an X_t value gets, the smaller the variance will be, which should be around 1 over t, and the standard deviation around 1 over the square root of t. When observing X_t over the square root of t, the values will have a normal distribution, with mean 0 and variance the square root of t. Therefore, on a very large scale, a simple random walk won't deviate too far away from the square root of t and minus square root of t curves. Even though a theoretical extreme value for the walk is t and minus t, you're going to be close to the curves, playing within that area mainly. The professor mentions there's a theorem stating you will hit the two lines infinitely often.

  • 00:20:00 In this section, the properties of a random walk are discussed. The first property is that the expectation of X sub k is 0, and the second property is called independent increment. This means that if you look at what happens from time 1 to 10, it is irrelevant to what happens from 20 to 30. The third property is called stationary. It states that the distribution of X sub t+h minus X sub t is the same as the distribution of X sub h. The example of a coin toss game is used to show that if you start from $0.00 balance with a fair coin, your balance will exactly follow the simple random walk, assuming a 50-50 chance.

  • 00:25:00 In this section, the professor discusses probabilities in a random walk scenario where he flips a coin and stops either after winning $100 or losing $50. By putting a line at the two stopping points, he explains that the probability of hitting the upper line first is A over A plus B, and the probability of hitting the lower line first is B over A plus B. Using this formula, he calculates that the probability of winning $100 is 2/3 and losing $50 is 1/3. The professor then outlines how to prove this formula by defining f of k as the probability of hitting either line first when starting at position k in the random walk.

  • 00:30:00 In this section, the speaker discusses two important stochastic processes: the simple random walk and the Markov chain. The simple random walk is a process where at each step, an individual either goes up or down with a probability of 1/2. The stationary property of this process allows for easy computation of probabilities. On the other hand, a Markov chain is a collection of stochastic processes where the effect of the past on the future is summarized by the current state. The importance of the Markov chain is that the future only depends on the present, which makes it a more manageable stochastic process to analyze.

  • 00:35:00 In this section, the speaker explains the concept of discrete-time stochastic processes as a Markov chain. The example of a simple random walk is used to illustrate that the process is a Markov chain because its probability of reaching its next step only depends on the current value and not its prior values. The probability of the process can be defined mathematically, with the probability of its transition from i to j being the sum of all probabilities of going from i to all other points in the set. For a finite set S, Markov chains are easy to describe by calculating their transition probabilities.

  • 00:40:00 In this section, the speaker explains that the transition probability matrix is a crucial tool in understanding Markov chains. This matrix, which consists of the probabilities of transitioning from one state to another, possesses all the information required for predicting future transitions in a Markov chain. Using this matrix, one can determine the probability of making a transition from one state to another in any number of steps. However, it is significant to note that the state space must be finite for the transition probability matrix to exist.

  • 00:45:00 In this section, a Markov chain example of a system that can be modeled as a state set with working or broken as the states, is given. The example shows a matrix with transition probabilities between states as the probability of it being repaired and the probability of it remaining broken. The question posed is, what would be the probability distribution of the system after a long period, say 10 years, and the assumption made is that the probability distribution on day 3,650 and that on day 3,651 should be roughly the same. Under this assumption, the probability distribution observed after a long period of time will be the eigenvector of the matrix, whose eigenvalue is 1, and whose eigenvector is [p, q].

  • 00:50:00 In this section, the speaker discusses the Perron-Frobenius theorem, which states that for a transition matrix with positive entries in a Markov chain, there exists a vector satisfying Av = v. This vector is called the stationary distribution and represents the long-term behavior of the system. The largest eigenvalue of the matrix is guaranteed to be 1, and the corresponding eigenvector will be the one that represents the stationary distribution. The theorem is general and applies not just to the matrix used in the example but to any transition matrix in a Markov chain with positive entries.

  • 00:55:00 In this section, the professor discusses stationary distribution and its uniqueness related to eigenvectors and eigenvalues. The Perron-Frebenius theorem says there is only one eigenvector that corresponds to the biggest eigenvalue, which turns out to be 1. The other eigenvalues in the matrix are less than 1, which means they dissipate, but the behavior corresponding to the stationary distribution persists. In the final topic, the professor explains about martingale, which is another collection of stochastic processes, used to model a fair game. A stochastic process is considered a martingale if it is a fair game.

  • 01:00:00 In this section, the lecturer explains how a stochastic process can be a martingale, which is a fair game. In a martingale, if you look at what might happen at time t+1, the expected value has to be exactly equal to the value at time t, so the process is centered at that point. If it's like your balance in a game, you're expected to not win any money at all. The lecturer provides the example of a random walk, which is a martingale. However, a roulette game in a casino is not a martingale since the expected value is less than 0, which means the player is designed to lose money. Finally, the lecturer shows a funny example to illustrate that there are many ways a stochastic process can be a martingale, by making up the example of X_k equaling either 2 or -1, depending on the probability distribution.

  • 01:05:00 In this section, the concept of martingales was introduced, which are stochastic processes designed so that the expected value is always equal to 1. An example of a martingale is a random walk that fluctuates a lot, but in expectation, maintains an expected value of 1 at all times. The optional stopping theorem was also discussed, which states that playing a martingale game ensures that you will neither win nor lose in expectation, regardless of the strategy you use. The definition of stopping time was also explained, which is a non-negative integer valued random variable that depends only on the stochastic process up to a certain time.

  • 01:10:00 In this section, the professor explains the concept of a stopping time, which is a predefined set of strategies that only rely on the values of the stochastic process up to a certain point, making it a stopping time. He provides an example of a coin toss game and shows how the time at which the balance becomes $100 or negative $50 is a stopping time, while the time of the first peak is not, as it depends on future values. The optional stopping theorem states that if there is a martingale and a stopping time tau that is always less than or equal to a constant T, the value at the stopping time will have an expected value equal to the initial value of the martingale.

  • 01:15:00 In this section, the video discusses a theorem showing that if a gambler is modeled using a martingale, no matter which strategy is used, the gambler cannot win because the balance at the beginning is always equal to the balance when the gambler stops. Although the lecturer does not prove this theorem, they provide an interesting corollary that shows the expectation of X_tau is equal to 0. This means that no matter which case is used, whether it is stopping at $100, -50, or unbounded, the result will always return as 0. The lecturer emphasizes that the content of the theorem is interesting as it implies that if something can be modeled using a martingale, the player is not supposed to win.
5. Stochastic Processes I
5. Stochastic Processes I
  • 2015.01.06
  • www.youtube.com
MIT 18.S096 Topics in Mathematics with Applications in Finance, Fall 2013View the complete course: http://ocw.mit.edu/18-S096F13Instructor: Choongbum Lee*NOT...
Reason: