# NLLoc covariance and errors

**URL:** <https://discourse.obspy.org/t/nlloc-covariance-and-errors/1677>\
**Category:** Usage Questions\
**Created:** [March 31, 2023, 3:29am UTC](https://discourse.obspy.org/t/nlloc-covariance-and-errors/1677 "2023-03-31T03:29:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![erhmestel](https://discourse.obspy.org/user_avatar/discourse.obspy.org/erhmestel/32/678_2.png) [@erhmestel](https://discourse.obspy.org/u/erhmestel)\
**Post date:** [March 31, 2023, 3:29am UTC](https://discourse.obspy.org/t/nlloc-covariance-and-errors/1677/1 "2023-03-31T03:29:33Z")

</div>

Hello, thanks for all of your work.

I was wondering if anyone could explain to me why within the `obspy.io.nlloc.core` function `_read_single_hypocenter` the longitude, latitude and depth errors are calculated as sqrt(covariance) rather than as suggested in the NLLoc documentation (below)? Any guidence would be appreciated!

From the NonLinLoc 7.0 documentation FAQ [http://alomax.free.fr/nlloc/](http://alomax.free.fr/nlloc/):

> **How can I obtain the horizontal and 3D standard errors for the PDF scatter sample?**  
> The 2D horizontal errors along the major and minor axes of the horizontal ellipsoid are available in the NLLoc Hypocenter-Phase file: see QML\_OriginUncertainty Line.
> 
> More generally, the 3D x, y, z errors can be calculated from the covariances in the NLLoc Hypocenter-Phase file STATISTICS line:
> 
> double errx = sqrt(DELTA\_CHI\_SQR\_68\_3 \* cov.xx);  
> double erry = sqrt(DELTA\_CHI\_SQR\_68\_3 \* cov.yy);  
> double errz = sqrt(DELTA\_CHI\_SQR\_68\_3 \* cov.zz);
> 
> where DELTA\_CHI\_SQR\_68 is 3.53, (value for 68% conf, see Num Rec, 2nd ed, sec 15.6, table)
> 
> And the 2D x, y errors can be calculated from the covariances in the NLL STATISTICS line:
> 
> double errx = sqrt(DELTA\_CHI\_SQR\_68\_2 \* cov.xx);  
> double erry = sqrt(DELTA\_CHI\_SQR\_68\_2 \* cov.yy);
> 
> where DELTA\_CHI\_SQR\_68\_2 is 2.30, (value for 68% conf, see Num Rec, 2nd ed, sec 15.6, table)
