View source: R/histReturn_functions.R
getHistoricalReturnStats | R Documentation |
Get Historical Returns and Inflation Statistics
getHistoricalReturnStats(
stockWt,
minDate = min(sbi$Month),
maxDate = max(sbi$Month)
)
stockWt |
Numeric vector containing weightings to stocks. Weight to bonds will be 1 - stockWt. Enter as decimal so 60% is 0.60. seq(0, 1, 0.1) would produce the statistics for portfolios with weights to stocks of 0% to 100% in 10% increments. |
minDate |
Earliest historical date to use. Default is earliest in set. |
maxDate |
Latest historical date to use. Default is most recent in set. |
A list
A list with four items. portfolio is a data frame with a row for each stockWt and columns: StockWt, GeomReturn, ArithReturn, and StdDev. The second item is the inflation rate. These in decimal, not percent. The minDate and maxDate are returned.
## Not run: getHistoricalReturnStats(seq(0, 1, 0.1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.