Publications by Leo Tzang

HW2

10.04.2024

library(ISLR2) names(Smarket) ## [1] "Year" "Lag1" "Lag2" "Lag3" "Lag4" "Lag5" ## [7] "Volume" "Today" "Direction" dim(Smarket) ## [1] 1250 9 summary(Smarket) ## Year Lag1 Lag2 Lag3 ## Min. :2001 Min. :-4.922000 Min. :-4.922000 Min. :-4.92...

47 sym R (6148 sym/42 pcs) 2 img

HW3__Oyuntuya

31.03.2024

Using the attached data file myetf4.csv to answer the following questions:  Question 1 Try to find the GMVP for 4 Taiwan ETFs: “0050”,“0056”,“006205” and “00646”. Using 2015/12/14-2018/12/28 daily returns as the insample data, you have to compute optimal weights for 4 ETFs based on daily returns of the period.  Based on the weig...

589 sym R (4315 sym/18 pcs)

Document

31.03.2024

library(quadprog) returns_data <- matrix(c( 0.01, 0.02, -0.01, 0.005, # Daily returns for ETF "0050" (complete the sequence) 0.015, 0.018, -0.012, 0.008, # Daily returns for ETF "0056" (complete the sequence) 0.012, 0.025, -0.015, 0.007, # Daily returns for ETF "006205" (complete the sequence) 0.009, 0.021, -0.008, 0.006 # Daily return...

5 sym R (1645 sym/2 pcs)

Document

21.03.2024

library(ISLR) library(tidymodels) ## ── Attaching packages ────────────────────────────────────── tidymodels 1.1.1 ── ## ✔ broom 1.0.5 ✔ recipes 1.0.10 ## ✔ dials 1.2.1 ✔ rsample 1.2.0 ## ✔ dplyr 1.1.4 ✔ tib...

22 sym R (3810 sym/17 pcs) 2 img

Document

21.03.2024

library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.5.0 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.3 ✔ tidyr 1.3.1 ## ...

10 sym R (1030 sym/5 pcs) 2 img

Document

20.03.2024

# 3.6.1 to 3.6.6. library(MASS) library(ISLR) data("Boston") attach(Boston) lm.fit <- lm(medv ~ lstat, data = Boston) lm.fit ## ## Call: ## lm(formula = medv ~ lstat, data = Boston) ## ## Coefficients: ## (Intercept) lstat ## 34.55 -0.95 # Load Boston dataset data(Boston) # Fit a simple linear regression model lm.fit <- lm...

56 sym R (10570 sym/44 pcs) 9 img

Homework1

20.03.2024

# 3.6.1 to 3.6.6. library(ISLR2) data("Boston") attach(Boston) lm.fit <- lm(medv ~ lstat, data = Boston) lm.fit ## ## Call: ## lm(formula = medv ~ lstat, data = Boston) ## ## Coefficients: ## (Intercept) lstat ## 34.55 -0.95 summary(lm.fit) ## ## Call: ## lm(formula = medv ~ lstat, data = Boston) ## ## Residuals: ## M...

56 sym R (10312 sym/44 pcs) 9 img

Document

10.03.2024

# chapter5 cfa1 prob_equities <- 0.6 prob_tbills <- 0.4 expected_return_equities <- 50000 expected_return_tbills <- -30000 expected_risk_premium <- expected_return_equities - expected_return_tbills print(paste("Expected risk premium:", expected_risk_premium)) ## [1] "Expected risk premium: 80000" # chapter6 problem set 10 # Given data weights_bi...

28 sym

Publish Document 110035145 羅暐傑

09.01.2024

library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union library(tidyr) library(readr) unique_categories <- read_csv("bike folder/bike_orderlines.csv") ## Rows: 15644 Column...

24 sym R (2995 sym/21 pcs)

Final

09.01.2024

#1. Count the usefulness by learning platform library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.4 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.4.4 ✔ tibble 3.2.1 ## �...

16 sym R (6108 sym/12 pcs) 1 img