hypcube_smc: Simple Monte Carlo Sampling

View source: R/RcppExports.R

hypcube_smcR Documentation

Simple Monte Carlo Sampling

Description

This function generates a Simple Monte Carlo (SMC) random design matrix over the hypercube.

Usage

hypcube_smc(n, d, lbound = NA_real_, ubound = NA_real_)

Arguments

n

Integer. The number of samples points of the hypercube.

d

Integer. The the dimension of the hypercube.

lbound

Numeric vector of length d specifying the lower bounds for each dimension of the d-dimensional hypercube.

ubound

Numeric vector of length d specifying the ubound bounds for each dimension of the d-dimensional hypercube.

Value

A n x d matrix containing the SMC design. Each element is scaled to the range defined by lbound and ubound.

Examples

x = hypcube_smc(100, 2)
plot(x, xlim = c(0,1), ylim = c(0,1))
rug(x[,1]); rug(x[,2], side = 2)
x = hypcube_smc(100, 2, lbound = c(-5,1), ubound = c(10,3))
plot(x, xlim = c(-5,10), ylim = c(1,3))
rug(x[,1]); rug(x[,2], side = 2)


mclustAddons documentation built on Dec. 3, 2025, 5:08 p.m.