Distributions

Abstract Types

Distribution Structures

RLinearAlgebra.UniformType
Uniform <: Distribution

Uniform distribution over the row/column index set of a matrix.

Mathematical Description

During the sampling, the uniform distribution is defined on the domain of row/column indices. If it's compressing from the left, then it means every row index has the same probability weight. If it's compressing from the right, then it means every column index has the same probability weight.

Fields

  • cardinality::Cardinality, the direction the compression matrix is intended to be applied to a target matrix or operator. Values allowed are Left() or Right() or Undef().
  • replace::Bool, if true, then the sampling occurs with replacement; if false, then the sampling occurs without replacement.

Constructor

Uniform(;cardinality=Undef(), replace = false)

Returns

  • A Uniform object.
source
RLinearAlgebra.UniformRecipeType
UniformRecipe <: DistributionRecipe

The recipe containing all allocations and information for the uniform distribution.

Fields

  • cardinality::C where C<:Cardinality, the cardinality of the compressor. The value is either Left() or Right() or Undef().
  • replace::Bool, an option to replace or not during the sampling process based on the given weights.
  • state_space::Vector{Int64}, the row/column index set.
  • weights::ProbabilityWeights, the weights of each element in the state space.
source

Exported Functions

RLinearAlgebra.complete_distributionFunction
complete_distribution(distribution::Distribution, A::AbstractMatrix)

A function that generates a DistributionRecipe given the arguments.

Arguments

  • distribution::Distribution, a user-specified distribution function for sampling.
  • A::AbstractMatrix, a coefficient matrix.

Outputs

  • A DistributionRecipe object.
source
RLinearAlgebra.update_distribution!Function
update_distribution!(distribution::DistributionRecipe, A::AbstractMatrix)

A function that updates the DistributionRecipe in place given arguments.

Arguments

  • distribution::DistributionRecipe, a fully initialized realization of distribution.
  • A::AbstractMatrix, a coefficient matrix.

Outputs

  • Modifies the DistributionRecipe in place and returns nothing.
source
RLinearAlgebra.sample_distribution!Function
sample_distribution!(x::AbstractVector, distribution::DistributionRecipe)

A function that in place updates the x by given DistributionRecipe info.

Arguments

  • x::AbstractVector, an abstract vector to store the sampled indices.
  • distribution::DistributionRecipe, a fully initialized realization of distribution.

Outputs

  • Modifies the x in place by sampling that follows the weights and replacement given by

'DistributionRecipe'.

source

Internal Functions