Multi Index Sets

Sparse grids are constructed via multi-index sets. These define a linear combination of tensor product grids, which are popular choices for approximation tasks in moderately high dimensional problems.

In the following, we consider a function $u$ with domain $\Gamma\in\mathbb{R}^n$.

Tensor Product Multi-Index Sets

A tensor product multi-index set

\[\{\alpha : \Vert \alpha \Vert_\infty \leq n + d\} \subset \N^{d}\]

is constructed using the create_tensor_miset function.

using SparseGridsKit, Plots, LaTeXStrings

n, k = 2, 1
mi_set = create_tensor_miset(n, k)
MISet([[1, 1], [1, 2], [2, 1], [2, 2]])

The multi-index set can be viewed a vector of Vector{Integer} representing each multi-index:

get_mi(mi_set)
4-element Vector{Vector{Int64}}:
 [1, 1]
 [1, 2]
 [2, 1]
 [2, 2]
x = getindex.(get_mi(mi_set), 1)
y = getindex.(get_mi(mi_set), 2)
scatter(x,y, xlabel=L"\beta_1", ylabel=L"\beta_2",
            legend=:none,
            title="Multi-Index Set", aspect_ratio=:equal)
Example block output

The exponential growth in complexity with domain dimension $n$ is problematic as soon as $n$ becomes moderately large.

Smolyak Multi-Index Sets

To alleviate some of the problems of high-dimensional approximation, Smolyak type constructions are often used. The standard Smolyak multi-index sets are can be easily constructed. The multi-index set

\[\{\alpha : \Vert \alpha \Vert_1 \leq n + d\} \subset \N^{2}\]

is constructed using the following syntax.

using SparseGridsKit
n, k = 2, 1
mi_set = create_smolyak_miset(n, k)
MISet([[1, 1], [1, 2], [2, 1]])

This gives a different, smaller multi-index set than the tensor product multi-index set.

get_mi(mi_set)
3-element Vector{Vector{Int64}}:
 [1, 1]
 [1, 2]
 [2, 1]
x = getindex.(get_mi(mi_set), 1)
y = getindex.(get_mi(mi_set), 2)
scatter(x,y, xlabel=L"\beta_1", ylabel=L"\beta_2",
            legend=:none,
            title="Smolyak Multi-Index Set", aspect_ratio=:equal)
Example block output

Manipulating Multi-Index Sets

The multi-index set can be altered by adding additional multi-indices. Continuing using the above Smolyak example, we add the multi-index $[1, 3]$ with the add_mi function.

mi_set_new = MISet([[1,3]])
combined_mi_set = add_mi(mi_set, mi_set_new)

x = getindex.(get_mi(combined_mi_set), 1)
y = getindex.(get_mi(combined_mi_set), 2)
scatter(x,y, xlabel=L"\beta_1", ylabel=L"\beta_2",
            legend=:none,
            title="Multi-Index Addition", aspect_ratio=:equal)
Example block output

In Gerstner–Griebel style adaptive algorithms, the margin and reduced margin are generally required. These are easily computed using the get_margin and get_reduced_margin functions.

margin_set = get_margin(combined_mi_set)

x = getindex.(get_mi(margin_set), 1)
y = getindex.(get_mi(margin_set), 2)
scatter(x,y, xlabel=L"\beta_1", ylabel=L"\beta_2",
            legend=:none,
            title="Margin Multi-Index", aspect_ratio=:equal)
Example block output
reduced_margin_set = get_reduced_margin(combined_mi_set)

x = getindex.(get_mi(reduced_margin_set), 1)
y = getindex.(get_mi(reduced_margin_set), 2)
scatter(x,y, xlabel=L"\beta_1", ylabel=L"\beta_2",
            legend=:none,
            title="Reduced Margin Multi-Index", aspect_ratio=:equal)
Example block output

Notice how the multi-index $[2,3]$ is in the margin but not the reduced margin. Its backwards neighbour $[2,2]$ is missing from combined_mi_set.

Function Reference

SparseGridsKit.add_miMethod
add_mi(mi_set, mi_set_new)

Adds a new set of multi-indices (mi_set_new) to an existing multi-index set (mi_set).

Arguments

  • mi_set: The original multi-index set.
  • mi_set_new: A new MISet to be added to the original.

Returns

  • A new MISet containing the combined and sorted multi-indices.
source
SparseGridsKit.add_miMethod
add_mi(mi_set, mi_new)

Adds a single new multi-index (mi_new) to an existing multi-index set (mi_set).

Arguments

  • mi_set: The original multi-index set.
  • mi_new: A new multi-index vector to be added.

Returns

  • A new MISet containing the updated and sorted multi-indices.
source
SparseGridsKit.check_admissibilityMethod
check_admissibility(miset)

Checks the admissibility of a multi-index set miset.

Arguments

  • miset: An instance of MISet.

Returns

  • admissibile: True or false
  • mi_missing: Missing multi-indices
source
SparseGridsKit.check_index_admissibilityMethod
check_index_admissibility(miset, mi)

Checks the admissibility of a single multi-index mi in a multi-index set miset.

Arguments

  • miset: Multi-index set.
  • mi: Multi-index to check or vector of multi-indices to check.

Returns

  • admissibile: True or false
  • mi_missing: Missing multi-indices
source
SparseGridsKit.create_box_misetMethod
create_box_miset(n, k)

Creates a rectangular multi-index set for a given dimension (n) and levels vector (k).

Arguments

  • n: The dimensionality of the space.
  • k: A vector of levels for each dimension.
source
SparseGridsKit.create_rule_misetMethod
create_rule_miset(n, k, rule)

Creates a multi-index set for a given dimension (n) and with rule(mi) less than or equal to k.

Arguments

  • n: The dimensionality of the space.
  • k: Maximum for rule(mi)
  • rule: Rule to compute on each MI
source
SparseGridsKit.create_smolyak_misetMethod
create_smolyak_miset(n, k)

Creates a Smolyak multi-index set for a given dimension (n) and level (k).

Arguments

  • n: The dimensionality of the space.
  • k: The level of the Smolyak grid.

Returns

  • An MISet representing the Smolyak multi-index set.
source
SparseGridsKit.create_tensor_misetMethod
create_tensor_miset(n, k)

Creates a tensor product multi-index set for a given dimension (n) and level (k).

Arguments

  • n: The dimensionality of the space.
  • k: The level of the tensor product grid.

Returns

  • An MISet representing the tensor product multi-index set.
source
SparseGridsKit.create_totaldegree_misetMethod
create_totaldegree_miset(n, k)

Creates a multi-index set for a given dimension (n) and with total levels less than or equal to k.

Arguments

  • n: The dimensionality of the space.
  • k: Total degree
source
SparseGridsKit.get_marginMethod
get_margin(mi_set)

Calculates the margin of a multi-index set (mi_set), which is the set of multi-indices that can extend the current set.

Arguments

  • mi_set: An instance of MISet.

Returns

  • An MISet containing the margin set.
source
SparseGridsKit.get_miMethod
get_mi(mi_set)

Retrieves the list of multi-indices from a given MISet.

Arguments

  • mi_set: An instance of MISet.

Returns

  • A vector of multi-index vectors.
source
SparseGridsKit.get_n_miMethod
get_n_mi(mi_set)

Returns the number of multi-indices in a given MISet.

Arguments

  • mi_set: An instance of MISet.

Returns

  • The number of multi-indices in the set.
source
SparseGridsKit.get_reduced_marginMethod
get_reduced_margin(mi_set)

Calculates the reduced margin of a multi-index set (mi_set), which removes indices already in the set.

Arguments

  • mi_set: An instance of MISet.

Returns

  • An MISet containing the reduced margin set.
source