if (FALSE) { # interactive()
older_member <- HouseholdMember$new(
name = "older",
birth_date = "1980-02-15",
mode = 80,
dispersion = 10
)
household <- Household$new()
household$add_member(older_member)
household$expected_income <- list(
"income" = c(
"members$older$age <= 65 ~ 9000 * 12"
)
)
household$expected_spending <- list(
"spending" = c(
"members$older$age <= 65 ~ 5000 * 12",
"TRUE ~ 4000 * 12"
)
)
portfolio <- create_portfolio_template()
portfolio$accounts$taxable <- c(10000, 30000)
portfolio <-
portfolio |>
calc_effective_tax_rate(
tax_rate_ltcg = 0.20,
tax_rate_ordinary_income = 0.40
)
scenario <-
simulate_scenario(
household = household,
portfolio = portfolio,
# monte_carlo_samples = 100,
current_date = "2020-07-15"
)
plot_future_spending(scenario, "monthly")
plot_future_spending(
scenario,
"monthly",
discretionary_spending_position = "top"
)
plot_future_spending(scenario, "monthly", "non-discretionary")
# If Monte Carlo samples are present:
# plot_future_spending(scenario, "monthly", "discretionary")
}
Run the code above in your browser using DataLab