Skip to content

Skewed error distribution #2

Description

@mohamedelghamrawy

generate_e uses np.random.uniform to sample a continuous float e_i, checks the filter condition against that float, then stores int(e_i). When e_i lands in (-1, 1), int() truncates it to 0 and silently drops the error.

With concealment_rate=1 and default params (tau=39, filterthresh=39), the accepted range for e_i always contains (-1, 1), so about 2.6% of samples can end up with error=0 due to int() truncation. Confirmed with m=1,000,000: current implementation produced 25,423 zero errors (actual concealment 0.9746). For comparison, the expected number of zero errors is ~12,658 (actual concealment rate ~0.987 or 2tau/2tau+1).

Fix: Change error sampling from e_i = np.random.uniform(-4*tau, 4*tau) to e_i = np.random.randint(-4 * tau, 4 * tau + 1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions