Statistics¶
This module looks at calculating error, VCV matrix transformations, and rotation matrices.
Error¶
- geodepy.statistics.error_ellipse(vcv)[source]¶
Calculate the semi-major axis, semi-minor axis, and the orientation of the error ellipse defined by a VCV
See Section 7.3.3.1 of the DynaNet User’s Guide v3.3
- Parameters:
vcv – a VCV (3x3)
- Returns:
a, semi-major axis
- Returns:
b, semi-minor axis
- Returns:
The orientation of the error ellipse
- geodepy.statistics.relative_error(lat, lon, var1, var2, cov12)[source]¶
Function to compute relative error between two 3D stations:
2D relative error ellipse [semi-major axis, semi-minor axis, bearing]
1D relative ‘up’ error
Adapted from Harvey B.R. (1998) Practical least squares and statistics for surveyors, Monograph 13, Section 4.4, p.135
- Parameters:
lat – latitude at Stn1 in decimal degrees
lon – longitude at Stn1 in decimal degrees
var1 – 3x3 Cartesian XYZ variance matrix of Stn1
var2 – 3x3 Cartesian XYZ variance matrix of Stn2
cov12 – 3x3 Cartesian XYZ covariance block between Stn1 and Stn2
- Returns:
Relative error ellipse components [smaj, smin, brg] and relative ‘up’ error
- geodepy.statistics.circ_hz_pu(a, b)[source]¶
Calculate the circularised horizontal PU from the semi-major and semi-minor axes of an error ellipse
- Parameters:
a – semi-major axis
b – semi-minor axis
- Returns:
Radius of the circularised error
- geodepy.statistics.k_val95(dof)[source]¶
Returns the Coverage Factor k for a given 1 sigma (68.27%) standard deviation to allow conversion to a 95% standard deviation. This uses a simplified table of k values rounded to 5 decimal places for Degrees of Freedom (DOF) in the range 1 to 120. For DOF above 120, returns k value of 1.96 and for DOF below 1, returns k value for DOF = 1. Coverage Factor produced using following scipy stats:
stats.t.ppf(1-0.025,dof)
- Parameters:
dof – Degrees of Freedom (Number of Measurements Minus 1)
- Returns:
Coverage Factor k
VCV Matrix Transformations¶
- geodepy.statistics.vcv_cart2local(vcv_cart, lat, lon)[source]¶
Transforms a VCV from the Cartesian to the local reference frame. If only a column vector of variances is supplied then they are assumed to be uncorrelated and only the column vector of variances is returned.
See Section 4.4.1 of the DynAdjust User’s Guide v1.0
- Parameters:
vcv_cart – a VCV in the Cartesian reference frame (3x1 or 3x3)
lat – latitude in decimal degrees
lon – longitude in decimal degrees
- Returns:
vcv array (3x1 or 3x3)
- geodepy.statistics.vcv_local2cart(vcv_local, lat, lon)[source]¶
Transform a VCV from the local to the Cartesian reference frame. If only a column vector of variances is supplied then they are assumed to be uncorrelated and only the column vector of variances is returned.
See Section 4.4.1 of the DynAdjust User’s Guide v1.0
- Parameters:
vcv_local – a VCV in the local reference frame (3x1 or 3x3)
lat – latitude in decimal degrees
lon – longitude in decimal degrees
- Returns:
vcv array (3x1 or 3x3)
Rotation Matrix¶
- geodepy.statistics.rotation_matrix(lat, lon)[source]¶
Returns the rotation matrix between the local and Cartesian reference systems at a given latitude and longitude
See Section 4.2.3 of the DynAdjust User’s Guide v1.0
- Parameters:
lat – latitude in decimal degrees
lon – longitude in decimal degrees
- Returns:
rotation matrix (3x3)