当前位置:网站首页>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;
}
边栏推荐
- FGUI工程打包发布&导入Unity&将UI显示出来的方式
- Guided package method in idea
- [algorithm] sword finger offer2 golang interview question 7: 3 numbers with 0 in the array
- Particle system for introduction to unity3d Foundation (attribute introduction + case production of flame particle system)
- [算法] 剑指offer2 golang 面试题12:左右两边子数组的和相等
- Unity场景跳转及退出
- VLSM variable length subnet mask partition tips
- GNSS定位精度指标计算
- [算法] 劍指offer2 golang 面試題2:二進制加法
- C programming exercise
猜你喜欢
编辑距离(多源BFS)
FairyGUI人物状态弹窗
[untitled]
Fairygui loop list
FGUI工程打包发布&导入Unity&将UI显示出来的方式
[算法] 剑指offer2 golang 面试题2:二进制加法
[algorithm] sword finger offer2 golang interview question 6: sum of two numbers in the sorting array
[algorithm] sword finger offer2 golang interview question 9: subarray with product less than k
[algorithm] sword finger offer2 golang interview question 1: integer division
Vulnhub target: hacknos_ PLAYER V1.1
随机推荐
WSL common commands
[算法] 剑指offer2 golang 面试题13:二维子矩阵的数字之和
What are the functions and features of helm or terrain
[leetcode15] sum of three numbers
Fairygui character status Popup
[untitled]
JUC forkjoin and completable future
Compilation principle: preprocessing of source program and design and implementation of lexical analysis program (including code)
Unity场景跳转及退出
【GNSS数据处理】赫尔默特(helmert)方差分量估计解析及代码实现
VLSM variable length subnet mask partition tips
Lock wait timeout exceeded try restarting transaction
[算法] 剑指offer2 golang 面试题6:排序数组中的两个数字之和
燕山大学校园网自动登录问题解决方案
FairyGUI簡單背包的制作
Unity3D摄像机,键盘控制前后左右上下移动,鼠标控制旋转、放缩
Detailed explanation of balanced binary tree is easy to understand
[offer78]合并多个有序链表
On March 15, the official version of go 1.18 was released to learn about the latest features and usage
isEmpty 和 isBlank 的用法区别