当前位置:网站首页>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;
}
边栏推荐
- Acwing-116 pilot brother
- Unity3d makes the registration login interface and realizes the scene jump
- NovAtel 板卡OEM617D配置步骤记录
- C programming exercise
- Prove the time complexity of heap sorting
- Devops' future: six trends in 2022 and beyond
- FairyGUI循環列錶
- Unity场景跳转及退出
- [algorithm] sword finger offer2 golang interview question 12: the sum of the left and right sub arrays is equal
- Particle system for introduction to unity3d Foundation (attribute introduction + case production of flame particle system)
猜你喜欢
rtklib单点定位spp使用抗差估计遇到的问题及解决
[算法] 剑指offer2 golang 面试题10:和为k的子数组
Office提示您的许可证不是正版弹框解决
[算法] 剑指offer2 golang 面试题3:前n个数字二进制形式中1的个数
2022国赛Re1 baby_tree
[algorithm] sword finger offer2 golang interview question 1: integer division
FairyGUI复选框与进度条的组合使用
[Nodejs] 20. Koa2 onion ring model ----- code demonstration
FairyGUI循环列表
Mysql database index
随机推荐
[untitled]
地球围绕太阳转
编辑距离(多源BFS)
[algorithme] swordfinger offer2 golang question d'entrevue 2: addition binaire
[Chongqing Guangdong education] Shandong University College Physics reference materials
Prove the time complexity of heap sorting
[Chongqing Guangdong education] reference materials for regional analysis and planning of Pingdingshan University
3月15号 Go 1.18 正式版发布 了解最新特色以及使用方法
Compile GDAL source code with nmake (win10, vs2022)
[algorithm] sword finger offer2 golang interview question 1: integer division
Halcon knowledge: gray_ Tophat transform and bottom cap transform
Expected value (EV)
Compilation principle: preprocessing of source program and design and implementation of lexical analysis program (including code)
[algorithm] sword finger offer2 golang interview question 12: the sum of the left and right sub arrays is equal
idea问题记录
[算法] 剑指offer2 golang 面试题10:和为k的子数组
Unity场景跳转及退出
Fabrication of fairygui simple Backpack
FairyGUI摇杆
2022国赛Re1 baby_tree