Publications by Mark Raphael T. Flores
Document
asset.names <- c("MSFT", "NORD", "SBUX") mu.vec = c(0.0427 , 0.0015 , 0.0285) names(mu.vec) = asset.names sigma.mat = matrix(c(0.0100 , 0.0018 , 0.0011 ,0.0018 , 0.0109 ,0.0026 ,0.0011 , 0.0026 , 0.0199) ,nrow=3, ncol =3) dimnames(sigma.mat) = list(asset.names , asset.names) mu.vec ## MSFT NORD SBUX ## 0.0427 0.0015 0.0285 sigma.ma...
22 sym R (1380 sym/16 pcs)
Midterm Exam in Portfolio Analysis
library(quantmod) ## Loading required package: xts ## Loading required package: zoo ## ## Attaching package: 'zoo' ## The following objects are masked from 'package:base': ## ## as.Date, as.Date.numeric ## Loading required package: TTR ## Registered S3 method overwritten by 'quantmod': ## method from ## as.zoo.data.frame...
1467 sym R (26968 sym/96 pcs) 2 img
CAPM Practice
Homework Single factor model using capm.csv rm(list=ls()) 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(tidyquant) ## Loading req...
896 sym R (5072 sym/37 pcs)
Publish Document
library(readr) retdata = read.csv('m-fac9003.csv') t = dim(retdata)[1] market = retdata[,14] riskfree = retdata[,14] retdata1 = retdata[,c(-14, -15)] retdata1 = as.matrix(retdata1) head(retdata1) ## AA AGE CAT F FDX GM HPQ KMB MEL NYT PG ## [1,] -16.40 -12.17 -4.44 -0.06 -2.28 -2.12 -6.19 -11.01 -10...
602 sym R (5025 sym/26 pcs) 3 img
Publish Document
library(readr) retdata = read.csv('m-fac9003.csv') t = dim(retdata)[1] market = retdata[,14] riskfree = retdata[,14] retdata1 = retdata[,c(-14, -15)] retdata1 = as.matrix(retdata1) head(retdata1) ## AA AGE CAT F FDX GM HPQ KMB MEL NYT PG ## [1,] -16.40 -12.17 -4.44 -0.06 -2.28 -2.12 -6.19 -11.01 -10...
393 sym R (4730 sym/24 pcs) 3 img
Document
etf4.df <- read.csv('myetf4.csv') str(etf4.df) ## 'data.frame': 751 obs. of 5 variables: ## $ Index : chr "2015-12-14" "2015-12-15" "2015-12-16" "2015-12-17" ... ## $ X0050 : num 53.3 53.3 54.1 54.8 54.5 ... ## $ X0056 : num 18.2 18.4 18.6 18.8 18.9 ... ## $ X006205: num 31.1 31.6 31.6 32.2 32.2 ... ## $ X00646 : num 19.6 19.6 19...
671 sym R (8012 sym/54 pcs)
Document
library(readr) library(xts) ## Loading required package: zoo ## ## Attaching package: 'zoo' ## The following objects are masked from 'package:base': ## ## as.Date, as.Date.numeric library(PerformanceAnalytics) ## ## Attaching package: 'PerformanceAnalytics' ## The following object is masked from 'package:graphics': ## ## legend librar...
727 sym R (9982 sym/78 pcs) 1 img
Document
library(readr) retdata = read.csv('m-fac9003.csv') t = dim(retdata)[1] market = retdata[,14] riskfree = retdata[,14] retdata1 = retdata[,c(-14, -15)] retdata1 = as.matrix(retdata1) head(retdata1) ## AA AGE CAT F FDX GM HPQ KMB MEL NYT PG ## [1,] -16.40 -12.17 -4.44 -0.06 -2.28 -2.12 -6.19 -11.01 -10...
300 sym R (4215 sym/21 pcs) 2 img
Document
#================================================================================================ # https://systematicinvestor.wordpress.com/2011/12/13/backtesting-minimum-variance-portfolios/ # # Load Systematic Investor Toolbox (SIT) # setInternet2(TRUE) rm(list=ls()) con = gzcon(url('https://github.com/systematicinvestor/SIT/raw/master/sit.gz...
2187 sym R (13726 sym/34 pcs) 2 img