#NEWLINE# def second_smoothing_test( self ) : #NEWLINE# #INDENT# '\n        Test smoothing part of HoltSmoothing.\n\n        Data: http://analysights.wordpress.com/2010/05/20/forecast-friday-topic-double-exponential-smoothing/\n        ' #NEWLINE# data = [ [ 0.0 , 152 ] , [ 1 , 176 ] , [ 2 , 160 ] , [ 3 , 192 ] , [ 4 , 220 ] ] #NEWLINE# tsSrc = TimeSeries . from_twodim_list ( data ) #NEWLINE# tsSrc . normalize ( 'second' ) #NEWLINE# data = [ [ 1.5 , 152.0 ] , [ 2.5 , 172.8 ] , [ 3.5 , 195.07200000000003 ] , [ 4.5 , 218.30528000000004 ] ] #NEWLINE# tsDst = TimeSeries . from_twodim_list ( tsDst ) #NEWLINE# hm = HoltMethod ( 0.2 , 0.3 , valuesToForecast = 0 ) #NEWLINE# res = tsSrc . apply ( hm ) #NEWLINE# if ( not ( res == tsDst ) ) : #NEWLINE# #INDENT# raise AssertionError