def portfolio_r(w, R):
    """
    comput portfolio (daily) return as Pr = w'R
    
    w: stock weight, series
    R: stock return, series
    """
    W_tmp = w.reindex(R.index).fillna(0)
    W_tmp = W_tmp / W_tmp.sum()
    return (R * W_tmp).sum()
