Nothing
test_that("plotting optimal portfolio", {
older_member <- HouseholdMember$new(
name = "older",
birth_date = "1980-02-15"
)
older_member$mode <- 80
older_member$dispersion <- 10
household <- Household$new()
household$add_member(older_member)
household$risk_tolerance <- 0.1
household$expected_income <- list(
"income_older" = c(
)
)
household$expected_spending <- list(
"spending1" = c(
)
)
current_date <- "2020-07-15"
portfolio <- generate_test_asset_returns(2)$returns
if (interactive()) print(portfolio, width = Inf)
optimal_portfolio <-
calc_optimal_asset_allocation(
household = household,
portfolio = portfolio,
current_date = current_date
)
plot1 <- function() plot_optimal_portfolio(
portfolio = optimal_portfolio
); if (interactive()) print(plot1())
vdiffr::expect_doppelganger("plot1", plot1)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.