[master] Added statistical threshold calculation