2  Worksheet 02: The main object of financial econometrics

Here I slowly flesh out some of the discussion in Section 2.1.1 to 2.1.2 of Ruppert and Matteson (2015) and adapting it to either your context or the Philippine context.

Perhaps the first thing people might associate with financial econometrics is some stock market price index. Below you will find a screenshot (as of April 23, 2026) of using the Philippine Stock Exchange Index (PSEI.PS) obtained from the interface of Yahoo! Finance:

You can choose different time periods to visualize the path of stock prices.

A more updated version of this picture may be directly accessed here. To understand the display above, we need to understand how a price index is constructed and the prices they depend on. I refer you to The Philippine Stock Exchange, Inc. for more background information.

2.1 Exercise A

Based on the factsheet of The Philippine Stock Exchange, Inc. for the PSEI, what terms are new to you? This is a good way to start looking things up. For example, the PSEI is constructed using a free float market capitalization method. What does this mean? Are there other indices in the world which use the same method? What are the differences? Is there a way to connect the base value in the fact sheet to the data found in Yahoo! Finance? What other questions can you pose?

2.2 Visualizing prices and returns

Although prices might be of interest, many users of financial data would be more interested in returns. At their core, asset returns measure outcomes of holding an asset. For the moment, we will be defining different versions of asset returns based on observed price data. This means that some entity has already collected the data for us and we are using the data for our own purposes. At this stage, we are approaching asset returns without invoking any probability theory and statistical theory. In other words, we treat asset returns just as numbers with financial context which can be computed.

Before I introduce definitions for asset returns, let us change the visualization of the stock market price index earlier and compute simple returns. I am not defining simple returns yet, but your usual understanding of returns will suffice, i.e. divide the difference between the current price and the previous price by the previous price.

Just like the visualization earlier, you can plot the daily dates on the horizontal axis and the simple returns calculated daily on the vertical axis. In other words, you can use a time series plot to visualize daily returns of the PSEI. In fact, you can also use the same lines of code for any other publicly traded stock, stock index, or asset which is tracked by Yahoo Finance.

2.3 Exercise B

You can do this by modifying the script below obtained from Scheuch et al. (2023):

install.packages("tidyfinance") # if you do not have this package installed
install.packages("tidyverse") # if you do not have this package installed
library(tidyfinance)
library(tidyverse)
prices_XXXX <- download_data( ## Change XXXX to something related to your choice of stock.
  type = "stock_prices",
  symbols = "",
  start_date = "",
  end_date = ""
)
returns_XXXX <- prices_XXXX |>
  arrange(date) |>
  mutate(ret = adjusted_close / lag(adjusted_close) - 1) |>
  select(symbol, date, ret)
  1. In your notes, make sure you have an understanding of what the lines of code are doing. After that, modify the script to either use the PSEI or your own choice of stock, stock index, or other publicly traded asset available from Yahoo Finance.

  2. Since you had exposure to a lab course in econometrics, you might have seen some of the commands already:

    1. The pipe operator %>%: It is updated to the neater |>. Refer to your past notices as to what the pipe operator does.
    2. Make sure you check the contents of the R objects prices_XXXX and returns_XXXX.
    3. select() and mutate() are part of the tidyverse. Make sure you understand what these verbs are doing. In addition, pay attention to the line containing mutate().
  3. Perhaps the new command here is lag(). We will return to this command in succeeding worksheets. But you can try exploring what lag() does to adjusted_close found in prices_XXXX. This is a good way for you to tear apart the sequences of commands and understanding what is going on.

2.4 Exercise C

Start from the code chunks provided in the previous exercise. You are going to generate time series plots of stock prices and returns. You will also be summarizing the stock returns data.

If you need help from generative AI, feel free to use it, but pay attention to how you have been using it.

Create a table in Google Docs or any other document processing software with five columns:

  1. Stock and time period
  2. Time series plot of stock prices
  3. Time series plot of stock returns
  4. Mean and standard deviation of stock returns
  5. Which generative AI tool did you use (version)? What are your prompts?

2.5 Exercise D

You will be paired with another student (or pair with someone who is working on these exercises) for this exercise. Take note that AI use is not allowed for the tasks in this exercise.

  1. Every submitter is assigned a checker.

  2. The checker has only one task. Verify for yourself the reported findings (check the company/symbols, etc) by the submitter using only the presented information by the submitter found here. Were you able to reproduce the results? Which did and which did not? Are there inaccuracies and inconsistencies? Provide a short report which the submitter can act upon.

  3. The submitter has three tasks:

    1. Act upon the findings of the checker’s report.
    2. Verify for yourself what has been submitted before here. Starting from the code chunks already provided, only paste the additional lines of code used to produce the graphs, along with the mean and standard deviation. Did you get the same results as you reported? Are the figures the same or different?
    3. If you used an AI tool, what did you actually learn that you need to change about yourself? Were the additional commands really new to you? If you did not use AI, reflect on what others have done. Be specific but direct.

2.6 Exercise E

Based on your findings and other students’ findings, do you notice more similarities than differences? Specifically:

  1. Look at the vertical axes. Comment on how spread out the values are for stock prices versus stock returns.
  2. Look at the general behvaior of stock prices versus stock returns. Comment on how you can guess what the next unobserved value could be given the graphs of stock prices and stock returns.
  3. Compare the different means and standard deviations. Is there a common pattern? What do you notice about the magnitudes of these quantities? What is the unit and the time dimension for these quantities? Do you think one can make money in the buying and selling stocks given this information?
  4. Pay attention to how other students have used AI and how they have reflected upon their use. What do you notice? Are there strange things of note?

References

Ruppert, David, and David S. Matteson. 2015. Statistics and Data Analysis for Financial Engineering: With r Examples. 2nd ed. Springer Texts in Statistics. Springer. https://doi.org/10.1007/978-1-4939-2614-5.
Scheuch, Christoph, Stefan Voigt, and Patrick Weiss. 2023. Tidy Finance with r. 1st ed. Chapman & Hall/CRC the r Series. Chapman; Hall/CRC. https://doi.org/10.1201/b23237.