Академический Документы
Профессиональный Документы
Культура Документы
Road map
Overview of factorAnalytics
Risk Management
Background of factorAnaltyics
Main Functions
Estimating: fitTimeSeriesFactorModel.r,
fitFundamentalFactorModel.r, fitStatisticalFactorModel.r
Introduction
Assumption
1. The common risk factors, ft , are stationary with unconditional
moments
E[ft ] = f
cov(ft ) = E[(ft f )(ft f )] = f
2. Asset specific returns, it , are uncorrelated to each common risk
factors fkt .
cov(fkt , it ) = 0, k, i, t
3. Error terms, it , are serially uncorrelated and contemporaneously
uncorrelated across assets
cov(it , jt ) = i2 , i = j, t = s
= 0, otherwise
Factor Model:
Rit = i + i ft + it
According to different model setup, 3 main different types of models:
Common factor ft is known, it is called time series factor model.
Ri is T 1,
i is scalar,
F is T K common risk factors,
i is K 1 vector,
E[2i ] = i2 , time-series homoskedasticity.
fitTimeSeriesFactorModel()
> args(fitTimeSeriesFactorModel)
function (assets.names, factors.names, data = data, num.factor.s
fit.method = c("OLS", "DLS", "Robust"), variable.selection =
decay.factor = 0.95, nvmax = 8, force.in = NULL, subsets.met
"backward", "forward", "seqrep"), lars.criteria = "Cp",
add.up.market.returns = FALSE, add.quadratic.term = FALSE,
excess.market.returns.name)
(Go to R script.)
Factor Analysis
Rt = + |{z}
B ft + t , t = 1, , T
|{z}
|{z} |{z}
|{z}
N1
NK
NK K 1
N1
. . .
= [p1 ..p2 .. ..pN ], P
= P
1
P
= diag(
1 , ,
N ),
1 >
2 > >
N
(Go to R script)
N1 11
N1
fitFundamentalFactorModel()
> args(fitFundamentalFactorModel)
function (data, exposure.names, datevar, returnsvar, assetvar,
wls = TRUE, regression = "classic", covariance = "classic",
full.resid.cov = FALSE, robust.scale = FALSE,
standardized.factor.exposure = FALSE, weight.var)
(Go to R script)
Cont.
> args(fitFundamentalFactorModel)
function (data, exposure.names, datevar, returnsvar, assetvar,
wls = TRUE, regression = "classic", covariance = "classic",
full.resid.cov = FALSE, robust.scale = FALSE,
standardized.factor.exposure = FALSE, weight.var)
(Go to R script)
f 0
2
=
FM
= f ,
f
0 1
K
+1
X
j=1
RM()
j
j
RM()
RM()
RM()
+ 2
+ + K +1
1
2
K +1
RM()
RM()
RM()
+ + K
+
= 1
1
K
= 1
Terminology
Factor j marginal contribution to risk
RM()
j
Factor j contribution to risk
RM()
j
j
Factor j percentage contribution to risk
)
1 RM(
1
RM()
VaRFM ()
j = 1, , K + 1
= E[ft |Rt = VaRFM ()],
j
ETLFM
()
j = 1, , K + 1
= E[ft |Rt VaRFM ()],
j
Remarks:
(Go to R script)
Use full history for factors (t=1, ,T) and observed history for asset
returns (t=ti , , T ). Data structure is unequal.
Do not assume full parametric distributions for assets returns and
risk factor returns
Estimate tail risk and related measures non-parametrically from
simulated return data
Simulation Algorithm
Estimate factor models for each asset using partial history for assets and
risk factors.
Rit =
it + i ft + it , t = ti , , T
Simulate B values of risk factors by resampling with replacement from
full history of risk factor:
f1 , , fB
Simulate B values of the factor model residuals from empirical
distribution or fitted non-normal distribution
1 , , B
Create pseudo factor model returns from fitted factor model parameters,
simulated factor variables and simulated residuals:
Rit = i ft + it , t = 1, , B
It is downloable on R-forge
https://r-forge.r-project.org/R/?group_id=579