Hacker News new | ask | show | jobs
by mrow84 1904 days ago
The number of possible outcomes grows exponentially with time, and so does the ensemble size required to capture the extremal behaviour. Repeated losses bring you closer to zero, which is relatively well sampled by many realisations, but repeated wins produce exponentially larger returns, and so missing out on these realisations catastrophically affects the ensemble average.

A shorter run (say 100 steps) would be more likely to capture enough realisations to produce a reasonable estimate. You could assess this behaviour yourself, for very low step numbers, by calculating the variability in a sampled ensemble average, relative to the exhaustive (i.e. true) ensemble average.

This particular problem is another consequence of the properties dynamical system being examined, but not quite the same as the issues caused by its non-ergodicity.

1 comments

I was interested in seeing the results myself, so here is some python:

    import numpy as np
    import itertools
    from matplotlib import pyplot as plt

    def ensemble_mean(outcomes):
        # Assume we are given a (K, T) array of outcomes, and compute the ensemble average
        # for T+1 time steps, starting with 1 wealth.
        K, T = outcomes.shape
        X = np.ones((K, T+1), dtype=np.float64)
        X[:, 1:] = np.where(outcomes, 1.5, 0.6)
        Z = np.cumprod(X, axis=1)
        return Z.mean(axis=0)

    time_steps = 20

    all_outcomes = np.array(list(itertools.product([0, 1], repeat=time_steps-1)))
    exhaustive_mean = ensemble_mean(all_outcomes)

    ensemble_size = 100
    ensemble_samples = 10000

    ensemble_means = np.zeros((time_steps, ensemble_samples))
    for i in range(ensemble_samples):
        print(i)
        # generate ensembles as though we were sampling (i.e. with replacement)
        J = np.random.choice(all_outcomes.shape[0], size=ensemble_size, replace=True)
        ensemble_means[:, i] = ensemble_mean(all_outcomes[J, :])

    plt.hist(ensemble_means[-1], bins=1000, histtype='step')
    plt.axvline(exhaustive_mean[-1])
    plt.title("Modal sampled ensemble mean is below true ensemble mean")
    plt.show()