OSglPF: Calculate portfolio weights for Garlappi model 1.2.3

Description Usage Arguments Examples

View source: R/Garlappi_PF_one.R

Description

Calculate portfolio weights for Garlappi model 1.2.2-1.2.3: Uncertainty about expected returns estimated jointly for all assets and subgroups thereof.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
OSglPF(
  factors,
  PFs,
  s.k = 1,
  imp = FALSE,
  rolling.PF = FALSE,
  rolling.eps = FALSE,
  roll.obs.PF = 120,
  roll.obs.eps = 120,
  rf = TRUE,
  gamma = 3
)

Arguments

factors,

list of factor premia xts

PFs,

list of portfolios (xts) to calculate PU for each factor premium

s.k

optional, lookback window for current observations that are related to the long-term mean

imp

optional, should missing values be imputed? (standard: FALSE)

rolling.PF

optional, should portfolio moments be calculated based on a rolling window?

rolling.eps

optional, should uncertainty moments be calculated based on a rolling window?

roll.obs.PF

optional, rolling.PF=TRUE: Length of rolling window; rolling.PF=FALSE: Initial estimation window size

roll.obs.eps

optional, rolling.eps=TRUE: Length of rolling window; rolling.eps=FALSE: Initial estimation window size

rf

optional, should the case with or without the risk-free rate be calculated (only for one PU parameter)

gamma

optional, coefficient of risk aversion (standard = 3)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(factors)
data(X)
data(Y)
# out-of-sample exercise
factors <- list(fact1=factors[,1],fact2=factors[,2])
PFs <- list(PF1=X,PF2=Y)
w1 <- OSglPF(factors,PFs, s.k=12, imp=FALSE, rolling.PF=FALSE, rolling.eps=FALSE, roll.obs.PF=120, roll.obs.eps=120)
plot(w1$epsilon)
plot(w1$weights)
plot(w1$sturb)
w2 <- OSglPF(factors,PFs, s.k=12, imp=FALSE, rolling.PF=TRUE, rolling.eps=TRUE, roll.obs.PF=120, roll.obs.eps=120)
plot(w2$epsilon)
plot(w2$weights)
plot(w2$sturb)
w3 <- OSglPF(factors,PFs, s.k=12, imp=FALSE, rolling.PF=FALSE, rolling.eps=TRUE, roll.obs.PF=120, roll.obs.eps=120)
plot(w3$epsilon)
plot(w3$weights)
plot(w3$sturb)

sstoeckl/uncertaintymeasures documentation built on Nov. 7, 2021, 5:20 p.m.