A user should be able to set up some initial conditions (accounts, plannees, strategies) and then instruct Forecaster to run multiple simulations, varying only the values of Scenario. This should be easy to do with the existing structure of Forecaster - the major task is finding a good way to vary Scenario.
One can imagine varying Scenario in various ways. A user should be able to provide a mechanism for generating various Scenario objects. Consider implementing an iterable class (ScenarioSampler) which yields Scenario objects according to some internal logic. Perhaps it should have a sample() method which generates a Scenario object in some sensible way.
Consider implementing ScenarioSamplerABC as an abstract base class and leaving it to subclasses to implement sample(), since most reasonable implementations are likely to contribute some complexity (and require some imports - e.g. of numpy). That will add a lot of weight to the class that we really don't want to flow down to every subclass.
For example, a subclass of ScenarioSamplerABC might use numpy to construct a (joint) probability distribution based on historical returns data and then sample from the distribution to generate new Scenario objects. A simpler implementation might simply generate pseudorandom values within a range.
A user should be able to set up some initial conditions (accounts, plannees, strategies) and then instruct
Forecaster
to run multiple simulations, varying only the values ofScenario
. This should be easy to do with the existing structure ofForecaster
- the major task is finding a good way to varyScenario
.One can imagine varying
Scenario
in various ways. A user should be able to provide a mechanism for generating variousScenario
objects. Consider implementing an iterable class (ScenarioSampler
) which yieldsScenario
objects according to some internal logic. Perhaps it should have asample()
method which generates aScenario
object in some sensible way.Consider implementing
ScenarioSamplerABC
as an abstract base class and leaving it to subclasses to implementsample()
, since most reasonable implementations are likely to contribute some complexity (and require some imports - e.g. of numpy). That will add a lot of weight to the class that we really don't want to flow down to every subclass.For example, a subclass of
ScenarioSamplerABC
might use numpy to construct a (joint) probability distribution based on historical returns data and then sample from the distribution to generate newScenario
objects. A simpler implementation might simply generate pseudorandom values within a range.