Last updated: 2023-03-16.
tf_quant_finance.math.qmc.sobol_generating_matrices#
Returns Sobol generating matrices.
tf_quant_finance.math.qmc.sobol_generating_matrices(
dim, num_results, num_digits, validate_args=False, dtype=None, name=None
)
Examples#
import tf_quant_finance as tff
# Example: Creating the 4D Sobol generating matrices.
dim = 4
num_results = 500
num_digits = 9
tff.math.qmc.sobol_generating_matrices(dim, num_results, num_digits)
# ==> tf.Tensor([
# [256, 128, 64, 32, 16, 8, 4, 2, 1],
# [256, 384, 320, 480, 272, 408, 340, 510, 257],
# [256, 384, 192, 288, 464, 184, 284, 394, 209],
# [256, 384, 64, 160, 496, 232, 324, 294, 433],
# ], shape=(4, 9), dtype=int32)
Args:#
dim: Positive scalarTensorof integers with rank 0. The event size of points which can be sampled from the resulting generating matrices.num_results: Positive scalarTensorof integers with rank 0. The maximum number of points which can be sampled from the resulting generating matrices.num_digits: Positive scalarTensorof integers with rank 0. The base-2 precision of points which can be sampled from the resulting generating matrices.validate_args: Pythonboolindicating whether to validate arguments. Default value:False.dtype: Optionaldtype. Thedtypeof the outputTensor(either a signed or unsigned integerdtype). Default value:Nonewhich maps toint32.name: Pythonstrname prefixed to ops created by this function. Default value:Nonewhich maps tosobol_generating_matrices.
Returns:#
A scalar Tensor with shape (dim, log_num_results) where
log_num_results = ceil(log2(num_results)).