Dynamic component detection in a multifactor model for stock returns