| Title: | Boltzmann-Rosenbrock Distribution and Associated Copula |
|---|---|
| Description: | Provides the probability density function, cumulative distribution function, quantile function, and random sample generation for the Boltzmann-Rosenbrock distribution. The package also includes functions for the marginal distributions of X and Y, the mutual information between the two components, and the copula associated with the distribution, including its density, distribution function, and sampling routines. The use of Boltzmann distribution in objective functions, such as the Rosenbrock function, is described in Segovia-Domínguez, I., Valdez, S.I. and Hernández-Aguirre, A. (2014) <doi:10.5220/0005079902510258>. |
| Authors: | Rogelio Salinas Gutiérrez [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-1669-4460>), Jhon Daniel Aguilar Payares [aut, cph] (ORCID: <https://orcid.org/0009-0009-6509-4486>), Alejandro Fausto Cortés Salinas [aut, cph] (ORCID: <https://orcid.org/0009-0000-2536-2663>), Sofía Isabel Soledad Limón [aut, cph] (ORCID: <https://orcid.org/0009-0003-5743-5689>), Rogelio Emiliano Salinas Gutiérrez [aut, cph] (ORCID: <https://orcid.org/0009-0008-4581-5656>), Juan Pablo Salinas Muñoz [aut, cph] (ORCID: <https://orcid.org/0009-0005-4544-1584>), Pedro Abraham Montoya Calzada [aut, cph] (ORCID: <https://orcid.org/0009-0002-3497-210X>) |
| Maintainer: | Rogelio Salinas Gutiérrez <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-10-24 18:23:33 UTC |
| Source: | https://github.com/cran/boltzrosen |
Computes the joint probability density function of the Boltzmann-Rosenbrock distribution for a set of two-dimensional observations. The joint density is calculated as the product of the marginal density of X and the conditional density of Y given X.
dboltzrosen(x, beta=1, a=1, b=100)dboltzrosen(x, beta=1, a=1, b=100)
x |
A numeric matrix with exactly two columns representing the observations of the random variables X and Y. Each row corresponds to one observation, with the first column representing X and the second column representing Y. |
beta |
A positive numeric value controlling the variance of the marginal and conditional distributions. The variance of X is |
a |
A numeric value representing the mean of the marginal distribution of X. The default value is |
b |
A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean |
The Boltzmann-Rosenbrock distribution is constructed from the Rosenbrock function, which is commonly used as a benchmark in optimization problems. The joint density function can be expressed as
where the marginal distribution of X is normal with mean a and variance beta,
and the conditional distribution of Y given X=x is normal with mean x^2 and variance beta/b,
The function evaluates the marginal density using dnorm() with mean a and standard deviation sqrt(beta). The conditional density is evaluated using dnorm() with mean x[i,1]^2 and standard deviation sqrt(beta/b). The product of these two densities gives the joint density for each observation.
The parameter beta is defined as , where is the Boltzmann constant and is the absolute temperature. This parameter is introduced to simplify the notation of the Boltzmann-Rosenbrock distribution. Consequently, the marginal variance of X is , and the conditional variance of Y given X is .
A numeric vector containing the joint density values for each row of the input matrix. The length of the returned vector is equal to the number of rows in x.
The input must be a matrix with two columns. The parameters beta and b must be positive to ensure valid standard deviations for the normal distributions.
Rogelio Salinas Gutiérrez, Jhon Daniel Aguilar Payares, Alejandro Fausto Cortés Salinas, Sofía Isabel Soledad Limón, Rogelio Emiliano Salinas Gutiérrez, Juan Pablo Salinas Muñoz, Pedro Abraham Montoya Calzada.
Pagani, F., Wiegand, M., & Nadarajah, S. (2021). An n-dimensional Rosenbrock distribution for Markov chain Monte Carlo testing. Scandinavian Journal of Statistics, 49(2), 657-680. doi:10.1111/sjos.12532
Segovia-Domínguez, I., Valdez, S.I. and Hernández-Aguirre, A. (2014). A Boltzmann Multivariate Estimation of Distribution Algorithm for Continuous Optimization. In Proceedings of the International Conference on Evolutionary Computation Theory and Applications (IJCCI 2014) - ECTA, (pp. 251-258). SciTePress. doi:10.5220/0005079902510258
# Define a matrix of observations points <- matrix(c( 0, 0, 1, 1, 2, 4 ), ncol = 2, byrow = TRUE) # Evaluate the joint density dboltzrosen(points) # Evaluate the density with different parameters dboltzrosen(points, beta = 2, a = 1, b = 100)# Define a matrix of observations points <- matrix(c( 0, 0, 1, 1, 2, 4 ), ncol = 2, byrow = TRUE) # Evaluate the joint density dboltzrosen(points) # Evaluate the density with different parameters dboltzrosen(points, beta = 2, a = 1, b = 100)
Computes the probability density function of the copula associated with the Boltzmann-Rosenbrock distribution. The copula density is obtained by dividing the joint density by the product of the marginal densities, evaluated at the corresponding quantiles.
dcboltzrosen(u, beta=1, a=1, b=100)dcboltzrosen(u, beta=1, a=1, b=100)
u |
A numeric matrix or data frame with two columns containing probability values in the interval [0,1]. The first column represents the probability associated with the marginal distribution of X, and the second column represents the probability associated with the marginal distribution of Y. A numeric vector can also be supplied and is converted into a two-column matrix. |
beta |
A positive numeric value defined as |
a |
A numeric value representing the mean of the marginal distribution of X. The default value is |
b |
A positive numeric value controlling the conditional variance of Y given X. The conditional variance is |
The Boltzmann-Rosenbrock copula is derived from the joint distribution of the random variables X and Y. According to Sklar's theorem, the copula density can be expressed as
where and . Here, is the joint density of the Boltzmann-Rosenbrock distribution, while and are the marginal densities of X and Y, respectively.
The function first converts a data frame into a matrix or a numeric vector into a two-column matrix, when necessary. It then calculates the corresponding quantiles using qxboltzrosen() and qyboltzrosen() to obtain the values of X and Y.
For observations with finite quantiles, the function evaluates the joint density using dboltzrosen(), the marginal density of X using dxboltzrosen(), and the marginal density of Y using dyboltzrosen_crestas(). The copula density is calculated as the ratio of the joint density to the product of the marginal densities.
If either quantile is non-finite, the function returns zero for that observation. It also returns zero when the product of the marginal densities is less than or equal to , avoiding division by a numerically negligible denominator.
The function stops with an error if any non-missing probability value lies outside the interval [0,1].
A numeric vector containing the copula density values corresponding to the rows of the input matrix. The length of the returned vector is equal to the number of rows in the processed input matrix.
The parameters beta and b must be positive to ensure valid standard deviations in the underlying normal distributions.
The implementation assigns zero to observations for which either quantile is non-finite, as well as to observations whose product of marginal densities is less than or equal to . These are numerical handling rules implemented by the function and do not, by themselves, establish that the mathematical copula density is zero at the corresponding points.
Rogelio Salinas Gutiérrez, Jhon Daniel Aguilar Payares, Alejandro Fausto Cortés Salinas, Sofía Isabel Soledad Limón, Rogelio Emiliano Salinas Gutiérrez, Juan Pablo Salinas Muñoz, Pedro Abraham Montoya Calzada.
Nelsen, R.B. (2006). An Introduction to Copulas. Springer. doi:10.1007/0-387-28678-0
#Define probability pairs u <- matrix(c( 0.25, 0.30, 0.50, 0.50, 0.75, 0.80 ), ncol = 2, byrow = TRUE) # Evaluate the copula density dcboltzrosen(u) # Evaluate with different parameters dcboltzrosen(u, beta = 2, a = 1, b = 100)#Define probability pairs u <- matrix(c( 0.25, 0.30, 0.50, 0.50, 0.75, 0.80 ), ncol = 2, byrow = TRUE) # Evaluate the copula density dcboltzrosen(u) # Evaluate with different parameters dcboltzrosen(u, beta = 2, a = 1, b = 100)
Computes the marginal probability density function of the X component of the Boltzmann-Rosenbrock distribution.
dxboltzrosen(x, beta = 1, a = 1, b = 100)dxboltzrosen(x, beta = 1, a = 1, b = 100)
x |
A numeric vector of quantiles. |
beta |
A positive numeric value controlling the variance of the marginal distribution of X. The variance of X is |
a |
A numeric value representing the mean of the marginal distribution of X. The default value is |
b |
A positive numeric value included for consistency with other functions of the Boltzmann-Rosenbrock distribution. It is not used in this function. The default value is |
The marginal distribution of X in the Boltzmann-Rosenbrock distribution is normal with mean and variance :
The density is evaluated using dnorm(x, mean = a, sd = sqrt(beta)).
The parameter beta is defined as , where is the Boltzmann constant and is the absolute temperature. This parameter is introduced to simplify the notation of the Boltzmann-Rosenbrock distribution.
Although the argument b appears in the function signature, it does not affect the marginal density of X and is ignored.
A numeric vector of density values corresponding to x. The length of the returned vector is equal to the length of x.
The parameter beta must be positive to ensure a valid standard deviation for the normal distribution. The argument b is not used by this function but is kept for compatibility with dboltzrosen and other functions in the package.
Rogelio Salinas Gutiérrez, Jhon Daniel Aguilar Payares, Alejandro Fausto Cortés Salinas, Sofía Isabel Soledad Limón, Rogelio Emiliano Salinas Gutiérrez, Juan Pablo Salinas Muñoz, Pedro Abraham Montoya Calzada.
Chan, S. (2026). Introduction to Probability for Data Science. Michigan Publishing. https://probability4datascience.com
# Evaluate the marginal density at a single point dxboltzrosen(0) # Evaluate at several points dxboltzrosen(c(0, 1, 2), beta = 2, a = 1) # The argument b is ignored dxboltzrosen(0, b = 50)# Evaluate the marginal density at a single point dxboltzrosen(0) # Evaluate at several points dxboltzrosen(c(0, 1, 2), beta = 2, a = 1) # The argument b is ignored dxboltzrosen(0, b = 50)
Computes the marginal probability density function of the Y component of the Boltzmann-Rosenbrock distribution. Since the marginal density of Y has no closed form, it is evaluated by numerical integration of the joint density over X using Gauss-Legendre quadrature.
dyboltzrosen(y, beta = 1, a = 1, b = 100, L = 120, npt = 120)dyboltzrosen(y, beta = 1, a = 1, b = 100, L = 120, npt = 120)
y |
A numeric vector of quantiles. |
beta |
A positive numeric value controlling the variance of the marginal distribution of X. The variance of X is |
a |
A numeric value representing the mean of the marginal distribution of X. The default value is |
b |
A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean |
L |
A positive numeric value controlling the truncation level for the integration domain around each ridge of the integrand. The level set is defined by |
npt |
A positive integer giving the number of Gauss-Legendre quadrature nodes used in each integration subinterval. The default value is |
The marginal density of Y is given by
where the marginal distribution of X is normal with mean and variance ,
and the conditional distribution of Y given X = x is normal with mean and variance ,
Therefore,
This integral does not have a closed form. The function finds the ridges (local maxima) of the integrand in the direction for a given , determines integration windows around each ridge using the level set , and then applies Gauss-Legendre quadrature with npt nodes to each window. The parameter L controls how far from the peak the integration is truncated; larger values increase accuracy at the cost of a wider integration domain. The parameter npt controls the number of quadrature nodes per window.
The parameter beta is defined as , where is the Boltzmann constant and is the absolute temperature. This parameter is introduced to simplify the notation of the Boltzmann-Rosenbrock distribution.
A numeric vector containing the marginal density values corresponding to y. The length of the returned vector is equal to the length of y.
The parameters beta and b must be positive to ensure valid standard deviations for the normal distributions. The function may stop with an error if no ridges or integration boundaries are found for a given value of y; this typically indicates that the chosen L or npt is inadequate or that y is far in the tails.
Rogelio Salinas Gutiérrez, Jhon Daniel Aguilar Payares, Alejandro Fausto Cortés Salinas, Sofía Isabel Soledad Limón, Rogelio Emiliano Salinas Gutiérrez, Juan Pablo Salinas Muñoz, Pedro Abraham Montoya Calzada.
Chan, S. (2026). Introduction to Probability for Data Science. Michigan Publishing. https://probability4datascience.com
# Evaluate the marginal density of Y at a single point dyboltzrosen(1) # Evaluate at several points with different parameters dyboltzrosen(c(0, 1, 4), beta = 2, a = 1, b = 100) # Increase the truncation level for greater accuracy dyboltzrosen(1, L = 150, npt = 200)# Evaluate the marginal density of Y at a single point dyboltzrosen(1) # Evaluate at several points with different parameters dyboltzrosen(c(0, 1, 4), beta = 2, a = 1, b = 100) # Increase the truncation level for greater accuracy dyboltzrosen(1, L = 150, npt = 200)
Computes the mutual information between the random variables X and Y of the Boltzmann-Rosenbrock distribution. The mutual information is obtained as the difference between the marginal entropy of Y and the conditional entropy of Y given X.
miboltzrosen(beta = 1, a = 1, b = 100)miboltzrosen(beta = 1, a = 1, b = 100)
beta |
A positive numeric value controlling the variance of the marginal distribution of X. The variance of X is |
a |
A numeric value representing the mean of the marginal distribution of X. The default value is |
b |
A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean |
The mutual information between X and Y is defined as
where is the marginal entropy of Y and is the conditional entropy of Y given X.
For the Boltzmann-Rosenbrock distribution, the conditional distribution of Y given X = x is normal with mean and variance . Therefore, the conditional entropy has a closed form:
The marginal entropy of Y is given by
which has no closed form. The function evaluates this integral numerically using integrate().
The parameter beta is defined as , where is the Boltzmann constant and is the absolute temperature.
A numeric scalar with the estimated mutual information .
This function depends on dyboltzrosen. The integration is performed with integrate(), and a warning is issued if the integration routine does not return a successful message. The parameters beta and b must be positive.
Rogelio Salinas Gutiérrez, Jhon Daniel Aguilar Payares, Alejandro Fausto Cortés Salinas, Sofía Isabel Soledad Limón, Rogelio Emiliano Salinas Gutiérrez, Juan Pablo Salinas Muñoz, Pedro Abraham Montoya Calzada.
Bishop, C.M. (2006). Pattern Recognition and Machine Learning. Springer. https://link.springer.com/book/9780387310732
# Compute mutual information with default parameters miboltzrosen() # Compute with different parameters miboltzrosen(beta = 2, a = 1, b = 100)# Compute mutual information with default parameters miboltzrosen() # Compute with different parameters miboltzrosen(beta = 2, a = 1, b = 100)
Computes the joint cumulative distribution function of the Boltzmann-Rosenbrock distribution for a set of two-dimensional observations.
pboltzrosen(x, beta = 1, a = 1, b = 100)pboltzrosen(x, beta = 1, a = 1, b = 100)
x |
A numeric matrix with exactly two columns representing the observations of the random variables X and Y. Each row corresponds to one observation, with the first column representing X and the second column representing Y. A numeric vector of length 2 is also accepted and will be coerced into a one-row matrix. |
beta |
A positive numeric value controlling the variance of the marginal and conditional distributions. The variance of X is |
a |
A numeric value representing the mean of the marginal distribution of X. The default value is |
b |
A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean |
The joint cumulative distribution function is defined as
where is the marginal density of X, which is normal with mean and variance ,
and is the conditional cumulative distribution function of Y given X = s, which is normal with mean and variance ,
The integral is evaluated numerically using integrate(). The lower limit of integration is set to , and the upper limit is , effectively truncating the integration at ten standard deviations from the mean of X. If is less than or equal to the lower limit, the function returns zero.
The parameter beta is defined as , where is the Boltzmann constant and is the absolute temperature.
A numeric vector containing the joint cumulative distribution values for each row of the input matrix. The length of the returned vector is equal to the number of rows in x.
The input must be a matrix with two columns or a numeric vector of length two. The parameters beta and b must be positive. The integration limits are truncated at ten standard deviations of the marginal distribution of X, which introduces a small approximation error in the tails.
Rogelio Salinas Gutiérrez, Jhon Daniel Aguilar Payares, Alejandro Fausto Cortés Salinas, Sofía Isabel Soledad Limón, Rogelio Emiliano Salinas Gutiérrez, Juan Pablo Salinas Muñoz, Pedro Abraham Montoya Calzada.
Pagani, F., Wiegand, M., & Nadarajah, S. (2021). An n-dimensional Rosenbrock distribution for Markov chain Monte Carlo testing. Scandinavian Journal of Statistics, 49(2), 657-680. doi:10.1111/sjos.12532
Segovia-Domínguez, I., Valdez, S.I. and Hernández-Aguirre, A. (2014). A Boltzmann Multivariate Estimation of Distribution Algorithm for Continuous Optimization. In Proceedings of the International Conference on Evolutionary Computation Theory and Applications (IJCCI 2014) - ECTA, (pp. 251-258). SciTePress. doi:10.5220/0005079902510258
# Define a matrix of observations points <- matrix(c( 0, 0, 1, 1, 2, 4 ), ncol = 2, byrow = TRUE) # Evaluate the joint CDF pboltzrosen(points) # Evaluate with different parameters pboltzrosen(points, beta = 2, a = 1, b = 100) # A single observation can be given as a vector pboltzrosen(c(1, 1))# Define a matrix of observations points <- matrix(c( 0, 0, 1, 1, 2, 4 ), ncol = 2, byrow = TRUE) # Evaluate the joint CDF pboltzrosen(points) # Evaluate with different parameters pboltzrosen(points, beta = 2, a = 1, b = 100) # A single observation can be given as a vector pboltzrosen(c(1, 1))
Computes the cumulative distribution function of the copula associated with the Boltzmann-Rosenbrock distribution. The copula is obtained via Sklar's theorem as , where and .
pcboltzrosen(u, beta = 1, a = 1, b = 100)pcboltzrosen(u, beta = 1, a = 1, b = 100)
u |
A numeric matrix with exactly two columns representing the probabilities |
beta |
A positive numeric value controlling the variance of the marginal and conditional distributions. The variance of X is |
a |
A numeric value representing the mean of the marginal distribution of X. The default value is |
b |
A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean |
The copula associated with the Boltzmann-Rosenbrock distribution is defined by
where and . The function first transforms the probabilities and into the corresponding quantiles and using qxboltzrosen() and qyboltzrosen(), respectively. Then it evaluates the joint cumulative distribution function using pboltzrosen().
The parameters beta, a, and b are passed to all internal functions.
The input probabilities must lie in the interval . If any value is outside this range, the function stops with an error. The returned values are forced to lie in using pmin() and pmax() to correct any numerical rounding errors.
The parameter beta is defined as , where is the Boltzmann constant and is the absolute temperature.
A numeric vector containing the copula distribution values for each row of the input matrix. The length of the returned vector is equal to the number of rows in u.
This function depends on qxboltzrosen, qyboltzrosen, and pboltzrosen. The parameters beta and b must be positive. The input probabilities must be in ; otherwise, an error is raised.
Rogelio Salinas Gutiérrez, Jhon Daniel Aguilar Payares, Alejandro Fausto Cortés Salinas, Sofía Isabel Soledad Limón, Rogelio Emiliano Salinas Gutiérrez, Juan Pablo Salinas Muñoz, Pedro Abraham Montoya Calzada.
Nelsen, R.B. (2006). An Introduction to Copulas. Springer. doi:10.1007/0-387-28678-0
# Define a matrix of probabilities probs <- matrix(c( 0.1, 0.2, 0.5, 0.5, 0.9, 0.8 ), ncol = 2, byrow = TRUE) # Evaluate the copula CDF pcboltzrosen(probs) # Evaluate with different parameters pcboltzrosen(probs, beta = 2, a = 1, b = 100) # A single observation can be given as a vector pcboltzrosen(c(0.5, 0.5))# Define a matrix of probabilities probs <- matrix(c( 0.1, 0.2, 0.5, 0.5, 0.9, 0.8 ), ncol = 2, byrow = TRUE) # Evaluate the copula CDF pcboltzrosen(probs) # Evaluate with different parameters pcboltzrosen(probs, beta = 2, a = 1, b = 100) # A single observation can be given as a vector pcboltzrosen(c(0.5, 0.5))
Computes the marginal cumulative distribution function of the X component of the Boltzmann-Rosenbrock distribution.
pxboltzrosen(x, beta = 1, a = 1, b = 100)pxboltzrosen(x, beta = 1, a = 1, b = 100)
x |
A numeric vector of quantiles. |
beta |
A positive numeric value controlling the variance of the marginal distribution of X. The variance of X is |
a |
A numeric value representing the mean of the marginal distribution of X. The default value is |
b |
A positive numeric value included for consistency with other functions of the Boltzmann-Rosenbrock distribution. It is not used in this function. The default value is |
The marginal distribution of X in the Boltzmann-Rosenbrock distribution is normal with mean and variance :
The cumulative distribution is evaluated using pnorm(x, mean = a, sd = sqrt(beta)).
The parameter beta is defined as , where is the Boltzmann constant and is the absolute temperature. This parameter is introduced to simplify the notation of the Boltzmann-Rosenbrock distribution.
Although the argument b appears in the function signature, it does not affect the marginal distribution of X and is ignored.
A numeric vector of probabilities corresponding to x. The length of the returned vector is equal to the length of x.
The parameter beta must be positive to ensure a valid standard deviation for the normal distribution. The argument b is not used by this function but is kept for compatibility with dboltzrosen and other functions in the package.
Rogelio Salinas Gutiérrez, Jhon Daniel Aguilar Payares, Alejandro Fausto Cortés Salinas, Sofía Isabel Soledad Limón, Rogelio Emiliano Salinas Gutiérrez, Juan Pablo Salinas Muñoz, Pedro Abraham Montoya Calzada.
Chan, S. (2026). Introduction to Probability for Data Science. Michigan Publishing. https://probability4datascience.com
# Evaluate the marginal CDF at a single point pxboltzrosen(0) # Evaluate at several points pxboltzrosen(c(0, 1, 2), beta = 2, a = 1) # The argument b is ignored pxboltzrosen(0, b = 50)# Evaluate the marginal CDF at a single point pxboltzrosen(0) # Evaluate at several points pxboltzrosen(c(0, 1, 2), beta = 2, a = 1) # The argument b is ignored pxboltzrosen(0, b = 50)
Computes the marginal cumulative distribution function of the Y component of the Boltzmann-Rosenbrock distribution.
pyboltzrosen(y, beta = 1, a = 1, b = 100)pyboltzrosen(y, beta = 1, a = 1, b = 100)
y |
A numeric vector of quantiles. |
beta |
A positive numeric value controlling the variance of the marginal and conditional distributions. The variance of X is |
a |
A numeric value representing the mean of the marginal distribution of X. The default value is |
b |
A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean |
The marginal cumulative distribution function of Y is defined as
Using the joint cumulative distribution function , the marginal CDF of Y can be obtained by taking the limit as :
This function exploits that identity by constructing a matrix with first column equal to Inf and second column equal to y, and then calling pboltzrosen(). The joint CDF is evaluated numerically by pboltzrosen(), which integrates the marginal density of X times the conditional CDF of Y given X.
The parameter beta is defined as , where is the Boltzmann constant and is the absolute temperature.
A numeric vector of probabilities corresponding to y. The length of the returned vector is equal to the length of y.
This function depends on pboltzrosen. The parameters beta and b must be positive. Because the joint CDF is evaluated by numerical integration, this function may be slow for large vectors y.
Rogelio Salinas Gutiérrez, Jhon Daniel Aguilar Payares, Alejandro Fausto Cortés Salinas, Sofía Isabel Soledad Limón, Rogelio Emiliano Salinas Gutiérrez, Juan Pablo Salinas Muñoz, Pedro Abraham Montoya Calzada.
Chan, S. (2026). Introduction to Probability for Data Science. Michigan Publishing. https://probability4datascience.com
# Evaluate the marginal CDF of Y at a single point pyboltzrosen(1) # Evaluate at several points pyboltzrosen(c(0, 1, 4), beta = 2, a = 1, b = 100) # The result equals the joint CDF evaluated at x = Inf pyboltzrosen(1) == pboltzrosen(cbind(Inf, 1))# Evaluate the marginal CDF of Y at a single point pyboltzrosen(1) # Evaluate at several points pyboltzrosen(c(0, 1, 4), beta = 2, a = 1, b = 100) # The result equals the joint CDF evaluated at x = Inf pyboltzrosen(1) == pboltzrosen(cbind(Inf, 1))
Computes the quantile function (inverse cumulative distribution function) of the X component of the Boltzmann-Rosenbrock distribution.
qxboltzrosen(p, beta = 1, a = 1, b = 100)qxboltzrosen(p, beta = 1, a = 1, b = 100)
p |
A numeric vector of probabilities in the interval |
beta |
A positive numeric value controlling the variance of the marginal distribution of X. The variance of X is |
a |
A numeric value representing the mean of the marginal distribution of X. The default value is |
b |
A positive numeric value included for consistency with other functions of the Boltzmann-Rosenbrock distribution. It is not used in this function. The default value is |
The marginal distribution of X in the Boltzmann-Rosenbrock distribution is normal with mean and variance :
The quantile function is evaluated using qnorm(p, mean = a, sd = sqrt(beta)), which returns the value such that .
The parameter beta is defined as , where is the Boltzmann constant and is the absolute temperature. This parameter is introduced to simplify the notation of the Boltzmann-Rosenbrock distribution.
Although the argument b appears in the function signature, it does not affect the marginal distribution of X and is ignored.
A numeric vector of quantiles corresponding to p. The length of the returned vector is equal to the length of p.
The parameter beta must be positive to ensure a valid standard deviation for the normal distribution. The argument b is not used by this function but is kept for compatibility with dboltzrosen and other functions in the package.
This function is the inverse of pxboltzrosen.
Rogelio Salinas Gutiérrez, Jhon Daniel Aguilar Payares, Alejandro Fausto Cortés Salinas, Sofía Isabel Soledad Limón, Rogelio Emiliano Salinas Gutiérrez, Juan Pablo Salinas Muñoz, Pedro Abraham Montoya Calzada.
Gentle, J.E. (2009). Computational Statistics. Springer. doi:10.1007/978-0-387-98144-4
# Evaluate the marginal quantile function at a single probability qxboltzrosen(0.5) # Evaluate at several probabilities qxboltzrosen(c(0.025, 0.5, 0.975), beta = 2, a = 1) # The argument b is ignored qxboltzrosen(0.5, b = 50) # Check that qxboltzrosen is the inverse of pxboltzrosen p <- 0.75 x <- qxboltzrosen(p) pxboltzrosen(x) # Should be approximately p# Evaluate the marginal quantile function at a single probability qxboltzrosen(0.5) # Evaluate at several probabilities qxboltzrosen(c(0.025, 0.5, 0.975), beta = 2, a = 1) # The argument b is ignored qxboltzrosen(0.5, b = 50) # Check that qxboltzrosen is the inverse of pxboltzrosen p <- 0.75 x <- qxboltzrosen(p) pxboltzrosen(x) # Should be approximately p
Computes the quantile function (inverse cumulative distribution function) of the Y component of the Boltzmann-Rosenbrock distribution.
qyboltzrosen(p, beta = 1, a = 1, b = 100)qyboltzrosen(p, beta = 1, a = 1, b = 100)
p |
A numeric vector of probabilities in the interval |
beta |
A positive numeric value controlling the variance of the marginal and conditional distributions. The variance of X is |
a |
A numeric value representing the mean of the marginal distribution of X. The default value is |
b |
A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean |
The marginal distribution of Y in the Boltzmann-Rosenbrock distribution does not have a closed form. Its cumulative distribution function is given by
where is the marginal density of X, normal with mean and variance , and is the conditional CDF of Y given X = s, normal with mean and variance .
Because has no closed form, the quantile function is obtained numerically. For each probability , the returned value is the number satisfying . If a probability lies outside the range of attainable values of , the function returns or accordingly.
The parameter beta is defined as , where is the Boltzmann constant and is the absolute temperature. This parameter is introduced to simplify the notation of the Boltzmann-Rosenbrock distribution.
A numeric vector of quantiles corresponding to p. The length of the returned vector is equal to the length of p. The value NA is returned for any NA probability in p.
The parameters beta and b must be positive. Because the marginal distribution of Y has no closed form, the quantile function is obtained numerically, and therefore the computation may be slow when p is a long vector.
Rogelio Salinas Gutiérrez, Jhon Daniel Aguilar Payares, Alejandro Fausto Cortés Salinas, Sofía Isabel Soledad Limón, Rogelio Emiliano Salinas Gutiérrez, Juan Pablo Salinas Muñoz, Pedro Abraham Montoya Calzada.
Gentle, J.E. (2009). Computational Statistics. Springer. doi:10.1007/978-0-387-98144-4
# Evaluate the marginal quantile function of Y at a single probability qyboltzrosen(0.5) # Evaluate at several probabilities qyboltzrosen(c(0.025, 0.5, 0.975), beta = 2, a = 1, b = 100) # Check that qyboltzrosen is approximately the inverse of pyboltzrosen p <- 0.75 y <- qyboltzrosen(p) pyboltzrosen(y) # Should be approximately p # NA probabilities propagate to NA outputs qyboltzrosen(c(0.5, NA, 0.9))# Evaluate the marginal quantile function of Y at a single probability qyboltzrosen(0.5) # Evaluate at several probabilities qyboltzrosen(c(0.025, 0.5, 0.975), beta = 2, a = 1, b = 100) # Check that qyboltzrosen is approximately the inverse of pyboltzrosen p <- 0.75 y <- qyboltzrosen(p) pyboltzrosen(y) # Should be approximately p # NA probabilities propagate to NA outputs qyboltzrosen(c(0.5, NA, 0.9))
Generates random samples from the Boltzmann-Rosenbrock distribution using its conditional structure.
rboltzrosen(n, beta = 1, a = 1, b = 100)rboltzrosen(n, beta = 1, a = 1, b = 100)
n |
A positive integer giving the number of samples to generate. |
beta |
A positive numeric value controlling the variance of the marginal and conditional distributions. The variance of X is |
a |
A numeric value representing the mean of the marginal distribution of X. The default value is |
b |
A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean |
The Boltzmann-Rosenbrock distribution admits a conditional representation in which the marginal distribution of X is normal with mean and variance ,
and the conditional distribution of Y given X = x is normal with mean and variance ,
This function exploits that representation by first sampling the X component from its marginal distribution and then sampling the Y component from the corresponding conditional distribution. The resulting pairs are independent and identically distributed draws from the joint Boltzmann-Rosenbrock distribution.
The parameter beta is defined as , where is the Boltzmann constant and is the absolute temperature. This parameter is introduced to simplify the notation of the Boltzmann-Rosenbrock distribution.
A numeric matrix with n rows and two columns. The first column contains the sampled values of X and the second column contains the sampled values of Y.
The parameters beta and b must be positive. The argument n should be a positive integer.
Because the conditional representation is used, no rejection or iterative procedure is required, and the samples are exact draws from the target distribution.
Rogelio Salinas Gutiérrez, Jhon Daniel Aguilar Payares, Alejandro Fausto Cortés Salinas, Sofía Isabel Soledad Limón, Rogelio Emiliano Salinas Gutiérrez, Juan Pablo Salinas Muñoz, Pedro Abraham Montoya Calzada.
Gentle, J.E. (2009). Computational Statistics. Springer. doi:10.1007/978-0-387-98144-4
# Generate a sample of size 1000 with default parameters set.seed(123) sample1 <- rboltzrosen(1000) # Inspect the first rows head(sample1) # Generate a sample with different parameters sample2 <- rboltzrosen(1000, beta = 2, a = 1, b = 100) # The marginal distribution of X is normal hist(sample1[, 1], prob = TRUE, main = "Marginal of X") # The conditional distribution of Y given X can be explored by subsets x_close_to_one <- abs(sample1[, 1] - 1) < 0.1 mean(sample1[x_close_to_one, 2]) # Approximately 1# Generate a sample of size 1000 with default parameters set.seed(123) sample1 <- rboltzrosen(1000) # Inspect the first rows head(sample1) # Generate a sample with different parameters sample2 <- rboltzrosen(1000, beta = 2, a = 1, b = 100) # The marginal distribution of X is normal hist(sample1[, 1], prob = TRUE, main = "Marginal of X") # The conditional distribution of Y given X can be explored by subsets x_close_to_one <- abs(sample1[, 1] - 1) < 0.1 mean(sample1[x_close_to_one, 2]) # Approximately 1
Generates random samples from the copula associated with the Boltzmann-Rosenbrock distribution.
rcboltzrosen(n, beta = 1, a = 1, b = 100)rcboltzrosen(n, beta = 1, a = 1, b = 100)
n |
A positive integer giving the number of samples to generate. |
beta |
A positive numeric value controlling the variance of the marginal and conditional distributions. The variance of X is |
a |
A numeric value representing the mean of the marginal distribution of X. The default value is |
b |
A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean |
The copula associated with the Boltzmann-Rosenbrock distribution is obtained via Sklar's theorem from the joint distribution function and its marginal distribution functions and . It is the function satisfying
for all in .
This function generates samples from the copula by first drawing pairs from the joint Boltzmann-Rosenbrock distribution and then applying the probability integral transform to each component, i.e., computing and . The resulting pairs are uniformly distributed on and their joint distribution function is the copula .
The parameter beta is defined as , where is the Boltzmann constant and is the absolute temperature. This parameter is introduced to simplify the notation of the Boltzmann-Rosenbrock distribution.
A numeric matrix with n rows and two columns. The first column contains the sampled values of and the second column contains the sampled values of . Both columns lie in the interval .
The parameters beta and b must be positive. The argument n should be a positive integer.
Because the marginal distribution function of Y has no closed form, obtaining each sample of requires numerical evaluation of , and therefore this function may be slow when n is large.
Rogelio Salinas Gutiérrez, Jhon Daniel Aguilar Payares, Alejandro Fausto Cortés Salinas, Sofía Isabel Soledad Limón, Rogelio Emiliano Salinas Gutiérrez, Juan Pablo Salinas Muñoz, Pedro Abraham Montoya Calzada.
Gentle, J.E. (2009). Computational Statistics. Springer. doi:10.1007/978-0-387-98144-4
Nelsen, R.B. (2006). An Introduction to Copulas. Springer. doi:10.1007/0-387-28678-0
# Generate a sample of size 1000 from the copula set.seed(123) copula_sample <- rcboltzrosen(1000) # Inspect the first rows head(copula_sample) # The margins are uniform on (0,1) hist(copula_sample[, 1], main = "Marginal of u") hist(copula_sample[, 2], main = "Marginal of v") # Generate with different parameters copula_sample2 <- rcboltzrosen(1000, beta = 2, a = 1, b = 100)# Generate a sample of size 1000 from the copula set.seed(123) copula_sample <- rcboltzrosen(1000) # Inspect the first rows head(copula_sample) # The margins are uniform on (0,1) hist(copula_sample[, 1], main = "Marginal of u") hist(copula_sample[, 2], main = "Marginal of v") # Generate with different parameters copula_sample2 <- rcboltzrosen(1000, beta = 2, a = 1, b = 100)