A threshold estimation problem for processes with hysteresis