From 4771d1cca1a389fdb7b37f81f796b1ada12e3f71 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Tue, 2 Jul 2024 09:59:19 +0000 Subject: [PATCH] build based on b9d1d5d --- previews/PR84/.documenter-siteinfo.json | 2 +- previews/PR84/atoms/index.html | 2 +- previews/PR84/index.html | 2 +- previews/PR84/moments/index.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/previews/PR84/.documenter-siteinfo.json b/previews/PR84/.documenter-siteinfo.json index 53a7251..f059146 100644 --- a/previews/PR84/.documenter-siteinfo.json +++ b/previews/PR84/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-02T09:58:49","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-02T09:59:15","documenter_version":"1.5.0"}} \ No newline at end of file diff --git a/previews/PR84/atoms/index.html b/previews/PR84/atoms/index.html index b6e4799..7412f06 100644 --- a/previews/PR84/atoms/index.html +++ b/previews/PR84/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/previews/PR84/index.html b/previews/PR84/index.html index ffed0e7..1003fdd 100644 --- a/previews/PR84/index.html +++ b/previews/PR84/index.html @@ -1,2 +1,2 @@ -Index · MultivariateMoments
+Index · MultivariateMoments
diff --git a/previews/PR84/moments/index.html b/previews/PR84/moments/index.html index 0efcd44..bd2513b 100644 --- a/previews/PR84/moments/index.html +++ b/previews/PR84/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