! * called when the distribution was changed, recalculates everything that depends on * the distribution only and doesn't dependent on the source data */
| 373 | * the distribution only and doesn't dependent on the source data |
| 374 | */ |
| 375 | void QQPlotPrivate::updateDistribution() { |
| 376 | QVector<double> xData; |
| 377 | double x1 = 0.; |
| 378 | double x2 = 0.; |
| 379 | |
| 380 | // handle all distributions where the inverse of the CDF is available in gsl_cdf.h |
| 381 | switch (distribution) { |
| 382 | case nsl_sf_stats_gaussian: { |
| 383 | x1 = gsl_cdf_gaussian_Pinv(0.01, 1.0); |
| 384 | x2 = gsl_cdf_gaussian_Pinv(0.99, 1.0); |
| 385 | for (int i = 1; i < 100; ++i) |
| 386 | xData << gsl_cdf_gaussian_Pinv(double(i) / 100., 1.0); |
| 387 | break; |
| 388 | } |
| 389 | case nsl_sf_stats_exponential: { |
| 390 | x1 = gsl_cdf_exponential_Pinv(0.01, 1.0); |
| 391 | x2 = gsl_cdf_exponential_Pinv(0.99, 1.0); |
| 392 | for (int i = 1; i < 100; ++i) |
| 393 | xData << gsl_cdf_exponential_Pinv(double(i) / 100., 1.0); |
| 394 | break; |
| 395 | } |
| 396 | case nsl_sf_stats_laplace: { |
| 397 | x1 = gsl_cdf_laplace_Pinv(0.01, 1.0); |
| 398 | x2 = gsl_cdf_laplace_Pinv(0.99, 1.0); |
| 399 | for (int i = 1; i < 100; ++i) |
| 400 | xData << gsl_cdf_laplace_Pinv(double(i) / 100., 1.0); |
| 401 | break; |
| 402 | } |
| 403 | case nsl_sf_stats_cauchy_lorentz: { |
| 404 | x1 = gsl_cdf_cauchy_Pinv(0.01, 1.0); |
| 405 | x2 = gsl_cdf_cauchy_Pinv(0.99, 1.0); |
| 406 | for (int i = 1; i < 100; ++i) |
| 407 | xData << gsl_cdf_cauchy_Pinv(double(i) / 100., 1.0); |
| 408 | break; |
| 409 | } |
| 410 | case nsl_sf_stats_rayleigh: { |
| 411 | x1 = gsl_cdf_rayleigh_Pinv(0.01, 1.0); |
| 412 | x2 = gsl_cdf_rayleigh_Pinv(0.99, 1.0); |
| 413 | for (int i = 1; i < 100; ++i) |
| 414 | xData << gsl_cdf_rayleigh_Pinv(double(i) / 100., 1.0); |
| 415 | break; |
| 416 | } |
| 417 | case nsl_sf_stats_gamma: { |
| 418 | x1 = gsl_cdf_gamma_Pinv(0.01, 1.0, 1.0); |
| 419 | x2 = gsl_cdf_gamma_Pinv(0.99, 1.0, 1.0); |
| 420 | for (int i = 1; i < 100; ++i) |
| 421 | xData << gsl_cdf_gamma_Pinv(double(i) / 100., 1.0, 1.0); |
| 422 | break; |
| 423 | } |
| 424 | case nsl_sf_stats_flat: { |
| 425 | x1 = gsl_cdf_flat_Pinv(0.01, 0.0, 1.0); |
| 426 | x2 = gsl_cdf_flat_Pinv(0.99, 0.0, 1.0); |
| 427 | for (int i = 1; i < 100; ++i) |
| 428 | xData << gsl_cdf_flat_Pinv(double(i) / 100., 0.0, 1.0); |
| 429 | break; |
| 430 | } |
| 431 | case nsl_sf_stats_lognormal: { |
| 432 | x1 = gsl_cdf_lognormal_Pinv(0.01, 1.0, 1.0); |
no test coverage detected