Skip to content

Mechanistic Richards fitting test - values are currently not accurate #58

Description

@sambra95

Values in test_richards.py currently don't match the True values as for some reason the fitting method does not fit the data well (see below). The test values were just chosen to ensure that the assertions pass for the time being.

` # test mechanistic Richards model fitting

K = 2.5
mu = 0.3
beta = 5.0
y0 = 1.0
N0 = 0.05
expected = {"K": 2.41, "mu": 0.4, "beta": 2.64, "y0": y0, "N0": 0.016}

N = mech_richards_model(t=t, mu=mu_max, K=A, N0=N0, beta=lam, y0=y0)
actual = gc.parametric.fit_parametric(t, N, method="mech_richards")
actual = actual["params"]
for k, v in expected.items():
    assert k in actual, f"Parameter {k} not found in actual output"
    assert np.isclose(
        actual[k], v, rtol=2e-1
    ), f"Mechanistic parameter {k} does not match expected value. Actual: {actual[k]}, Expected: {v}"

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions