Publications by Enkhbayasgalan Munkhbaatar
Enkhbayasgalan_112035145
library(tidyquant) ## Loading required package: lubridate ## ## Attaching package: 'lubridate' ## The following objects are masked from 'package:base': ## ## date, intersect, setdiff, union ## Loading required package: PerformanceAnalytics ## Loading required package: xts ## Loading required package: zoo ## ## Attaching package: 'zoo' ## The...
33 sym R (8851 sym/30 pcs)
in class exercise
Run the codings in week 8 and post your link on RPubs. 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.1 ✔ tibble 3...
80 sym R (7484 sym/20 pcs) 2 img
HW
By following the 5 factor model and 10 industry monthly returns based on Fama-French database website. (https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html), you can construct the MVP portfolio and its monthly returns using the previous 5-year monthly returns data. Show its cumulative returns starting from 1969. library(tidyve...
351 sym R (4782 sym/11 pcs) 1 img
In class exercise 3
#Resampling Methods library(tidymodels) ## ── Attaching packages ────────────────────────────────────── tidymodels 1.2.0 ── ## ✔ broom 1.0.5 ✔ recipes 1.0.10 ## ✔ dials 1.2.1 ✔ rsample 1.2.1 ## ✔ dplyr 1.1.4 �...
43 sym R (11560 sym/39 pcs) 1 img
Enkhbayasgalan_112035145
install.packages("rlang") ## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.4' ## (as 'lib' is unspecified) library(tidymodels) ## ── Attaching packages ────────────────────────────────────── tidymodels 1.2.0 ── ## ✔ broom 1.0.5 ✔ ...
19 sym R (1568 sym/15 pcs) 1 img
Enkhbayasgalan_112035145
etf6 <- read.table('ETF6_20080101-20200430.csv', sep = ',', header = T) # head(etf6) ## 證券代碼 簡稱 年月日 收盤價.元. ## 1 0050 元大台灣50 20080102 39.6472 ## 2 0052 富邦科技 20080102 27.0983 ## 3 0056 元大高股息 20080102 14.5739 ## 4 0050 元大台灣50 20080103 38....
42 sym R (6621 sym/38 pcs) 1 img
Enkhbayasgalan_112035145
Q1. This question should be answered with data mtcars. # Load necessary packages install.packages(c("psych", "tidyverse", "tidymodels", "vip", "ISLR2")) ## Installing packages into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3' ## (as 'lib' is unspecified) library(ISLR2) library(psych) library(tidyverse) ## ── Attaching core tidyverse packages �...
998 sym R (16423 sym/56 pcs) 7 img
Enkhbayasgalan_112035145
library(MASS) table(iris$Species) ## ## setosa versicolor virginica ## 50 50 50 lookup <- c(setosa='blue', versicolor='green', virginica='orange') col.ind <- lookup[iris$Species] pairs(iris[-5], pch=21, col="gray", bg=col.ind) lda.fit <- lda(Species ~ ., data = iris) lda.fit ## Call: ## lda(Species ~ ., data = iris) ...
18 sym R (1749 sym/13 pcs) 2 img
Enkhbayasgalan
## Loading required package: lubridate ## ## Attaching package: 'lubridate' ## The following objects are masked from 'package:base': ## ## date, intersect, setdiff, union ## Loading required package: PerformanceAnalytics ## Loading required package: xts ## Loading required package: zoo ## ## Attaching package: 'zoo' ## The following objects ...
81 sym Python (11380 sym/37 pcs)
Enkhbayasgalan_112035145
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