[Python] Conditional expectation given two stochastic processes

Discussão em 'Python' iniciado por Stack, Setembro 3, 2025.

  1. Stack

    Stack Membro Participativo

    I would like to compute the process Z_t=E[X_T|W_t] where W is a brownian motion (the cumulative sum of white noise) and X_t=np.sqrt(np.abs(W_t)). In Python these are

    # Parameters
    T = 1.0 # final time
    N = 1000 # number of time steps
    dt = T / N
    t = np.linspace(0, T, N+1)
    seed = 12345

    # Initialize Brownian motion
    rng = np.random.default_rng(seed)
    W = np.zeros(N+1)

    # Simulate W_t
    for k in range(N):
    dW = rng.normal(0, np.sqrt(dt))
    W[k+1] = W[k] + dW

    # Compute sqrt of absolute value
    X= np.sqrt(np.abs(W))


    But for Z I do not understand how to compute it.

    Continue reading...

Compartilhe esta Página