当前位置:网站首页>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;
}
边栏推荐
- [leetcode15] sum of three numbers
- [leetcode622] design circular queue
- [algorithm] sword finger offer2 golang interview question 1: integer division
- Office prompts that your license is not genuine pop-up box solution
- Halcon knowledge: gray_ Tophat transform and bottom cap transform
- MySQL shutdown is slow
- Get the position of the nth occurrence of the string
- [算法] 剑指offer2 golang 面试题6:排序数组中的两个数字之和
- 编辑距离(多源BFS)
- IText 7 generate PDF summary
猜你喜欢
Matlab读取GNSS 观测值o文件代码示例
Halcon knowledge: gray_ Tophat transform and bottom cap transform
Expected value (EV)
Unity scene jump and exit
Teach you to release a DeNO module hand in hand
Vulnhub target: hacknos_ PLAYER V1.1
Prove the time complexity of heap sorting
[算法] 剑指offer2 golang 面试题8:和大于或等于k的最短子数组
NovAtel 板卡OEM617D配置步骤记录
FairyGUI人物状态弹窗
随机推荐
idea中导包方法
Solution to the problem of automatic login in Yanshan University Campus Network
[算法] 劍指offer2 golang 面試題2:二進制加法
FairyGUI循環列錶
MySQL performance tuning - dirty page refresh
[算法] 剑指offer2 golang 面试题13:二维子矩阵的数字之和
Introduction to the daily practice column of the Blue Bridge Cup
Unity3D基础入门之粒子系统(属性介绍+火焰粒子系统案例制作)
InnoDB dirty page refresh mechanism checkpoint in MySQL
Mixed use of fairygui button dynamics
WSL common commands
FairyGUI人物状态弹窗
IText 7 generate PDF summary
Fabrication d'un sac à dos simple fairygui
雇佣收银员【差分约束】
There is no red exclamation mark after SVN update
[算法] 剑指offer2 golang 面试题12:左右两边子数组的和相等
2021.11.10 compilation examination
Database table splitting strategy
Unity scene jump and exit