backtest-functions | R Documentation |
Default windows, strategy and smoothing functions used for portfolio backtesting.
equidistWindows(data, backtest = portfolioBacktest())
tangencyStrategy(data, spec = portfolioSpec(), constraints = "LongOnly",
backtest = portfolioBacktest())
emaSmoother(weights, spec, backtest)
data |
a multivariate time series described by an S4 object of class
|
backtest |
an S4 object of class |
spec |
an S4 object of class |
constraints |
a character string vector, containing the constraints of the form |
weights |
a numeric vector, containing the portfolio weights of an asset |
equidistWindows:
Defines equal distant rolling windows.
The function requires two arguments: data
and
backtest
, see above. To assign the horizon
value to the backtest specification structure, use the function
setWindowsHorizon
.
tangencyStrategy:
A pre-defined tangency portfolio strategy.
The function requires four arguments: data
, spec
,
constraints
and backtest
, see above.
emaSmoother:
A pre-defined weights smoother (EMA) for portfolio backtesting.
The function requires three arguments: weights
, spec
and backtest
, see above. To assign initial starting weights,
smoothing parameter (lambda) or whether to perform double smoothing
to the backtest specification structure, use the functions
setSmootherInitialWeights
, setSmootherLambda
and setSmootherDoubleSmoothing
, respectively.
equidistWindows
function returns the "from" and "to" dates of the rolling window
in a list form.
tangencyStrategy
function returns a S4 object of class "fPORTFOLIO"
.
emaSmoother
function returns a numeric vector of smoothed weights.
W\"urtz, D., Chalabi, Y., Chen W., Ellis A. (2009); Portfolio Optimization with R/Rmetrics, Rmetrics eBook, Rmetrics Association and Finance Online, Zurich.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.