Publications by C. Alberto Dorantes Dosamantes, Ph.D.
Workshop 1 Solution - Algorithms and Data Analysis
1 Data management for time-series financial variables 1.1 Data collection We start by downloading online real stock prices from Yahoo Finance. We start clearing our R environment: rm(list=ls()) # To avoid scientific notation for numbers: options(scipen=999) 1.1.1 The quantmod package The quantmod package is designed to help financial traders...
26434 sym R (17182 sym/94 pcs) 8 img 6 tbl
Workshop 4 - Data Analysis and Algorithms
1 General directions for this Workshop You will work in RStudio. You have to CAREFULLY READ the Problem Situation. This workshop will be a FIRST DRAFT of your FINAL PROJECT (PROBLEM SITUATION). Follow instructions in class to know what you need to submit in this workshop. The industry groups will be the following: Manufacturing Retail trade + Wh...
1389 sym
Workshop 8 Solution - Financial Econometrics I
1 Introduction to Categorical independent variables In the previous workshop we examined whether the market return, BMR and EPSP influence stock returns. We ran the models using both, contemporary values of the variables, and lagged values of the independent variables. Remember the time-series functions in R: lag(variable, #) refers to the Lag nu...
17842 sym R (17464 sym/38 pcs) 4 img 1 tbl
Workshop 2 - Financial Modeling and Programming
1 General directions for this Workshop You will work in RStudio. It is strongly recommended to have the latest version of R and RStudio. Once you are in RStudio, do the following. Create an R Notebook document (File -> New File -> R Notebook), where you have to write whatever is asked in this workshop. More specifically, you have to: Replicate a...
9930 sym R (8730 sym/34 pcs) 2 img
Workshop 3 - Financial Modeling and Programming
1 General directions for this Workshop You will work in RStudio. It is strongly recommended to have the latest version of R and RStudio. Once you are in RStudio, do the following. Create an R Notebook document (File -> New File -> R Notebook), where you have to write whatever is asked in this workshop. More specifically, you have to: Replicate a...
25763 sym R (10818 sym/87 pcs) 10 img
Workshop 6 Solution - Financial Econometrics II
1 Forecasting consumer demand with an ARIMAX model Assume that this industry is an oligopoly where there are few main players in the market that account for most of the market share. In an oligopoly, it is very common that price elasticity of demand is high and sensitive. In other words, when a player decreases the price of a product, it is very ...
10200 sym R (18852 sym/63 pcs) 14 img
Workshop 3 Solution - Financial Programming
1 Introduction In the following section I describe one or two approaches to solve the challenges of this workshop. Remember that these solutions are not the unique or the best solutions. You can use these solutions as guidelines to keep improving your programming skills. Remember that the only way to learn programming is PRACTICE, PRACTICE AND PR...
8968 sym R (5813 sym/43 pcs) 2 tbl
Workshop 2 Solution - Financial Econometrics II
1 Non stationary variables - The Random Walk model for stock prices The random walk hypothesis in Finance (Fama, 1965) states that the natural logarithm of stock prices behaves like a random walk with a drift. A random walk is a series (or variable) that cannot be predicted. Imagine that \(Y_t\) is the log price of a stock for today (t). The valu...
18122 sym R (4810 sym/45 pcs) 19 img
Workshop 2 Solution - Econometric Models
1 The Linear regression model The simple linear regression model is used to understand the linear relationship between two variables assuming that one variable, the independent variable (IV), can be used as a predictor of the other variable, the dependent variable (DV). In this part we illustrate a simple regression model with the Market Model. T...
17978 sym R (4227 sym/25 pcs) 2 img
Workshop 1 Solution - Financial Econometrics II
1 Introduction to time-series variables In this section we will download time-series variables from Yahoo Finance and explore the time-series datasets. More specifically, we explore the xts-zoo R objects. xts stands for “eXtensible Time Series”, and zoo is an R class for general time-series datasets. We start clearing our R environment: rm(li...
13478 sym R (1375 sym/17 pcs) 5 img