Documentation
¶
Overview ¶
Package sim runs financial simulation. It generates cycles from data, and runs strategies on each cycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cycles ¶
Cycles generates num cycles of length size from data, moving from the end:
data[size:], data[size-12:len(data)-12], etc.
func NewRunner ¶
func NewRunner(cycles, cycleLenMonths int, rfs []strategy.RebalanceFunc) *runner
NewRunner creates a runner to run simulations with cycles of given length in months and rebalancers.
Types ¶
type Result ¶
type Result struct {
// Start is the beginning balance.
Start fin.Cents
// End holds descriptive statistics of the end balance of a sample of
// multiple cycles, run through simulation.
End stat.Description
}
Result is a output of a simulation. It holds the beginning balance and descriptive statistics about the end sample.
Click to show internal directories.
Click to hide internal directories.