Estimating a Structural Model of Herd Behavior in Financial Markets