Skip to content

Commit

Permalink
Fix PCE cyclic reference & changes in folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
dgiovanis committed Mar 15, 2021
1 parent 8bbaea9 commit f76c9c1
Show file tree
Hide file tree
Showing 76 changed files with 259 additions and 366 deletions.
Binary file not shown.
Binary file modified example/Reliability/SubsetSimulation/Example3/Rosenbrock_MMH.pdf
Binary file not shown.
Binary file not shown.
Binary file modified example/Reliability/SubsetSimulation/Example4/Resonance_MMH.pdf
Binary file not shown.
Binary file not shown.
Binary file modified example/Reliability/SubsetSimulation/Example4/Resonance_pdf.pdf
Binary file not shown.
Binary file not shown.
162 changes: 32 additions & 130 deletions example/Reliability/TaylorSeries/TaylorSeries_Example1.ipynb

Large diffs are not rendered by default.

114 changes: 30 additions & 84 deletions example/SampleMethods/AKMCS/AKMCS_Example1.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions example/SampleMethods/AKMCS/AKMCS_Example2 .ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/StochasticProcess/BSRM_1d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down
76 changes: 51 additions & 25 deletions example/Surrogates/PCE/PCE_Example1.ipynb

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions example/Surrogates/PCE/PCE_Example2.ipynb

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions example/Surrogates/PCE/PCE_Example3.ipynb

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions example/Surrogates/PCE/PCE_Example4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from UQpy.Distributions import Uniform, JointInd\n",
"from UQpy.Surrogates import *"
]
},
Expand Down Expand Up @@ -180,7 +181,7 @@
"output_type": "stream",
"text": [
"Error from least squares regression is: 9.25e-05\n",
"Error from LASSO is: 0.002566\n",
"Error from LASSO is: 0.0024183\n",
"Error from Ridge is: 0.0026148\n"
]
}
Expand Down Expand Up @@ -221,9 +222,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Moments from least squares regression : (8.247977, 45.397944)\n",
"Moments from LASSO regression : (8.178689, 44.778469)\n",
"Moments from Ridge regression : (8.176812, 44.721672)\n",
"Moments from least squares regression : (8.248, 45.3979)\n",
"Moments from LASSO regression : (8.1807, 44.7966)\n",
"Moments from Ridge regression : (8.1768, 44.7217)\n",
"Moments from MC integration: (8.25404, 45.383791)\n"
]
}
Expand Down Expand Up @@ -264,7 +265,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down
11 changes: 6 additions & 5 deletions example/Surrogates/PCE/PCE_Example5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from UQpy.Distributions import Uniform, JointInd\n",
"from UQpy.Surrogates import *"
]
},
Expand Down Expand Up @@ -197,7 +198,7 @@
"output_type": "stream",
"text": [
"Error from least squares regression is: 0.0035946\n",
"Error from LASSO is: 0.0036024\n",
"Error from LASSO is: 0.0034472\n",
"Error from Ridge is: 0.0036999\n"
]
}
Expand Down Expand Up @@ -238,9 +239,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Moments from least squares regression : (14.386271, 23.806292)\n",
"Moments from LASSO regression : (14.384072, 23.770833)\n",
"Moments from Ridge regression : (14.375257, 23.572673)\n",
"Moments from least squares regression : (14.3863, 23.8063)\n",
"Moments from LASSO regression : (14.3858, 23.7305)\n",
"Moments from Ridge regression : (14.3753, 23.5727)\n",
"Moments from MC integration: (14.414001, 23.852139)\n"
]
}
Expand Down Expand Up @@ -281,7 +282,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down
11 changes: 6 additions & 5 deletions example/Surrogates/PCE/PCE_Example6.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from UQpy.Distributions import Uniform, JointInd\n",
"from UQpy.Surrogates import *"
]
},
Expand Down Expand Up @@ -218,7 +219,7 @@
"output_type": "stream",
"text": [
"Error from least squares regression is: 0.0510225\n",
"Error from LASSO is: 0.0510114\n",
"Error from LASSO is: 0.0507776\n",
"Error from Ridge is: 0.0503678\n"
]
}
Expand Down Expand Up @@ -259,9 +260,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Moments from least squares regression : (9.984848, 92.713617)\n",
"Moments from LASSO regression : (9.98418, 92.683269)\n",
"Moments from Ridge regression : (9.959297, 91.861373)\n",
"Moments from least squares regression : (9.9848, 92.7136)\n",
"Moments from LASSO regression : (9.9842, 92.6511)\n",
"Moments from Ridge regression : (9.9593, 91.8614)\n",
"Moments from MC integration: (10.018975, 92.526962)\n"
]
}
Expand Down Expand Up @@ -302,7 +303,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down
5 changes: 3 additions & 2 deletions example/Surrogates/PCE/PCE_Example7.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import numpy as np
from ..Distributions import *
from .. RunModel import RunModel
from .baseclass import TaylorSeries
from ..Transformations import *
from UQpy.Distributions import *
from UQpy.RunModel import RunModel
from .TaylorSeries import TaylorSeries
from UQpy.Transformations import *
import scipy.stats as stats

########################################################################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import numpy as np
from ..Distributions import *
from .. RunModel import RunModel
from .baseclass import TaylorSeries
from UQpy.Distributions import *
from UQpy.RunModel import RunModel
from .TaylorSeries import TaylorSeries
from .FORM import FORM
from ..Transformations import *
from UQpy.Transformations import *
import scipy.stats as stats

########################################################################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from ...Distributions import *
from ...RunModel import RunModel
from ...Transformations import *
from UQpy.Distributions import *
from UQpy.RunModel import RunModel
from UQpy.Transformations import *

########################################################################################################################
########################################################################################################################
Expand Down
4 changes: 4 additions & 0 deletions src/UQpy/Reliability/TaylorSeries/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .FORM import FORM
from .SORM import SORM
from .TaylorSeries import TaylorSeries

7 changes: 5 additions & 2 deletions src/UQpy/Reliability/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@
"""

from .FORM import FORM
from .SORM import SORM
from .SubsetSimulation import SubsetSimulation
from . TaylorSeries import *

from . import (
TaylorSeries
)



3 changes: 0 additions & 3 deletions src/UQpy/Reliability/baseclass/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/UQpy/SampleMethods/AKMCS.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..Distributions import *
from UQpy.Distributions import *
from .LHS import LHS
import scipy.stats as stats
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion src/UQpy/SampleMethods/IS.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..Distributions import Distribution
from UQpy.Distributions import Distribution
import numpy as np
########################################################################################################################
########################################################################################################################
Expand Down
2 changes: 1 addition & 1 deletion src/UQpy/SampleMethods/LHS.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..Distributions import *
from UQpy.Distributions import *
import numpy as np
from scipy.spatial.distance import pdist
import scipy.stats as stats
Expand Down
4 changes: 2 additions & 2 deletions src/UQpy/SampleMethods/MCMC/DRAM.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ..baseclass import MCMC
from ...Distributions import *
from .mcmc import MCMC
from UQpy.Distributions import *
import numpy as np

class DRAM(MCMC):
Expand Down
4 changes: 2 additions & 2 deletions src/UQpy/SampleMethods/MCMC/DREAM.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ..baseclass import MCMC
from ...Distributions import *
from .mcmc import MCMC
from UQpy.Distributions import *
import numpy as np

class DREAM(MCMC):
Expand Down
4 changes: 2 additions & 2 deletions src/UQpy/SampleMethods/MCMC/MH.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ..baseclass import MCMC
from ...Distributions import *
from .mcmc import MCMC
from UQpy.Distributions import *
import numpy as np

class MH(MCMC):
Expand Down
4 changes: 2 additions & 2 deletions src/UQpy/SampleMethods/MCMC/MMH.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ..baseclass import MCMC
from ...Distributions import *
from .mcmc import MCMC
from UQpy.Distributions import *
import numpy as np

class MMH(MCMC):
Expand Down
4 changes: 2 additions & 2 deletions src/UQpy/SampleMethods/MCMC/Stretch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ..baseclass import MCMC
from ...Distributions import *
from .mcmc import MCMC
from UQpy.Distributions import *
import numpy as np

class Stretch(MCMC):
Expand Down
1 change: 1 addition & 0 deletions src/UQpy/SampleMethods/MCMC/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .Stretch import Stretch
from .DRAM import DRAM
from .DREAM import DREAM
from .mcmc import MCMC



Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from ...Distributions import Distribution
from UQpy.Distributions import Distribution

class MCMC:
"""
Expand Down
2 changes: 1 addition & 1 deletion src/UQpy/SampleMethods/MCS.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..Distributions import *
from UQpy.Distributions import *
import numpy as np

########################################################################################################################
Expand Down
1 change: 1 addition & 0 deletions src/UQpy/SampleMethods/RSS/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .rectangular import RectangularRSS
from .voronoi import VoronoiRSS
from .rss import RSS

2 changes: 1 addition & 1 deletion src/UQpy/SampleMethods/RSS/rectangular.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..baseclass import RSS
from .rss import RSS
from ..STS import RectangularSTS
import numpy as np
import scipy.stats as stats
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/UQpy/SampleMethods/RSS/voronoi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..baseclass import RSS
from .rss import RSS
import scipy.stats as stats
import numpy as np
from ..Strata import VoronoiStrata, DelaunayStrata
Expand Down
2 changes: 1 addition & 1 deletion src/UQpy/SampleMethods/STS/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .delaunay import DelaunaySTS
from .rectangular import RectangularSTS
from .voronoi import VoronoiSTS

from .sts import STS
2 changes: 1 addition & 1 deletion src/UQpy/SampleMethods/STS/delaunay.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..baseclass import STS
from .sts import STS
import scipy.stats as stats
import numpy as np
from ..Strata import DelaunayStrata
Expand Down
2 changes: 1 addition & 1 deletion src/UQpy/SampleMethods/STS/rectangular.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..baseclass import STS
from .sts import STS
from ..Strata import RectangularStrata
import numpy as np
import scipy.stats as stats
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/UQpy/SampleMethods/STS/voronoi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..baseclass import STS
from .sts import STS
import scipy.stats as stats
import numpy as np
from ..Strata import VoronoiStrata
Expand Down
2 changes: 1 addition & 1 deletion src/UQpy/SampleMethods/Simplex.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..Distributions import *
from UQpy.Distributions import *
import numpy as np
import scipy.stats as stats

Expand Down
1 change: 1 addition & 0 deletions src/UQpy/SampleMethods/Strata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .delaunay import DelaunayStrata
from .rectangular import RectangularStrata
from .voronoi import VoronoiStrata
from .strata import Strata


4 changes: 2 additions & 2 deletions src/UQpy/SampleMethods/Strata/delaunay.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ..baseclass import Strata
from ...Distributions import *
from .strata import Strata
from UQpy.Distributions import *
import numpy as np
import scipy.stats as stats

Expand Down
4 changes: 2 additions & 2 deletions src/UQpy/SampleMethods/Strata/rectangular.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ..baseclass import Strata
from ...Distributions import *
from .strata import Strata
from UQpy.Distributions import *
import numpy as np

class RectangularStrata(Strata):
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/UQpy/SampleMethods/Strata/voronoi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ..baseclass import Strata
from ...Distributions import *
from .strata import Strata
from UQpy.Distributions import *
import numpy as np
import scipy.stats as stats

Expand Down
3 changes: 1 addition & 2 deletions src/UQpy/SampleMethods/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
from .STS import *
from .MCMC import *
from .Strata import *
from .baseclass import *

from . import (
baseclass, MCMC, RSS, STS, Strata
MCMC, RSS, STS, Strata
)
6 changes: 0 additions & 6 deletions src/UQpy/SampleMethods/baseclass/__init__.py

This file was deleted.

4 changes: 2 additions & 2 deletions src/UQpy/Sensitivity/Morris.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
- ``Morris``: Class to compute sensitivity indices based on the Morris method.
"""

from ..Distributions import *
from ..RunModel import RunModel
from UQpy.Distributions import *
from UQpy.RunModel import RunModel
import numpy as np

class Morris:
Expand Down
6 changes: 3 additions & 3 deletions src/UQpy/StochasticProcess/BSRM.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import numpy as np
from ..Distributions import *
from UQpy.Distributions import *
import itertools
from scipy.linalg import sqrtm
from ..Utilities import *
from .baseclass import inverse_wiener_khinchin_transform, wiener_khinchin_transform, scaling_correlation_function
from UQpy.Utilities import *
from .supportive import inverse_wiener_khinchin_transform, wiener_khinchin_transform, scaling_correlation_function

########################################################################################################################
########################################################################################################################
Expand Down
6 changes: 3 additions & 3 deletions src/UQpy/StochasticProcess/InverseTranslation.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import numpy as np
from ..Distributions import *
from UQpy.Distributions import *
import itertools
from scipy.linalg import sqrtm
from ..Utilities import *
from .baseclass import inverse_wiener_khinchin_transform, wiener_khinchin_transform, scaling_correlation_function
from UQpy.Utilities import *
from .supportive import inverse_wiener_khinchin_transform, wiener_khinchin_transform, scaling_correlation_function


########################################################################################################################
Expand Down
Loading

0 comments on commit f76c9c1

Please sign in to comment.