Created
June 30, 2025 10:00
-
-
Save mbaudin47/7dbed50bab30a42fbd8ba30423eac2ab to your computer and use it in GitHub Desktop.
pce_ishigami
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Smallest possible script to create a FunctionalChaosResult. | |
| Uses the Ishigami function. | |
| """ | |
| # %% | |
| from openturns.usecases import ishigami_function | |
| import openturns as ot | |
| # %% | |
| im = ishigami_function.IshigamiModel() | |
| sampleSize = 100 | |
| inputTrain = im.inputDistribution.getSample(sampleSize) | |
| outputTrain = im.model(inputTrain) | |
| multivariateBasis = ot.OrthogonalProductPolynomialFactory([im.X1, im.X2, im.X3]) | |
| selectionAlgorithm = ot.LeastSquaresMetaModelSelectionFactory() | |
| projectionStrategy = ot.LeastSquaresStrategy(selectionAlgorithm) | |
| totalDegree = 8 | |
| enumerateFunction = multivariateBasis.getEnumerateFunction() | |
| basisSize = enumerateFunction.getBasisSizeFromTotalDegree(totalDegree) | |
| adaptiveStrategy = ot.FixedStrategy(multivariateBasis, basisSize) | |
| chaosAlgo = ot.FunctionalChaosAlgorithm( | |
| inputTrain, outputTrain, im.inputDistribution, adaptiveStrategy, projectionStrategy | |
| ) | |
| chaosAlgo.run() | |
| chaosResult = chaosAlgo.getResult() | |
| chaosResult |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment