Publications by Christian Piereth
Document
# Load packages # Core library(tidyverse) library(tidyquant) # time series library(timetk) Goal Simulate future portfolio returns five stocks: “SPY”, “EFA”, “IJS”, “EEM”, “AGG” market: “SPY” from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = symbol...
414 sym R (8264 sym/35 pcs) 2 img
Document
# Load packages # Core library(tidyverse) library(tidyquant) Goal Examine how each asset contributes to portfolio standard deviation. This is to ensure that our risk is not concentrated in any one asset. 1 Import stock prices Choose your stocks from 2012-12-31 to present. symbols <- c("IVV", "VOO", "VTSAX", "VSMPX", "FBGRX") prices <- tq_get(x ...
562 sym R (27485 sym/24 pcs) 1 img
Document
# 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”, “IJS”, �...
646 sym R (15074 sym/24 pcs) 1 img
Document
Import your data data(flights) data(quakes) 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 m...
527 sym 4 tbl
Document
# Load packages # Core library(tidyverse) library(tidyquant) library(nycflights13) Functions When you should 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$a, na.rm = T...
271 sym R (2533 sym/26 pcs)
Publish Document
# 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("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = symbols, ...
483 sym R (3938 sym/18 pcs) 2 img
Publish Document
# Load packages # Core library(tidyverse) library(tidyquant) Goal 1 Import stock prices symbols <- c("VOO", "IVV", "^IXIC", "VTSAX", "FBGRX") prices <- tq_get(x = symbols, get = "stock.prices", from = "2012-12-31", to = "2017-12-31") 2 Convert prices to returns (monthly) asset_returns_tbl <- pr...
554 sym R (3360 sym/17 pcs) 1 img
Document
# 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 = symbols, ...
447 sym R (4542 sym/18 pcs) 3 img
Publish Document
# 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("IVV", "VOO", "VTSAX", "FBGRX", "VSMPX") prices <- tq_get(x = symbols, ...
811 sym R (3287 sym/16 pcs) 1 img
Document
# 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("IVV", "VOO", "VTSAX", "VSMPX", "FBGRX") prices <- tq_get(x = symbols...
425 sym R (4257 sym/18 pcs) 3 img