Description Usage Arguments Examples
View source: R/Garlappi_PF_one.R
Calculate portfolio weights for Garlappi model 1.2.2-1.2.3: Uncertainty about expected returns estimated jointly for all assets and subgroups thereof.
1 2 3 4 5 6 7 8 9 10 11 12 |
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) |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.