Describe the Bug
mkt_price is initialized as 0s, with the exception of mkt_price[0] which is set to the mean price. However, the simulation loop starts accessing the mkt_price array at idx 1, meaning that the value at mkt_price[0] is never used and instead the market price is always assumed to start at 0
Relevant Code
mkt_price = np.zeros(self.factors["n_days"])
mkt_price[0] = self.factors["mean_price"]
...
# Run simulation over time horizon.
for day in range(1, self.factors["n_days"]):
mean_val = sqrt(
sqrt(abs(self.factors["mean_price"] - mkt_price[day]))
)
mean_dir = copysign(1, self.factors["mean_price"] - mkt_price[day])
Expected Behavior
The initial market price for the simulation should be mean_price, not 0
Screenshots

image of the VS Code watch window showing that on day 1, the market price being accessed was 0 despite the mean price being set to 100