Text this: Efficient estimation of a time-varying dimension parameter and its application to EEG analysis.