Description Usage Arguments Details Value See Also Examples
Given the portfolio weights and a toy market, the function Invest
simulates the growth of $1 of the corresponding portfolio and that of the benchmark.
1 |
market |
a |
weight |
the portfolio weights. The portfolio weights must be non-negative and sum to one (full investment with no short sales). It can be a |
plot |
|
The relative value in the second plot is the ratio of the growth of $1 of the portfolio to that of the benchmark. It is called relative because the value is normalized by the value of the benchmark portfolio.
A list containing the following components.
growth |
a |
R |
a |
r |
a |
1 2 3 4 5 | # Performance of the equal-weighted portfolio
data(applestarbucks)
market <- toymkt(applestarbucks)
weight <- c(0.5, 0.5) # equal-weighted portfolio
result <- Invest(market, weight, plot = TRUE)
|
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
Warning message:
In toymkt(applestarbucks) :
Since initial.weight is not given, the benchmark is assumed to be equal-weighted initially.
Warning message:
In Invest(market, weight, plot = TRUE) :
Since only one weight vector is supplied, the portfolio is assumed to be constant-weighted.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.