Publications by Amanda Simpson
Apply 7
# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and compare skewness of your portfolio and its assets. Choose your stocks. from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("AMZN", "MSFT", "HD", "WMT") prices <- tq_get(x = symbols, get = "stock.prices", f...
567 sym R (4309 sym/17 pcs) 1 img
Code Along 8
# Load packages # Core library(tidyverse) library(tidyquant) Goal Collect individual returns into a portfolio by assigning a weight to each stock five stocks: “SPY”, “EFA”, “IJS”, “EEM”, “AGG” from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = sy...
429 sym R (3963 sym/16 pcs) 3 img
Apply 8
# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and examine changes in the underlying trend in the downside risk of your portfolio in terms of kurtosis. Choose your stocks. from 2012-12-31 to present 1 Import stock prices symbols <- c("AMZN", "MSFT", "HD", "WMT") prices <- tq_get(x = symbols, ...
604 sym R (4596 sym/17 pcs) 1 img
Code Along 9
# Load packages # Core library(tidyverse) library(tidyquant) Goal Collect individual returns into a portfolio by assigning a weight to each stock five stocks: “SPY”, “EFA”, “IJS”, “EEM”, “AGG” from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = sy...
447 sym R (4945 sym/18 pcs) 3 img
Apply 9
# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and examine changes in the underlying trend in the performance of your portfolio in terms of Sharpe Ratio. Choose your stocks. from 2012-12-31 to present 1 Import stock prices symbols <- c("AMZN", "MSFT", "HD", "WMT") prices <- tq_get(x = symbols, ...
598 sym R (5122 sym/19 pcs) 1 img
Code Along 10
# Load packages # Core library(tidyverse) library(tidyquant) Goal Collect individual returns into a portfolio by assigning a weight to each stock five stocks: “SPY”, “EFA”, “IJS”, “EEM”, “AGG” from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = sy...
484 sym R (5321 sym/21 pcs) 2 img
Apply 10
# Load packages # Core library(tidyverse) library(tidyquant) Goal Calculate and visualize your portfolio’s beta. Choose your stocks and the baseline market. from 2012-12-31 to present 1 Import stock prices symbols <- c("AMZN", "MSFT", "HD", "WMT") prices <- tq_get(x = symbols, get = "stock.prices", ...
574 sym R (6335 sym/23 pcs) 1 img
Code Along 11
# Load packages # Core library(tidyverse) library(tidyquant) Ch19 Functions Introduction When Should You write a function? # For reproducible work set.seed(1234) # Create a data frame df <- tibble::tibble( a = rnorm(10), b = rnorm(10), c = rnorm(10), d = rnorm(10) ) # Rescale each column df$a <- (df$a - min(df$...
300 sym R (2537 sym/23 pcs)
Apply 11
Import your data data(flights) flights %>% skimr::skim() Data summary Name Piped data Number of rows 336776 Number of columns 19 _______________________ Column type frequency: character 4 numeric 14 POSIXct 1 ________________________ Group variables None Variable type: character skim_variable n_missing complete_rate min max empty n...
526 sym 4 tbl
Code Along 12
# Load packages # Core library(tidyverse) library(tidyquant) library(readr) # Time series library(lubridate) library(tibbletime) # modeling library(broom) Goal Examine how each asset contributes to portfolio standard deviation. This is to ensure that our risk is not concentrated in any one asset. five stocks: “SPY”, “EFA”, ...
682 sym R (15760 sym/23 pcs) 2 img