src package
Submodules
src.ACBICI.calibrator module
src.ACBICI.gprocess module
src.ACBICI.kernels module
Created on Tue Jan 28
@author: Christina Schenk, Ignacio Romero
- class src.ACBICI.kernels.Expo(*args, **kwargs)[source]
Bases:
kernelExponential kernel. Exponential growth. Rate increases as input increases.
- evalkernel(dist, lamb, beta)[source]
Evaluates the kernel for a distance ‘dist’, given the two hyperparameters lambda and beta. All the kernels must be of the form k = lambda * f(distance/beta)
- Parameters:
dist (distance)
lamb (hyperparameter lambda)
beta (hyperparameter beta)
- Return type:
kernel evaluation
- class src.ACBICI.kernels.Matern32(*args, **kwargs)[source]
Bases:
kernelOnce differentiable Matern kernel.
- evalkernel(dist, lamb, beta)[source]
Evaluates the kernel for a distance ‘dist’, given the two hyperparameters lambda and beta. All the kernels must be of the form k = lambda * f(distance/beta)
- Parameters:
dist (distance)
lamb (hyperparameter lambda)
beta (hyperparameter beta)
- Return type:
kernel evaluation
- class src.ACBICI.kernels.Matern52(*args, **kwargs)[source]
Bases:
kernelTwice differentiable Matern kernel.
- evalkernel(dist, lamb, beta)[source]
Evaluates the kernel for a distance ‘dist’, given the two hyperparameters lambda and beta. All the kernels must be of the form k = lambda * f(distance/beta)
- Parameters:
dist (distance)
lamb (hyperparameter lambda)
beta (hyperparameter beta)
- Return type:
kernel evaluation
- class src.ACBICI.kernels.MultiTask(*args, **kwargs)[source]
Bases:
kernelMulti Task kernel assuming that tasks independent, just comparing for same task dimension 0 for different tasks or matern3/2 kernel if same task
- evalkernel(dist, lamb, beta, x1=None, x2=None)[source]
Evaluates the kernel for a distance ‘dist’, given the two hyperparameters lambda and beta. All the kernels must be of the form k = lambda * f(distance/beta)
- Parameters:
dist (distance)
lamb (hyperparameter lambda)
beta (hyperparameter beta)
- Return type:
kernel evaluation
- class src.ACBICI.kernels.RatQuad(*args, **kwargs)[source]
Bases:
kernelRational quadratic kernel with alpha=1.
- evalkernel(dist, lamb, beta)[source]
Evaluates the kernel for a distance ‘dist’, given the two hyperparameters lambda and beta. All the kernels must be of the form k = lambda * f(distance/beta)
- Parameters:
dist (distance)
lamb (hyperparameter lambda)
beta (hyperparameter beta)
- Return type:
kernel evaluation
- class src.ACBICI.kernels.SqExpo(*args, **kwargs)[source]
Bases:
kernelSquared exponential kernel (RBF or Gaussian Kernel).
- evalkernel(dist, lamb, beta, x1, x2)[source]
Evaluates the kernel for a distance ‘dist’, given the two hyperparameters lambda and beta. All the kernels must be of the form k = lambda * f(distance/beta)
- Parameters:
dist (distance)
lamb (hyperparameter lambda)
beta (hyperparameter beta)
- Return type:
kernel evaluation
- class src.ACBICI.kernels.kernel(*args, **kwargs)[source]
Bases:
ABC- abstractmethod evalkernel(dist, lamb, beta, x1=None, x2=None)[source]
Evaluates the kernel for a distance ‘dist’, given the two hyperparameters lambda and beta. All the kernels must be of the form k = lambda * f(distance/beta)
- Parameters:
dist (distance)
lamb (hyperparameter lambda)
beta (hyperparameter beta)
- Return type:
kernel evaluation
src.ACBICI.randomprocess module
src.ACBICI.priors module
Created on Nov 25 2024 Class for probability priors.
@author: Christina Schenk, Ignacio Romero
- class src.ACBICI.priors.Cauchy(*args, **kwargs)[source]
Bases:
priorPrior distribution of the class Cauchy with parameters mu and sigma
The PDF is p(x) = 2/(pi sigma) * 1/(1+ (x-mu)^2/sigma^2) for any x The distribution is identical to the half-Cauchy, the difference being that the random variable might be any real number.
See: https://distribution-explorer.github.io/continuous/cauchy.html https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.cauchy.html#scipy.stats.cauchy
- class src.ACBICI.priors.Gamma(*args, **kwargs)[source]
Bases:
priorPrior distribution of the class Gamma with shape parameter alpha and rate parameter beta.
The PDF is p(x) = 1/Gamma(alpha) * beta^alpha * x^(alpha-1) * exp[-beta x] with mean alpha/beta and variance alpha/beta**2
See: https://distribution-explorer.github.io/continuous/gamma.html https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.gamma.html#scipy.stats.gamma
- class src.ACBICI.priors.HalfCauchy(*args, **kwargs)[source]
Bases:
priorPrior distribution of the class half-Cauchy with parameters mu and sigma
The PDF is p(x) = 2/(pi sigma) * 1/(1+ (x-mu)^2/sigma^2) for x >= mu
See https://distribution-explorer.github.io/continuous/halfcauchy.html
- class src.ACBICI.priors.HalfNormal(*args, **kwargs)[source]
Bases:
priorPrior distribution of the class half-normal with parameters mu and sigma
See https://distribution-explorer.github.io/continuous/halfnormal.html
- class src.ACBICI.priors.Normal(*args, **kwargs)[source]
Bases:
priorPrior distribution of the class norm with parameters mu and sigma
The PDF is p(x) = 1/sqrt(2pi sigma^2) * exp[-0.5 (x-mu)^2/sigma^2]
See: https://distribution-explorer.github.io/continuous/norm.html https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.norm.html#scipy.stats.norm
- class src.ACBICI.priors.Uniform(*args, **kwargs)[source]
Bases:
priorUniform prior distribution in the interval [a,b]. Probability density function is p(x) = 1/(b-a) for a <= x <= b.
See https://distribution-explorer.github.io/continuous/uniform.html
- class src.ACBICI.priors.Weibull(*args, **kwargs)[source]
Bases:
priorWeibull prior distribution. Probability density function is p(x) = 0 x<= 0 p(x) = (k/lambda) * (x/lambda)^(k-1) * exp(-(x/lambda)^k)
See https://distribution-explorer.github.io/continuous/weibull.html
- class src.ACBICI.priors.prior(*args, **kwargs)[source]
Bases:
ABC- bounds()[source]
Return lower and upper bound values of the distribution. Either can be -np.inf or +np.inf
- Parameters:
None
- Returns:
lower (lower bound)
upper (upper bound)
- guessInterval()[source]
Return a fair interval for the expected value of the variable
- Parameters:
None
- Returns:
lower (lower bound)
upper (upper bound)
- logProbability(x)[source]
Log of the probability density function.
- Parameters:
x (scalar at which the log-pdf has to be evaluated.)
- Return type:
logpdf(x)
- mean()[source]
Return the mean of the prior distribution.
- Parameters:
None
- Return type:
mean of the distribution
- pdf(x)[source]
Calculate the PDF at the values x.
- Parameters:
x (scalar at which the pdf has to be evaluated.)
- Return type:
pdf(x)
- ppf(percentiles)[source]
Calculate the percentiles point function for input(s)
- Parameters:
percentiles (array of scalars of the percentiles that need to be calculated.) – values should be in [0,1]
- Return type:
array with the values of the random variable where the percentiles are attained.
- abstractmethod print(file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]
Write on file information about the probability distribution.