Skip to content
This repository was archived by the owner on Dec 13, 2017. It is now read-only.
This repository was archived by the owner on Dec 13, 2017. It is now read-only.

Bug in Wiener_process sample_path when conditional #2

@choffstein

Description

@choffstein

First, great library!

Second, I think there is a bug when the Wiener_process is conditional (e.g. has a startPosition and an endPosition). When _sample_path is called, the startPosition is ultimately ignored in the conditional branch of the code. I believe that branch of the code should read:

else:
        """
        Alternatively, this can be accomplished by sampling directly from a multivariate normal given a linear
        projection. Ie

        N | N dot 1 = endPosition ~ Nor( 0, Sigma ), where Sigma is a diagonal matrix with elements proportional to
        the delta. This only problem with this is Sigma is too large for very large len(times).

        """
        T = self.endTime - self.startTime
        x = self.startTime

        for i, delta in enumerate( deltas ):
            x = x*(1-delta/T) + (self.endPosition - self.startPosition)*delta/T + self.sigma*np.sqrt(delta/T*(T-delta))*self.Nor.rvs(N)
            T = T - delta
            path[:,i] = x

        if abs(T -0)<1e-10:
            path[:,-1] = (self.endPosition - self.startPosition)

        path = path + self.startPosition

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions