def compute_lwa(price):
    """Places greater importance on recent data using linear weights. """
    denom = len(price) * (len(price) + 1) / 2
    num = 0.0
    for i in range(len(price)):
        num += (i + 1) * price[i]
    return num / denom