| 1 | #include <gsl/gsl_cdf.h> |
|---|
| 2 | |
|---|
| 3 | int main() |
|---|
| 4 | { |
|---|
| 5 | int i; |
|---|
| 6 | struct cdf_beta_args { |
|---|
| 7 | double x; |
|---|
| 8 | double a; |
|---|
| 9 | double b; |
|---|
| 10 | } test_args[] = |
|---|
| 11 | { |
|---|
| 12 | {0.9060444950591773,0.2041502528011575,3.577470746807153}, |
|---|
| 13 | {0.9106045018415898,0.1294490217232419,4.295225903094223}, |
|---|
| 14 | {0.9306478824000806,0.159713134506609,4.357303934038536}, |
|---|
| 15 | {0.9015749655663967,0.1769167491596307,3.709593420822396}, |
|---|
| 16 | {0.9056045790202916,0.1844906478517543,3.606277883345159}, |
|---|
| 17 | {0.9067085161805153,0.1903702202487794,3.697913210813661}, |
|---|
| 18 | {0.9155602918472141,0.2029333494515557,3.52015751714325}, |
|---|
| 19 | {0.9124320398550481,0.148724728854337,4.097669113723164}, |
|---|
| 20 | {0.9031198702286929,0.07202908789468146,7.504563898196396}, |
|---|
| 21 | {0.9078737252857536,0.1940092241212835,3.449984239856465}, |
|---|
| 22 | {0.9086117066908628,0.1761127284729697,3.611606788307608}, |
|---|
| 23 | {0.9105308051221073,0.2000373082584609,3.467828750535305}, |
|---|
| 24 | {0.9149131434969604,0.1729368532663472,4.128703338450808}, |
|---|
| 25 | {0.9363559170160443,0.1799456963706892,4.207224837486437}, |
|---|
| 26 | {0.9446900135371834,0.06873371518266619,6.27892521836533}, |
|---|
| 27 | {0.9999999868417623,24.95643274099755,918.6566331776214} |
|---|
| 28 | }; |
|---|
| 29 | |
|---|
| 30 | for ( i = 0; sizeof( test_args ) / sizeof( test_args[ 0 ] ); ++i ) { |
|---|
| 31 | double p = gsl_cdf_beta_Pinv( test_args[i].x, |
|---|
| 32 | test_args[i].a, |
|---|
| 33 | test_args[i].b ); |
|---|
| 34 | } |
|---|
| 35 | return 0; |
|---|
| 36 | } |
|---|