plot_sensivities: Stress-Test a Dynamic Strategy

Description Usage Arguments Value Examples

View source: R/plot_sensivities.R

Description

This function loops over one of the arguments in simulate_strategy to make explicit the impact of a variable in the desired allocation policy.

Usage

1
plot_sensivities(strategy, variable, from, to, size, ...)

Arguments

strategy

An object of the DynamicStrategies class.

variable

A character with the parameter to loop-over.

from

An integer with the initial parameter value.

to

An integer with the final parameter value.

size

A integer with the total number of iterations.

...

Currently not used.

Value

A ggplot2 object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# stress-test the `max_utility` strategy by changing the `allocation` parameter
x <- simulate_strategy()
plot_sensivities(strategy = x, variable = "allocation", from = 0.0, to = 1, size = 20)

# stress-test the `cppi` strategy by changing the `floor` parameter
y <- simulate_strategy(strategy = "cppi")
plot_sensivities(strategy = y, variable = "floor", from = 7000, to = 9000, size = 20)

# stress-test on the `obpi` strategy by changing the risk-free rate
y <- simulate_strategy(strategy = "obpi")
plot_sensivities(strategy = y, variable = "rf", from = 0, to = 0.2, size = 20)

Reckziegel/DynamicStrategies documentation built on Dec. 18, 2021, 9:54 a.m.