def itemReadPredicted(W, A, R, t):
    """Weight predicted at time t.
    
    Weight predicted by given weight vector W at time t given
        arrival and removal matrices A and R.

    Args:
        W: R^N weight vector where N is the number of ItemReads.
        A: R^{TxN} arrival matrix where A[t][i] is whether 
            ItemRead i arrived at time t.
        R: R^{TxN} removal matrix where R[t][i] is whether 
            ItemRead i was removed at time t.
        t: time.
    
    Returns:
        Predicted weight.
    """
    return sum([w*(a-r) for (w, a, r) in zip(W, A[t], R[t]) if a-r and w!=None])