tomojitakasu / RTKLIB

2.56k stars 1.63k forks source link

Strange define for SQR in solution.c #387

Open justprosh opened 6 years ago

justprosh commented 6 years ago

https://github.com/tomojitakasu/RTKLIB/blob/289e2b6cdd16d13bfa8219c63f16bb8f321c04b5/src/solution.c#L52 For negative numbers this define holds the sign.

ralphtee commented 5 years ago

This #define is applicable only within solution.c and for the purpose of maintaining the sign of the squared covariances. It is not a general #define.

gpoleszuk commented 1 year ago

This #define is applicable only within solution.c and for the purpose of maintaining the sign of the squared covariances. It is not a general #define.

Hello, ralphtee!

I mean covariances cannot be squared or take square root of them, since they are related information between two random variables. Otherwise, take square root of variances we get standard deviations. Squaring standard deviations we get again variances.

In some books we can see, for example, variances expressed as sxx, syy, szz and covariances as sxy, syz, sxz. The last three values can assume positive or negative and expresses the relationship between two random variables. Then I mean the square root of sxy or syz or sxz does not make sense. Do you agree?