|
From: U.Mutlu <um...@mu...> - 2023-09-10 00:24:23
|
Hmm, are you sure Luigi? B/c it does not work.
I have such a code and using timeSteps = 1.
How do you mean one can get out 2 values from this path?
Is it possible at all? It seems not possible.
...
PathGenerator<RandomSequenceGenerator<MersenneBoxMuller>>
gbmPathGenerator(gbm, t, timeSteps, gsg, false);
const Path& samplePath = gbmPathGenerator.next().value;
for (size_t j = 0; j < timeSteps; ++j)
{
const auto Sx = samplePath.at(j);
...
Luigi B. <lui...@gm...> on 2023-09-05 12:47:38 wrote:
>
> the first point of the path corresponds to t=0, therefore it contains
> the starting price. Passing timeSteps = 1 to the generator should give you
> sample paths with 2 points, that is, the starting point and the one after
> the time step.
>
>
> > On Mon, Sep 4, 2023 at 10:54 PM U.Mutlu <um...@mu...> wrote:
> >
> > I've the following, possibly very old, code for generating GBM values.
> > It practically requires that nIntervalls_in_t (ie. timeSteps)
> > must be >= 2 b/c the first generated value always equals the passed
> > startingPrice.
> > Is this behavior hardcoded in QuantLib or can this be overridden
> > via a setting or function call, so that it shall not return always
> > the startingPrice as the first value
|