Package 'boltzrosen'

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

Help Index


Boltzmann-Rosenbrock Density Function

Description

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.

Usage

dboltzrosen(x, beta=1, a=1, b=100)

Arguments

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 beta, while the conditional variance of Y given X is beta/b. The default value is 1.

a

A numeric value representing the mean of the marginal distribution of X. The default value is 1.

b

A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean x[,1]^2 and variance beta/b. The default value is 100.

Details

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

f(x,y)=fX(x)fY∣X(y∣x),f(x,y)=f_X(x)f_{Y|X}(y|x),

where the marginal distribution of X is normal with mean a and variance beta,

X∼N(a,β),X \sim N(a,\beta),

and the conditional distribution of Y given X=x is normal with mean x^2 and variance beta/b,

Y∣X=x∼N(x2,β/b).Y|X=x \sim N(x^2,\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 β=kT/2\beta = kT/2, where kk is the Boltzmann constant and TT is the absolute temperature. This parameter is introduced to simplify the notation of the Boltzmann-Rosenbrock distribution. Consequently, the marginal variance of X is β\beta, and the conditional variance of Y given X is β/b\beta/b.

Value

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.

Note

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.

Author(s)

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.

References

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

Examples

# 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)

Boltzmann-Rosenbrock Copula Density Function

Description

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.

Usage

dcboltzrosen(u, beta=1, a=1, b=100)

Arguments

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 β=kT/2\beta=kT/2, where kk is the Boltzmann constant and TT is the absolute temperature. It controls the variance of the marginal distribution of X and the conditional distribution of Y given X. The default value is 1.

a

A numeric value representing the mean of the marginal distribution of X. The default value is 1.

b

A positive numeric value controlling the conditional variance of Y given X. The conditional variance is β/b\beta/b. The default value is 100.

Details

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

c(u,v)=f(x,y)fX(x)fY(y),c(u,v)=\frac{f(x,y)}{f_X(x)f_Y(y)},

where u=FX(x)u=F_X(x) and v=FY(y)v=F_Y(y). Here, f(x,y)f(x,y) is the joint density of the Boltzmann-Rosenbrock distribution, while fX(x)f_X(x) and fY(y)f_Y(y) 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 10−30010^{-300}, 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].

Value

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.

Note

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 10−30010^{-300}. 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.

Author(s)

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.

References

Nelsen, R.B. (2006). An Introduction to Copulas. Springer. doi:10.1007/0-387-28678-0

Examples

#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)

Boltzmann-Rosenbrock Marginal Density Function of X

Description

Computes the marginal probability density function of the X component of the Boltzmann-Rosenbrock distribution.

Usage

dxboltzrosen(x, beta = 1, a = 1, b = 100)

Arguments

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 beta. The default value is 1.

a

A numeric value representing the mean of the marginal distribution of X. The default value is 1.

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 100.

Details

The marginal distribution of X in the Boltzmann-Rosenbrock distribution is normal with mean aa and variance β\beta:

X∼N(a,β).X \sim N(a, \beta).

The density is evaluated using dnorm(x, mean = a, sd = sqrt(beta)).

The parameter beta is defined as β=kT/2\beta = kT/2, where kk is the Boltzmann constant and TT 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.

Value

A numeric vector of density values corresponding to x. The length of the returned vector is equal to the length of x.

Note

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.

Author(s)

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.

References

Chan, S. (2026). Introduction to Probability for Data Science. Michigan Publishing. https://probability4datascience.com

Examples

# 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)

Boltzmann-Rosenbrock Marginal Density Function of Y

Description

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.

Usage

dyboltzrosen(y, beta = 1, a = 1, b = 100, L = 120, npt = 120)

Arguments

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 beta. The default value is 1.

a

A numeric value representing the mean of the marginal distribution of X. The default value is 1.

b

A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean x^2 and variance beta/b. The default value is 100.

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 h(x,y)=h(xc,y)+2βLh(x,y) = h(x_c,y) + 2\beta L, where hh is the Rosenbrock energy and xcx_c is a ridge location. The default value is 120.

npt

A positive integer giving the number of Gauss-Legendre quadrature nodes used in each integration subinterval. The default value is 120.

Details

The marginal density of Y is given by

fY(y)=∫−∞∞fX(x)fY∣X(y∣x) dx,f_Y(y) = \int_{-\infty}^{\infty} f_X(x) f_{Y|X}(y|x) \, dx,

where the marginal distribution of X is normal with mean aa and variance β\beta,

X∼N(a,β),X \sim N(a,\beta),

and the conditional distribution of Y given X = x is normal with mean x2x^2 and variance β/b\beta/b,

Y∣X=x∼N(x2,β/b).Y|X=x \sim N(x^2,\beta/b).

Therefore,

fY(y)=∫−∞∞12πβe−(x−a)22β12πβ/be−(y−x2)22β/b dx.f_Y(y) = \int_{-\infty}^{\infty} \frac{1}{\sqrt{2\pi\beta}} e^{-\frac{(x-a)^2}{2\beta}} \frac{1}{\sqrt{2\pi\beta/b}} e^{-\frac{(y-x^2)^2}{2\beta/b}} \, dx.

This integral does not have a closed form. The function finds the ridges (local maxima) of the integrand in the xx direction for a given yy, determines integration windows around each ridge using the level set h(x,y)=h(xc,y)+2βLh(x,y) = h(x_c,y) + 2\beta L, 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 β=kT/2\beta = kT/2, where kk is the Boltzmann constant and TT is the absolute temperature. This parameter is introduced to simplify the notation of the Boltzmann-Rosenbrock distribution.

Value

A numeric vector containing the marginal density values corresponding to y. The length of the returned vector is equal to the length of y.

Note

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.

Author(s)

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.

References

Chan, S. (2026). Introduction to Probability for Data Science. Michigan Publishing. https://probability4datascience.com

Examples

# 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)

Mutual Information for the Boltzmann-Rosenbrock Distribution

Description

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.

Usage

miboltzrosen(beta = 1, a = 1, b = 100)

Arguments

beta

A positive numeric value controlling the variance of the marginal distribution of X. The variance of X is beta. The default value is 1.

a

A numeric value representing the mean of the marginal distribution of X. The default value is 1.

b

A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean x^2 and variance beta/b. The default value is 100.

Details

The mutual information between X and Y is defined as

I(X,Y)=H(Y)−H(Y∣X),I(X,Y) = H(Y) - H(Y|X),

where H(Y)H(Y) is the marginal entropy of Y and H(Y∣X)H(Y|X) 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 x2x^2 and variance β/b\beta/b. Therefore, the conditional entropy has a closed form:

H(Y∣X)=12log⁡(2πeβ/b).H(Y|X) = \frac{1}{2} \log(2\pi e \beta / b).

The marginal entropy of Y is given by

H(Y)=−∫−∞∞fY(y)log⁡fY(y) dy,H(Y) = -\int_{-\infty}^{\infty} f_Y(y) \log f_Y(y) \, dy,

which has no closed form. The function evaluates this integral numerically using integrate().

The parameter beta is defined as β=kT/2\beta = kT/2, where kk is the Boltzmann constant and TT is the absolute temperature.

Value

A numeric scalar with the estimated mutual information I(X,Y)I(X,Y).

Note

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.

Author(s)

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.

References

Bishop, C.M. (2006). Pattern Recognition and Machine Learning. Springer. https://link.springer.com/book/9780387310732

Examples

# Compute mutual information with default parameters
miboltzrosen()

# Compute with different parameters
miboltzrosen(beta = 2, a = 1, b = 100)

Boltzmann-Rosenbrock Joint Distribution Function

Description

Computes the joint cumulative distribution function of the Boltzmann-Rosenbrock distribution for a set of two-dimensional observations.

Usage

pboltzrosen(x, beta = 1, a = 1, b = 100)

Arguments

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 beta, while the conditional variance of Y given X is beta/b. The default value is 1.

a

A numeric value representing the mean of the marginal distribution of X. The default value is 1.

b

A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean x^2 and variance beta/b. The default value is 100.

Details

The joint cumulative distribution function is defined as

F(x,y)=P[X≤x,Y≤y]=∫−∞xfX(s)ΦY∣X(y∣s) ds,F(x,y) = P[X \le x, Y \le y] = \int_{-\infty}^{x} f_X(s) \Phi_{Y|X}(y|s) \, ds,

where fXf_X is the marginal density of X, which is normal with mean aa and variance β\beta,

X∼N(a,β),X \sim N(a,\beta),

and ΦY∣X\Phi_{Y|X} is the conditional cumulative distribution function of Y given X = s, which is normal with mean s2s^2 and variance β/b\beta/b,

Y∣X=s∼N(s2,β/b).Y|X=s \sim N(s^2,\beta/b).

The integral is evaluated numerically using integrate(). The lower limit of integration is set to a−10βa - 10\sqrt{\beta}, and the upper limit is min⁡(x,a+10β)\min(x, a + 10\sqrt{\beta}), effectively truncating the integration at ten standard deviations from the mean of X. If xx is less than or equal to the lower limit, the function returns zero.

The parameter beta is defined as β=kT/2\beta = kT/2, where kk is the Boltzmann constant and TT is the absolute temperature.

Value

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.

Note

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.

Author(s)

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.

References

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

Examples

# 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))

Boltzmann-Rosenbrock Copula Distribution Function

Description

Computes the cumulative distribution function of the copula associated with the Boltzmann-Rosenbrock distribution. The copula is obtained via Sklar's theorem as C(u,v)=F(x,y)C(u,v) = F(x,y), where u=FX(x)u = F_X(x) and v=FY(y)v = F_Y(y).

Usage

pcboltzrosen(u, beta = 1, a = 1, b = 100)

Arguments

u

A numeric matrix with exactly two columns representing the probabilities uu and vv in the unit interval [0,1][0,1]. Each row corresponds to one observation, with the first column representing u=FX(x)u = F_X(x) and the second column representing v=FY(y)v = F_Y(y). A numeric vector of length 2 or a data frame with two columns is also accepted and will be coerced into a matrix.

beta

A positive numeric value controlling the variance of the marginal and conditional distributions. The variance of X is beta, while the conditional variance of Y given X is beta/b. The default value is 1.

a

A numeric value representing the mean of the marginal distribution of X. The default value is 1.

b

A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean x^2 and variance beta/b. The default value is 100.

Details

The copula associated with the Boltzmann-Rosenbrock distribution is defined by

C(u,v)=F(x,y),C(u,v) = F(x,y),

where u=FX(x)u = F_X(x) and v=FY(y)v = F_Y(y). The function first transforms the probabilities uu and vv into the corresponding quantiles xx and yy using qxboltzrosen() and qyboltzrosen(), respectively. Then it evaluates the joint cumulative distribution function F(x,y)F(x,y) using pboltzrosen().

The parameters beta, a, and b are passed to all internal functions.

The input probabilities must lie in the interval [0,1][0,1]. If any value is outside this range, the function stops with an error. The returned values are forced to lie in [0,1][0,1] using pmin() and pmax() to correct any numerical rounding errors.

The parameter beta is defined as β=kT/2\beta = kT/2, where kk is the Boltzmann constant and TT is the absolute temperature.

Value

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.

Note

This function depends on qxboltzrosen, qyboltzrosen, and pboltzrosen. The parameters beta and b must be positive. The input probabilities must be in [0,1][0,1]; otherwise, an error is raised.

Author(s)

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.

References

Nelsen, R.B. (2006). An Introduction to Copulas. Springer. doi:10.1007/0-387-28678-0

Examples

# 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))

Boltzmann-Rosenbrock Marginal Distribution Function of X

Description

Computes the marginal cumulative distribution function of the X component of the Boltzmann-Rosenbrock distribution.

Usage

pxboltzrosen(x, beta = 1, a = 1, b = 100)

Arguments

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 beta. The default value is 1.

a

A numeric value representing the mean of the marginal distribution of X. The default value is 1.

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 100.

Details

The marginal distribution of X in the Boltzmann-Rosenbrock distribution is normal with mean aa and variance β\beta:

X∼N(a,β).X \sim N(a, \beta).

The cumulative distribution is evaluated using pnorm(x, mean = a, sd = sqrt(beta)).

The parameter beta is defined as β=kT/2\beta = kT/2, where kk is the Boltzmann constant and TT 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.

Value

A numeric vector of probabilities corresponding to x. The length of the returned vector is equal to the length of x.

Note

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.

Author(s)

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.

References

Chan, S. (2026). Introduction to Probability for Data Science. Michigan Publishing. https://probability4datascience.com

Examples

# 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)

Boltzmann-Rosenbrock Marginal Distribution Function of Y

Description

Computes the marginal cumulative distribution function of the Y component of the Boltzmann-Rosenbrock distribution.

Usage

pyboltzrosen(y, beta = 1, a = 1, b = 100)

Arguments

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 beta, while the conditional variance of Y given X is beta/b. The default value is 1.

a

A numeric value representing the mean of the marginal distribution of X. The default value is 1.

b

A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean x^2 and variance beta/b. The default value is 100.

Details

The marginal cumulative distribution function of Y is defined as

FY(y)=P[Y≤y]=∫−∞∞∫−∞yf(x,t) dt dx.F_Y(y) = P[Y \le y] = \int_{-\infty}^{\infty} \int_{-\infty}^{y} f(x,t) \, dt \, dx.

Using the joint cumulative distribution function F(x,y)F(x,y), the marginal CDF of Y can be obtained by taking the limit as x→∞x \to \infty:

FY(y)=F(∞,y).F_Y(y) = F(\infty, y).

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 β=kT/2\beta = kT/2, where kk is the Boltzmann constant and TT is the absolute temperature.

Value

A numeric vector of probabilities corresponding to y. The length of the returned vector is equal to the length of y.

Note

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.

Author(s)

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.

References

Chan, S. (2026). Introduction to Probability for Data Science. Michigan Publishing. https://probability4datascience.com

Examples

# 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))

Boltzmann-Rosenbrock Marginal Quantile Function of X

Description

Computes the quantile function (inverse cumulative distribution function) of the X component of the Boltzmann-Rosenbrock distribution.

Usage

qxboltzrosen(p, beta = 1, a = 1, b = 100)

Arguments

p

A numeric vector of probabilities in the interval [0,1][0,1].

beta

A positive numeric value controlling the variance of the marginal distribution of X. The variance of X is beta. The default value is 1.

a

A numeric value representing the mean of the marginal distribution of X. The default value is 1.

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 100.

Details

The marginal distribution of X in the Boltzmann-Rosenbrock distribution is normal with mean aa and variance β\beta:

X∼N(a,β).X \sim N(a, \beta).

The quantile function is evaluated using qnorm(p, mean = a, sd = sqrt(beta)), which returns the value xx such that P[X≤x]=pP[X \le x] = p.

The parameter beta is defined as β=kT/2\beta = kT/2, where kk is the Boltzmann constant and TT 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.

Value

A numeric vector of quantiles corresponding to p. The length of the returned vector is equal to the length of p.

Note

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.

Author(s)

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.

References

Gentle, J.E. (2009). Computational Statistics. Springer. doi:10.1007/978-0-387-98144-4

Examples

# 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

Boltzmann-Rosenbrock Marginal Quantile Function of Y

Description

Computes the quantile function (inverse cumulative distribution function) of the Y component of the Boltzmann-Rosenbrock distribution.

Usage

qyboltzrosen(p, beta = 1, a = 1, b = 100)

Arguments

p

A numeric vector of probabilities in the interval [0,1][0,1].

beta

A positive numeric value controlling the variance of the marginal and conditional distributions. The variance of X is beta, while the conditional variance of Y given X is beta/b. The default value is 1.

a

A numeric value representing the mean of the marginal distribution of X. The default value is 1.

b

A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean x^2 and variance beta/b. The default value is 100.

Details

The marginal distribution of Y in the Boltzmann-Rosenbrock distribution does not have a closed form. Its cumulative distribution function is given by

FY(y)=F(∞,y)=∫−∞∞fX(s)ΦY∣X(y∣s) ds,F_Y(y) = F(\infty, y) = \int_{-\infty}^{\infty} f_X(s) \Phi_{Y|X}(y|s) \, ds,

where fXf_X is the marginal density of X, normal with mean aa and variance β\beta, and ΦY∣X\Phi_{Y|X} is the conditional CDF of Y given X = s, normal with mean s2s^2 and variance β/b\beta/b.

Because FYF_Y has no closed form, the quantile function FY−1(p)F_Y^{-1}(p) is obtained numerically. For each probability pp, the returned value is the number yy satisfying FY(y)=pF_Y(y) = p. If a probability lies outside the range of attainable values of FYF_Y, the function returns −∞-\infty or ∞\infty accordingly.

The parameter beta is defined as β=kT/2\beta = kT/2, where kk is the Boltzmann constant and TT is the absolute temperature. This parameter is introduced to simplify the notation of the Boltzmann-Rosenbrock distribution.

Value

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.

Note

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.

Author(s)

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.

References

Gentle, J.E. (2009). Computational Statistics. Springer. doi:10.1007/978-0-387-98144-4

Examples

# 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))

Simulation from the Boltzmann-Rosenbrock Distribution

Description

Generates random samples from the Boltzmann-Rosenbrock distribution using its conditional structure.

Usage

rboltzrosen(n, beta = 1, a = 1, b = 100)

Arguments

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 beta, while the conditional variance of Y given X is beta/b. The default value is 1.

a

A numeric value representing the mean of the marginal distribution of X. The default value is 1.

b

A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean x^2 and variance beta/b. The default value is 100.

Details

The Boltzmann-Rosenbrock distribution admits a conditional representation in which the marginal distribution of X is normal with mean aa and variance β\beta,

X∼N(a,β),X \sim N(a, \beta),

and the conditional distribution of Y given X = x is normal with mean x2x^2 and variance β/b\beta/b,

Y∣X=x∼N(x2,β/b).Y|X=x \sim N(x^2, \beta/b).

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 (x,y)(x, y) are independent and identically distributed draws from the joint Boltzmann-Rosenbrock distribution.

The parameter beta is defined as β=kT/2\beta = kT/2, where kk is the Boltzmann constant and TT is the absolute temperature. This parameter is introduced to simplify the notation of the Boltzmann-Rosenbrock distribution.

Value

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.

Note

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.

Author(s)

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.

References

Gentle, J.E. (2009). Computational Statistics. Springer. doi:10.1007/978-0-387-98144-4

Examples

# 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

Simulation from the Boltzmann-Rosenbrock Copula

Description

Generates random samples from the copula associated with the Boltzmann-Rosenbrock distribution.

Usage

rcboltzrosen(n, beta = 1, a = 1, b = 100)

Arguments

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 beta, while the conditional variance of Y given X is beta/b. The default value is 1.

a

A numeric value representing the mean of the marginal distribution of X. The default value is 1.

b

A positive numeric value controlling the conditional variance of Y given X. The conditional distribution has mean x^2 and variance beta/b. The default value is 100.

Details

The copula associated with the Boltzmann-Rosenbrock distribution is obtained via Sklar's theorem from the joint distribution function F(x,y)F(x,y) and its marginal distribution functions FXF_X and FYF_Y. It is the function CC satisfying

F(x,y)=C(FX(x),FY(y))F(x, y) = C(F_X(x), F_Y(y))

for all x,yx, y in R\mathbb{R}.

This function generates samples from the copula by first drawing pairs (x,y)(x, y) from the joint Boltzmann-Rosenbrock distribution and then applying the probability integral transform to each component, i.e., computing u=FX(x)u = F_X(x) and v=FY(y)v = F_Y(y). The resulting pairs (u,v)(u, v) are uniformly distributed on [0,1]2[0,1]^2 and their joint distribution function is the copula CC.

The parameter beta is defined as β=kT/2\beta = kT/2, where kk is the Boltzmann constant and TT is the absolute temperature. This parameter is introduced to simplify the notation of the Boltzmann-Rosenbrock distribution.

Value

A numeric matrix with n rows and two columns. The first column contains the sampled values of u=FX(x)u = F_X(x) and the second column contains the sampled values of v=FY(y)v = F_Y(y). Both columns lie in the interval [0,1][0,1].

Note

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 vv requires numerical evaluation of FYF_Y, and therefore this function may be slow when n is large.

Author(s)

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.

References

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

See Also

rboltzrosen, pcboltzrosen

Examples

# 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)