def test_Fit_Loglogistic_2P(): dist = Loglogistic_Distribution(alpha=50, beta=8) rawdata = dist.random_samples(200, seed=5) data = make_right_censored_data(data=rawdata, threshold=dist.mean) fit = Fit_Loglogistic_2P(failures=data.failures, right_censored=data.right_censored, show_probability_plot=False, print_results=False) assert_allclose(fit.alpha, 50.25178196536296,rtol=rtol,atol=atol) assert_allclose(fit.beta, 7.869850445508078,rtol=rtol,atol=atol) assert_allclose(fit.gamma, 0,rtol=rtol,atol=atol) assert_allclose(fit.AICc, 941.946173470838,rtol=rtol,atol=atol) assert_allclose(fit.Cov_alpha_beta, 0.14731251998744946,rtol=rtol,atol=atol) assert_allclose(fit.loglik, -468.9426298826271,rtol=rtol,atol=atol) assert_allclose(fit.initial_guess[1], 7.304622930677989,rtol=rtol,atol=atol)
def test_Fit_Loglogistic_3P(): dist = Loglogistic_Distribution(alpha=50, beta=8, gamma=500) rawdata = dist.random_samples(200, seed=5) data = make_right_censored_data(data=rawdata, threshold=dist.mean) fit = Fit_Loglogistic_3P(failures=data.failures, right_censored=data.right_censored, show_probability_plot=False, print_results=False) assert_allclose(fit.alpha, 64.54473158929677,rtol=rtol,atol=atol) assert_allclose(fit.beta, 10.513230464353654,rtol=rtol,atol=atol) assert_allclose(fit.gamma, 485.6731344659153,rtol=rtol,atol=atol) assert_allclose(fit.AICc, 943.8101901715909,rtol=rtol,atol=atol) assert_allclose(fit.Cov_alpha_beta, 0.18812547180218483,rtol=rtol,atol=atol) assert_allclose(fit.loglik, -468.84387059599953,rtol=rtol,atol=atol) assert_allclose(fit.initial_guess[1], 4.981027237709373,rtol=rtol,atol=atol)
def test_Fit_Loglogistic_3P(): dist = Loglogistic_Distribution(alpha=50, beta=8, gamma=500) rawdata = dist.random_samples(200, seed=5) data = make_right_censored_data(data=rawdata, threshold=dist.mean) MLE = Fit_Loglogistic_3P(failures=data.failures, right_censored=data.right_censored, method='MLE', show_probability_plot=False, print_results=False) assert_allclose(MLE.alpha, 62.33031514341089, rtol=rtol, atol=atol) assert_allclose(MLE.beta, 10.105811228561391, rtol=rtol, atol=atol) assert_allclose(MLE.gamma, 487.8907948039738, rtol=rtol, atol=atol) assert_allclose(MLE.AICc, 943.8128239547301, rtol=rtol, atol=atol) assert_allclose(MLE.BIC, 953.5853270747824, rtol=rtol, atol=atol) assert_allclose(MLE.loglik, -468.84518748756915, rtol=rtol, atol=atol) assert_allclose(MLE.AD, 582.5424432519599, rtol=rtol, atol=atol) assert_allclose(MLE.Cov_alpha_beta, -0.18172584774539235, rtol=rtol, atol=atol) LS = Fit_Loglogistic_3P(failures=data.failures, right_censored=data.right_censored, method='LS', show_probability_plot=False, print_results=False) assert_allclose(LS.alpha, 62.356306952705054, rtol=rtol, atol=atol) assert_allclose(LS.beta, 10.033505691693987, rtol=rtol, atol=atol) assert_allclose(LS.gamma, 487.9071761434245, rtol=rtol, atol=atol) assert_allclose(LS.AICc, 943.8204940620113, rtol=rtol, atol=atol) assert_allclose(LS.BIC, 953.5929971820636, rtol=rtol, atol=atol) assert_allclose(LS.loglik, -468.84902254120976, rtol=rtol, atol=atol) assert_allclose(LS.AD, 582.5422083314535, rtol=rtol, atol=atol) assert_allclose(LS.Cov_alpha_beta, -0.1864715435778476, rtol=rtol, atol=atol)
def test_Fit_Loglogistic_2P(): dist = Loglogistic_Distribution(alpha=50, beta=8) rawdata = dist.random_samples(200, seed=5) data = make_right_censored_data(data=rawdata, threshold=dist.mean) MLE = Fit_Loglogistic_2P(failures=data.failures, right_censored=data.right_censored, method='MLE', show_probability_plot=False, print_results=False) assert_allclose(MLE.alpha, 50.25178370302894, rtol=rtol, atol=atol) assert_allclose(MLE.beta, 7.869851191923439, rtol=rtol, atol=atol) assert_allclose(MLE.gamma, 0, rtol=rtol, atol=atol) assert_allclose(MLE.AICc, 941.9461734708389, rtol=rtol, atol=atol) assert_allclose(MLE.BIC, 948.4818944983512, rtol=rtol, atol=atol) assert_allclose(MLE.loglik, -468.94262988262756, rtol=rtol, atol=atol) assert_allclose(MLE.AD, 582.5464625675626, rtol=rtol, atol=atol) assert_allclose(MLE.Cov_alpha_beta, -0.14731273967044273, rtol=rtol, atol=atol) LS = Fit_Loglogistic_2P(failures=data.failures, right_censored=data.right_censored, method='LS', show_probability_plot=False, print_results=False) assert_allclose(LS.alpha, 50.657493341191135, rtol=rtol, atol=atol) assert_allclose(LS.beta, 7.389285094946194, rtol=rtol, atol=atol) assert_allclose(LS.gamma, 0, rtol=rtol, atol=atol) assert_allclose(LS.AICc, 942.5623765547977, rtol=rtol, atol=atol) assert_allclose(LS.BIC, 949.09809758231, rtol=rtol, atol=atol) assert_allclose(LS.loglik, -469.25073142460695, rtol=rtol, atol=atol) assert_allclose(LS.AD, 582.5637861880587, rtol=rtol, atol=atol) assert_allclose(LS.Cov_alpha_beta, -0.1828511494829605, rtol=rtol, atol=atol)