当前位置:网站首页>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;
}
边栏推荐
- Combination of fairygui check box and progress bar
- [算法] 剑指offer2 golang 面试题5:单词长度的最大乘积
- Unity3D基础入门之粒子系统(属性介绍+火焰粒子系统案例制作)
- In 2020, the average salary of IT industry exceeded 170000, ranking first
- Force buckle 1189 Maximum number of "balloons"
- The service robots that have been hyped by capital and the Winter Olympics are not just a flash in the pan
- Mixed use of fairygui button dynamics
- FairyGUI增益BUFF數值改變的顯示
- 堆排序【手写小根堆】
- 闇の連鎖(LCA+树上差分)
猜你喜欢
Fairygui joystick
Guided package method in idea
[算法] 剑指offer2 golang 面试题12:左右两边子数组的和相等
Programming homework: educational administration management system (C language)
Derivation of logistic regression theory
[untitled]
[algorithm] sword finger offer2 golang interview question 9: subarray with product less than k
FairyGUI循环列表
染色法判定二分图
C programming exercise
随机推荐
[algorithm] sword finger offer2 golang interview question 5: maximum product of word length
(课设第一套)1-4 消息传递接口 (100 分)(模拟:线程)
[offer78]合并多个有序链表
InnoDB dirty page refresh mechanism checkpoint in MySQL
Usage differences between isempty and isblank
微信小程序开发心得
Database table splitting strategy
What are the advantages of using SQL in Excel VBA
dosbox第一次使用
[算法] 剑指offer2 golang 面试题1:整数除法
平衡二叉树详解 通俗易懂
Fairygui loop list
编辑距离(多源BFS)
[算法] 剑指offer2 golang 面试题10:和为k的子数组
[algorithm] sword finger offer2 golang interview question 6: sum of two numbers in the sorting array
[算法] 剑指offer2 golang 面试题9:乘积小于k的子数组
基本Dos命令
FGUI工程打包发布&导入Unity&将UI显示出来的方式
FairyGUI条子家族(滚动条,滑动条,进度条)
[algorithm] sword finger offer2 golang interview question 12: the sum of the left and right sub arrays is equal