Dynamics of Phase Transitions in Expectations for Financial Markets: An Agent-Based, Multicomponent Model