Description Usage Arguments Details Value Author(s) References See Also Examples
This is a wrapper function to fits a up and down market model for one
or more asset returns or excess returns using time series regression.
Users can choose between ordinary least squares-LS, discounted least
squares-DLS (or) robust regression. An object of class
"tsfmUpDn"
is returned.
1 2 3 | fitTsfmUpDn(asset.names, mkt.name, rf.name = NULL, data = data,
fit.method = c("LS", "DLS", "Robust"), control = fitTsfm.control(...),
...)
|
asset.names |
vector containing names of assets, whose returns or excess returns are the dependent variable. |
mkt.name |
name of the column for market returns. It is required for a up/down market model. |
rf.name |
name of the column of risk free rate variable to calculate
excess returns for all assets (in |
data |
vector, matrix, data.frame, xts, timeSeries or zoo object
containing column(s) named in |
fit.method |
the estimation method, one of "LS", "DLS" or "Robust". See details. Default is "LS". |
control |
list of control parameters. The default is constructed by
the function |
... |
arguments passed to |
fitTsfmUpDn
will use fitTsfm
to fit a time series model for up and down market respectively. If
risk free rate is provided, the up market is the excess market returns which is no less than 0.
The goal of up and down market model is to capture two different market Betas in the up and down markets.
fitTsfmUpDn
returns an object tsfmUpDn
. It supports generic function such as
summary
, predict
, plot
and print
.
It is also a list object containing Up
and Dn
. Both Up
and Dn
are class of "tsfm"
. As a result, for each list
object, The generic function such as print
, plot
, predict
and summary
methods exist for both Up
and Dn
. Also, the generic accessor functions coef
,
fitted
, residuals
and fmCov
can be applied as well.
An object of class "tsfmUpDn"
is a list containing Up
and Dn
:
Up |
An object of |
Dn |
An object of |
and others useful items:
call |
Function call. |
data |
Original data used but converted to |
Each object of tsfm
contains :
asset.fit |
list of fitted objects for each asset. Each object is of
class |
alpha |
length-N vector of estimated alphas. |
beta |
N x 1 matrix of estimated betas. |
r2 |
length-N vector of R-squared values. |
resid.sd |
length-N vector of residual standard deviations. |
call |
the matched function call. |
data |
xts data object containing the assets and factors. |
asset.names |
asset.names as input. |
factor.names |
factor.names as input. |
fit.method |
fit.method as input. |
Where N is the number of assets and T is the number of time periods.
Yi-An Chen.
Christopherson, J. A., Carino, D. R., & Ferson, W. E. (2009). Portfolio performance measurement and benchmarking. McGraw Hill Professional.
The tsfmUpDn
methods for generic functions:
plot.tsfmUpDn
, predict.tsfmUpDn
,
print.tsfmUpDn
and summary.tsfmUpDn
.
The original time series function fitTsfm
and its generic functions
application.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # load data from the database
data(managers)
# example: Up and down market factor model with LS fit
fitUpDn <- fitTsfmUpDn(asset.names=colnames(managers[,(1:6)]),mkt.name="SP500.TR",
data=managers, fit.method="LS",control=NULL)
print(fitUpDn)
summary(fitUpDn)
# A list object
fitUpDn
summary(fitUpDn$Up)
summary(fitUpDn$Dn)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.