want ocmath function to calculate confidence interval for median


Version: 2026

Type: Features

Category: Programming

Subcategory: Origin C

Jira: ORG-31926


Example:

void test_ocmath_quantile()
{
	int n;
	vector vecData= {-1.44090165, -1.40318433, -1.21953433, -0.95029549, -0.90398754, -0.66095890, -0.47801787, -0.43976149, -0.36174823, -0.34116984, -0.33047704, -0.31576897, -0.28904542, -0.03789851, -0.03764990, -0.03377687,  0.22121130,  0.30331291,  0.43716773,  0.47435054,  0.60897987, 0.64611097, 1.20086374, 1.52483138, 2.67862782};
	
	double p=0.5, size=10,prob=0.95;
	int lower_tail=1;
	double vResult;
	n = ocmath_binoinv(1, &vResult, &p, &size, &prob, &lower_tail);
    
	double results;
	n = ocmath_quantile_ci(&results, 25, vecData, 0.5, 0.95);
	
	n = ocmath_quantile_ci_nyblom(&results, 25, vecData, 0.6, 0.95, true, false, true);
	
	double quantiles, weights;
	vector a = {10, 25, 30, 45, 50, 65, 70, 85, 90, 100};
	vector q = {0.05, 0.25, 0.50, 0.75, 0.95};
	n = ocmath_quantile(&quantiles, 10, a, 5, q, QUANTILE_METHOD_LINEAR,NULL);
	
	return;
}