当前位置:网站首页>GPS高程拟合抗差中误差的求取代码实现
GPS高程拟合抗差中误差的求取代码实现
2022-07-06 09:18:00 【Proletarians】
话不多说,直接上代码了,c代码
// 2.1、使用中位数法,而非算术中位法
qsort(tmp_v_res, ns, sizeof(double), cmpres);
median_v_res =median(tmp_v_res, ns);// 观测值中数 Eq.14
// 2.1.1 求取偏离量,中心化
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;//取绝对值
}
// 2.1.2 使用中位数计算方差因子
qsort(tmp_v_res, ns, sizeof(double), cmpres);
median_v_res = median(tmp_v_res, ns);//观测值中数
sigma1 = median_v_res / 0.6745;// Eq.17
printf("抗差单位权中误差(weighted)sigma1= %f\n", sigma1);
/* 残差比较 */
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);
}
/* 求中位数 */
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,阿里云服务器,平台配置
- [offer18] delete the node of the linked list
- VLSM variable length subnet mask partition tips
- MySQL replacement field part content
- 第一人称视角的角色移动
- FairyGUI循環列錶
- FGUI工程打包发布&导入Unity&将UI显示出来的方式
- (the first set of course design) 1-4 message passing interface (100 points) (simulation: thread)
- Fabrication d'un sac à dos simple fairygui
猜你喜欢

NRF24L01故障排查

Affichage du changement de valeur du Buff de gain de l'interface graphique de défaillance

In 2020, the average salary of IT industry exceeded 170000, ranking first
![Intermediate use tutorial of postman [environment variables, test scripts, assertions, interface documents, etc.]](/img/b0/176bf6dea2201afc892d6750c5974b.png)
Intermediate use tutorial of postman [environment variables, test scripts, assertions, interface documents, etc.]

The service robots that have been hyped by capital and the Winter Olympics are not just a flash in the pan

(4) Data visualization of R language -- matrix chart, histogram, pie chart, scatter chart, linear regression and strip chart
![[Nodejs] 20. Koa2 onion ring model ----- code demonstration](/img/a8/a4390238685903b63bb036206f8dcb.jpg)
[Nodejs] 20. Koa2 onion ring model ----- code demonstration

Redis based distributed locks and ultra detailed improvement ideas

Conditional probability

Problèmes avec MySQL time, fuseau horaire, remplissage automatique 0
随机推荐
By v$rman_ backup_ job_ Oracle "bug" caused by details
Whistle+switchyomega configure web proxy
SSD technical features
Common DOS commands
Knowledge summary of request
Conditional probability
FairyGUI人物状态弹窗
Guided package method in idea
(the first set of course design) 1-4 message passing interface (100 points) (simulation: thread)
[899]有序队列
There is no red exclamation mark after SVN update
MySQL時間、時區、自動填充0的問題
Lock wait timeout exceeded try restarting transaction
[leetcode19]删除链表中倒数第n个结点
2021.11.10 compilation examination
第一人称视角的角色移动
Single chip Bluetooth wireless burning
C programming exercise
[leetcode19] delete the penultimate node in the linked list
The service robots that have been hyped by capital and the Winter Olympics are not just a flash in the pan