From 78f1ddc4936f3c9024b724a766bc6a8398dccc6f Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Tue, 18 Jun 2024 07:33:41 +0000 Subject: [PATCH] build based on 745c911 --- dev/.documenter-siteinfo.json | 2 +- dev/atoms/index.html | 2 +- dev/index.html | 2 +- dev/moments/index.html | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index df07a67..8e326db 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-06-17T14:50:29","documenter_version":"1.4.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-06-18T07:33:36","documenter_version":"1.4.1"}} \ No newline at end of file diff --git a/dev/atoms/index.html b/dev/atoms/index.html index b0473b5..8a63fd4 100644 --- a/dev/atoms/index.html +++ b/dev/atoms/index.html @@ -135,4 +135,4 @@ end

Given a moment matrix ν and the atom centers, determine the weights by solving a linear system over all the moments of the moment matrix, keeping duplicates (e.g., entries corresponding to the same monomial).

If the moment values corresponding to the same monomials are known to be equal prefer MomentVectorWeightSolver instead.

source
MultivariateMoments.MomentVectorWeightSolverType
struct MomentVectorWeightSolver{T}
     rtol::T
     atol::T
-end

Given a moment matrix ν and the atom centers, first convert the moment matrix to a vector of moments, using moment_vector(ν; rtol=rtol, atol=atol) and then determine the weights by solving a linear system over the monomials obtained.

If the moment values corresponding to the same monomials can have small differences, moment_vector can throw an error if rtol and atol are not small enough. Alternatively to tuning these tolerances MomentVectorWeightSolver can be used instead.

source
+end

Given a moment matrix ν and the atom centers, first convert the moment matrix to a vector of moments, using moment_vector(ν; rtol=rtol, atol=atol) and then determine the weights by solving a linear system over the monomials obtained.

If the moment values corresponding to the same monomials can have small differences, moment_vector can throw an error if rtol and atol are not small enough. Alternatively to tuning these tolerances MomentVectorWeightSolver can be used instead.

source diff --git a/dev/index.html b/dev/index.html index ee74908..4ab6a42 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Index · MultivariateMoments
+Index · MultivariateMoments
diff --git a/dev/moments/index.html b/dev/moments/index.html index ba5fad4..0763740 100644 --- a/dev/moments/index.html +++ b/dev/moments/index.html @@ -1,4 +1,4 @@ Moments and expectation · MultivariateMoments

Moments and expectation

Moment

Given a measure $\mu$ and a monomial $m$, the moment $m$ of the measure is defined by the expectation $\mathbb{E}_\mu[m]$. Given a monomial and a value for the moment, a moment can be created using the moment function

The moment function returns an AbstractMoment which is a subtype of AbstractMomentLike. An AbstractMomentLike is a type that can act like an AbstractMoment (it is similar to MultivariatePolynomials' AbstractMonomialLike, AbstractTermLike and AbstractPolynomialLike), that is, it implements the following two functions

Measure

Given a monomials and a values for the moments, a "moment vector" can be created using the moment_vector function

MultivariateMoments.moment_vectorFunction
moment_vector(values::AbstractVector{T}, monos::AbstractVector{<:AbstractMonomial}; rtol=Base.rtoldefault(T), atol=zero(T))

Creates a measure with moments moment(values[i], monos[i]) for each i. An error is thrown if there exists i and j such that monos[i] == monos[j] but !isapprox(values[i], values[j]; rtol=rtol, atol=atol).

source

The moment_vector function returns an AbstractMeasure which is a subtype of AbstractMeasureLike. Note that it does not actually compute the probability density function of a measure having these moments, it simply stores a vector of moments belonging to a hypothetical measure. However, it acts like a measure when taking its scalar product with a polynomial.

An AbstractMeasureLike is a type that can act like an AbstractMeasure, that is, it implements the following two functions

MultivariatePolynomials.variablesMethod
variables(μ::MomentVector)

Returns the variables of μ in decreasing order. Just like in MultivariatePolynomials, it could contain variables of zero degree in every monomial.

source

The moments of the dirac measure for a vector of monomials can be obtained by the dirac function

MultivariateMoments.diracFunction
dirac(X::AbstractVector{<:AbstractMoment}, s::AbstractSubstitution...)

Creates the dirac measure by evaluating the moments of X using s.

Examples

Calling dirac([x*y, x*y^2], x=>3, y=>2) should the measure with moment x*y of value 6 and moment x*y^2 of value 12.

source

Expectation

The expectation of polynomial with respect to a measure can be computed either using MultivariateMoments.expectation or using the Base.dot scalar product.

MultivariateMoments.expectationFunction
MultivariateMoments.expectation(μ::AbstractMeasureLike, p::AbstractPolynomialLike)
-MultivariateMoments.expectation(p::AbstractPolynomialLike, μ::AbstractMeasureLike)

Computes the expectation $\mathbb{E}_{\mu}[p]$.

source
+MultivariateMoments.expectation(p::AbstractPolynomialLike, μ::AbstractMeasureLike)

Computes the expectation $\mathbb{E}_{\mu}[p]$.

source
LinearAlgebra.dotFunction
dot(μ::AbstractMeasureLike, p::AbstractPolynomialLike)
+dot(p::AbstractPolynomialLike, μ::AbstractMeasureLike)

See expectation

source