Learn R Programming

RelValAnalysis (version 1.0)

Invest: Investing in a Toy Market

Description

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.

Usage

Invest(market, weight, plot = TRUE)

Arguments

Value

A list containing the following components.growtha zoo object representing the growth of $1 of the portfolio and the benchmark.Ra zoo object of simple returns of the two portfolios.ra zoo object of log returns of the two portfolios.

Details

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.

See Also

toymkt

Examples

Run this code
# 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)

Run the code above in your browser using DataLab