initialize sgdfit with function