Template for sigma calculation