Description Usage Arguments Details Value Author(s) References Examples
Simulate returns using factor model Monte Carlo method. Parametric method like normal distribution, Cornish-Fisher and skew-t distribution for residuals can be selected. Resampling method such as non-parametric bootstrap or stationary bootstrap can be selected.
1 2 3 4 5 |
n.boot |
Integer number of bootstrap samples. |
factorData |
|
Beta.mat |
|
Alpha.mat |
|
residualData |
|
residual.dist |
character vector specifying the residual distribution. Choices are "normal" for the normal distribution; "Cornish-Fisher" for the Cornish-Fisher distribution based on the Cornish-Fisher expansion of the normal distribution quantile; "skew-t" for the skewed Student's t distribution of Azzalini and Captiano. |
boot.method |
character vector specifying the resampling method. Choices are "random" for random sampling with replacement (non-parametric bootstrap); "block" for stationary block bootstrapping. |
seed |
integer random number seed used for resampling the factor returns. |
return.factors |
logical; if |
return.residuals |
logical; if |
The factor model Monte Carlo method is described in Jiang (2009).
A list with the following components:
returns n.boot x n.funds
matrix of
simulated fund returns.
factors n.boot x
n.factors
matrix of resampled factor returns. Returned
only if return.factors = TRUE
.
residuals
n.boot x n.funds
matrix of simulated fund
residuals. Returned only if return.residuals =
TRUE
.
Eric Zivot and Yi-An Chen.
Jiang, Y. (2009). UW PhD Thesis.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | # load data from the database
data(managers.df)
fit <- fitTimeSeriesFactorModel(assets.names=colnames(managers.df[,(1:6)]),
factors.names=c("EDHEC.LS.EQ","SP500.TR"),
data=managers.df,fit.method="OLS")
factorData= managers.df[,c("EDHEC.LS.EQ","SP500.TR")]
Beta.mat=fit$beta
residualData=as.matrix(fit$resid.variance,1,6)
n.boot=1000
# bootstrap returns data from factor model with residuals sample from normal distribution
bootData <- factorModelMonteCarlo(n.boot, factorData,Beta.mat, residual.dist="normal",
residualData, Alpha.mat=NULL, boot.method="random",
seed = 123, return.factors = "TRUE", return.residuals =
"TRUE")
# Cornish-Fisher distribution
# build different residualData matrix
residualData <- cbind(c(1,2,1,3,0.1,0.5),rnorm(6),c(2,3,1,2,1,0))
colnames(residualData) <- c("var","skew","ekurt")
rownames(residualData) <- colnames(managers.df[,(1:6)])
bootData <- factorModelMonteCarlo(n.boot, factorData,Beta.mat, residual.dist="Cornish-Fisher",
residualData, Alpha.mat=NULL, boot.method="random",
seed = 123, return.factors = "TRUE", return.residuals =
"TRUE")
# skew-t distribution
# build residualData matrix
residualData <- cbind(rnorm(6),c(1,2,1,3,0.1,0.5),rnorm(6),c(2,3,1,6,10,100))
colnames(residualData) <- c("location","scale","shape","df")
rownames(residualData) <- colnames(managers.df[,(1:6)])
bootData <- factorModelMonteCarlo(n.boot, factorData,Beta.mat, residual.dist="skew-t",
residualData, Alpha.mat=NULL, boot.method="random",
seed = 123, return.factors = "TRUE", return.residuals =
"TRUE")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.