Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no function to validate a metamodel from L2 norm #97

Open
mbaudin47 opened this issue Dec 18, 2022 · 0 comments
Open

There is no function to validate a metamodel from L2 norm #97

mbaudin47 opened this issue Dec 18, 2022 · 0 comments

Comments

@mbaudin47
Copy link
Collaborator

mbaudin47 commented Dec 18, 2022

Here is one draft class from Anne Dutfoy.

class MetamodelValidation:
    def __init__(self, modele, metamodele, loi):
        self.modele = modele
        self.metamodele = metamodele
        self.loi = loi

    def computeIntegrand(self, x):
        return [
            (self.modele(x)[0] - self.metamodele(x)[0]) ** 2 * self.loi.computePDF(x)
        ]

    def computeL2Norm(self):
        integrandFunction = ot.PythonFunction(1, 1, self.computeIntegrand)
        return ot.GaussKronrod().integrate(integrandFunction, self.loi.getRange())[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant