These calculations look like they'll be appropriate for masked data, so I'm just checking if you've already thought about that. Is there some corresponding "confidence" measure that one might wish to extract?