当前位置:网站首页>Realization of the code for calculating the mean square error of GPS Height Fitting
Realization of the code for calculating the mean square error of GPS Height Fitting
2022-07-06 12:53:00 【Proletarians】
Don't talk much , Go straight to the code ,c Code
// 2.1、 Use the median method , Instead of arithmetic median
qsort(tmp_v_res, ns, sizeof(double), cmpres);
median_v_res =median(tmp_v_res, ns);// Mean value of observation Eq.14
// 2.1.1 Find the deviation , Centralization
for (j = 0; j < ns; j++) {
tmp_v_res[j] -= median_v_res;// Eq.15
/*v_res[j] -= median_v_res;*/
if (tmp_v_res[j] < 0) tmp_v_res[j] *= -1;// Take the absolute value
}
// 2.1.2 Use the median to calculate the variance factor
qsort(tmp_v_res, ns, sizeof(double), cmpres);
median_v_res = median(tmp_v_res, ns);// Mean value of observation
sigma1 = median_v_res / 0.6745;// Eq.17
printf(" Robust unit weight mean square error (weighted)sigma1= %f\n", sigma1);
/* Residual comparison */
static int cmpres(const void *p1, const void *p2){
double *q1 = (double *)p1, *q2 = (double *)p2;
double tt = (*q1) - (*q2);
return tt<-0.0 ? -1 : (tt>0.0 ? 1 : 0);
}
/* Find the median */
static double median(const double* A,unsigned int n){
if (n>0){
return (n & 1 == 1) ? A[(n - 1) / 2] : (A[n / 2] + A[n / 2 - 1]) / 2;
}
return 0;
}
边栏推荐
- Itext 7 生成PDF总结
- FairyGUI复选框与进度条的组合使用
- [算法] 剑指offer2 golang 面试题12:左右两边子数组的和相等
- [leetcode622] design circular queue
- 平衡二叉树详解 通俗易懂
- There is no red exclamation mark after SVN update
- [Chongqing Guangdong education] reference materials for regional analysis and planning of Pingdingshan University
- Mysql database index
- 2022国赛Re1 baby_tree
- Mixed use of fairygui button dynamics
猜你喜欢
FairyGUI简单背包的制作
[algorithm] sword finger offer2 golang interview question 10: subarray with sum K
Unity3D,阿里云服务器,平台配置
What are the advantages of using SQL in Excel VBA
Programming homework: educational administration management system (C language)
Teach you to release a DeNO module hand in hand
[algorithm] sword finger offer2 golang interview question 8: the shortest subarray with a sum greater than or equal to K
Easy to use shortcut keys in idea
FairyGUI增益BUFF数值改变的显示
Matlab读取GNSS 观测值o文件代码示例
随机推荐
服务未正常关闭导致端口被占用
(core focus of software engineering review) Chapter V detailed design exercises
FairyGUI摇杆
Vulnhub target: hacknos_ PLAYER V1.1
[offer18] delete the node of the linked list
染色法判定二分图
Mixed use of fairygui button dynamics
[算法] 剑指offer2 golang 面试题6:排序数组中的两个数字之和
Mysql database reports an error: row size too large (> 8126) Changing some columns to TEXT or BLOB or using ROW_ FORMAT=DY
Easy to use shortcut keys in idea
Unity3d camera, the keyboard controls the front and rear left and right up and down movement, and the mouse controls the rotation, zoom in and out
编辑距离(多源BFS)
idea问题记录
isEmpty 和 isBlank 的用法区别
FairyGUI增益BUFF數值改變的顯示
[algorithm] sword finger offer2 golang interview question 10: subarray with sum K
Acwing-116 pilot brother
FairyGUI条子家族(滚动条,滑动条,进度条)
抗差估计在rtklib的pntpos函数(标准单点定位spp)中的c代码实现
[算法] 剑指offer2 golang 面试题8:和大于或等于k的最短子数组