Ejemplo n.º 1
0
def case_with_zero_value():

    kwargs = dict(
        a0=[1.0, 3.0],
        a=[0.0, 0.0],
        aerr=[0.1, 0.76],
        acov=[[0.01, 2.3], [2.3, 0.988]],
        chi2=8.276,
        degrees_of_freedom=5,
    )
    chi2_reduced = 1.6552
    p_probability = 0.14167
    arerr = [np.inf, np.inf]
    repr_string = """Results:
========

Initial parameters' values:
\t1.0 3.0
Fitted parameters' values:
\ta[0] = 0.0000 \u00B1 0.1000 (inf% error)
\ta[1] = 0.0000 \u00B1 0.7600 (inf% error)
Fitted parameters covariance:
[[0.01  2.3  ]
 [2.3   0.988]]
Chi squared: 8.276
Degrees of freedom: 5
Chi squared reduced: 1.655
P-probability: 0.1417
"""
    fitting_result = FittingResult(**kwargs)
    return (
        dict(
            chi2_reduced=chi2_reduced,
            p_probability=p_probability,
            arerr=arerr,
            repr_string=repr_string,
            delta=10e-5,
            **kwargs,
        ),
        fitting_result,
    )
Ejemplo n.º 2
0
def case_with_small_p_probability():

    kwargs = dict(
        a0=[1.0, 3.0],
        a=[1.1, 2.98],
        aerr=[0.1, 0.76],
        acov=[[0.01, 2.3], [2.3, 0.988]],
        chi2=43.726,
        degrees_of_freedom=5,
    )
    chi2_reduced = 8.7452
    p_probability = 2.63263e-8
    arerr = [9.09091, 25.50336]
    repr_string = """Results:
========

Initial parameters' values:
\t1.0 3.0
Fitted parameters' values:
\ta[0] = 1.1000 \u00B1 0.1000 (9.091% error)
\ta[1] = 2.9800 \u00B1 0.7600 (25.50% error)
Fitted parameters covariance:
[[0.01  2.3  ]
 [2.3   0.988]]
Chi squared: 43.73
Degrees of freedom: 5
Chi squared reduced: 8.745
P-probability: 2.633e-8
"""
    fitting_result = FittingResult(**kwargs)
    return (
        dict(
            chi2_reduced=chi2_reduced,
            p_probability=p_probability,
            arerr=arerr,
            repr_string=repr_string,
            delta=10e-5,
            **kwargs,
        ),
        fitting_result,
    )