def test_continuous_regression_with_overlap():
 signal = np.zeros(100000)
 times = [1000, 2500, 3000, 5000, 5250, 7000, 7250, 8000]
 events = np.zeros((len(times), 3), int)
 events[:, 2] = 1
 events[:, 0] = times
 signal[events[:, 0]] = 1.0
 effect = hann(101)
 signal = np.convolve(signal, effect)[:len(signal)]
 raw = RawArray(signal[np.newaxis, :], mne.create_info(1, 100, 'eeg'))
 assert_allclose(effect, linear_regression_raw(raw, events, {1: 1}, tmin=0)[1].data.flatten())

def test_continuous_regression_with_overlap ( ) : signal = np . zeros ( 100000 ) times = [ 1000 , 2500 , 3000 , 5000 , 5250 , 7000 , 7250 , 8000 ] events = np . zeros ( ( len ( times ) , 3 ) , int ) events [ : , 2 ] = 1 events [ : , 0 ] = times signal [ events [ : , 0 ] ] = 1.0 effect = hann ( 101 ) signal = np . convolve ( signal , effect ) [ : len ( signal ) ] raw = RawArray ( signal [ np . newaxis , : ] , mne . create_info ( 1 , 100 , 'eeg' ) ) assert_allclose ( effect , linear_regression_raw ( raw , events , { 1 : 1 } , tmin = 0 ) [ 1 ] . data . flatten ( ) )
test regression with overlap correction .