Fixed issue #15 by adding drift and scale to BrownianMotion._sample_brownian_motion_at.
The _sample_gaussian_noise_at(times) return a vector of gaussian noise for the time t's in times. This means that every element in the output vector is scaled by the increments in times. Multiplying the output vector with the scale parameter gives the correct scaling.
The drift can simply be added to the output vector by adding the product of the drift and times vector, as drift is proportional to time.
The operations are now something like this.
mu_tt + sig_tdiff sig_scale * X, for X~N(0,1)
It could have been possible to add the drift part before the np.cumsum by adding the t_diff * drift to each element in the vector, but this is mathematically the same.
I'm not really experienced with contributing to other libraries, so I hope this all will go well.
Fixed issue #15 by adding drift and scale to BrownianMotion._sample_brownian_motion_at.
The _sample_gaussian_noise_at(times) return a vector of gaussian noise for the time t's in times. This means that every element in the output vector is scaled by the increments in times. Multiplying the output vector with the scale parameter gives the correct scaling.
The drift can simply be added to the output vector by adding the product of the drift and times vector, as drift is proportional to time.
The operations are now something like this. mu_tt + sig_tdiff sig_scale * X, for X~N(0,1)
It could have been possible to add the drift part before the np.cumsum by adding the t_diff * drift to each element in the vector, but this is mathematically the same.
I'm not really experienced with contributing to other libraries, so I hope this all will go well.