HydrologicEngineeringCenter / fda-model

A simple computational library to support water resources.
MIT License
2 stars 0 forks source link

clean up monotonicity checks #126

Closed rnugent3 closed 2 years ago

rnugent3 commented 2 years ago

use @HenryGeorgist 's rule stuff

rnugent3 commented 2 years ago

william.lehman 11:31 AM i think we do it in the sample method directly so any time we produce a paired data from a sample of uncertain paired data we call validate

richard.nugent richard.nugent 11:32 AM Ok. I'll write an issue to clean up the monotonicity check

william.lehman 11:32 AM then we only have other cases where we dont interact with uncertain paired data itself we also should have validation on uncertain paired data itself that way when simulation calls validate we just validate all the curves too

HenryGeorgist commented 2 years ago

i found that we are producing non monotonic paired data all over the place

HenryGeorgist commented 2 years ago
        public IPairedData SamplePairedData(double probability)
        {
            double[] y = new double[_yvals.Length];
            for (int i = 0; i < _xvals.Length; i++)
            {
                y[i] = _yvals[i].InverseCDF(probability);
            }
            PairedData pd = new PairedData(_xvals, y, Category);//mutability leakage on xvals
            pd.Validate();
            if (pd.HasErrors){
                throw new Exception("the produced paired data is not monotonically increasing."); //TODO: be more intellegent abou this. possibly use force monotonic in range from go-consequences.paireddata
            }
            return pd;
        }
HenryGeorgist commented 2 years ago

this fails 12 of our tests. mostly levee tests i think. i can fix the issue i think for a temporary patch, but there is something wrong here.

rnugent3 commented 2 years ago

The probability of failure is constant at and over top of levee elevation

Best,

R Nugent III

On Feb 2, 2022, at 7:25 PM, Will Lehman @.***> wrote:

 this fails 12 of our tests. mostly levee tests i think. i can fix the issue i think for a temporary patch, but there is something wrong here.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were assigned.

HenryGeorgist commented 2 years ago

yeah - so errors are existing even if we have increasing values. there is still some serious problems going on that we need to probably fix, but i have it passing all tests.

HenryGeorgist commented 2 years ago

implemented strict monotonic increasing and monotonic increasing. need to finish decreasing - it is a bit trickier

HenryGeorgist commented 2 years ago

@rnugent3 didnt we fix this with alex?

rnugent3 commented 2 years ago

Yes, I agree. Closing issue.