From 8837cf9ec46cb0920539da735ce7ae4f91bfd497 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Fri, 2 Aug 2024 10:38:26 +0000 Subject: [PATCH] build based on e2e8a96 --- dev/.documenter-siteinfo.json | 2 +- dev/atoms/index.html | 2 +- dev/index.html | 2 +- dev/moments/index.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index a807042..fe9aa39 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-02T13:30:24","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-08-02T10:38:22","documenter_version":"1.5.0"}} \ No newline at end of file diff --git a/dev/atoms/index.html b/dev/atoms/index.html index 01ef368..1206104 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 2e05c0d..6caadf0 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 599ab12..949227f 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
+dot(p::AbstractPolynomialLike, μ::AbstractMeasureLike)

See expectation

source