TransportMaps Q&A - Recent questions and answers in theory
https://transportmaps.mit.edu/qa/index.php?qa=qa&qa_1=theory
Powered by Question2AnswerAnswered: applying optimal tranport map to filtering theory
https://transportmaps.mit.edu/qa/index.php?qa=251&qa_1=applying-optimal-tranport-map-to-filtering-theory&show=256#a256
<p>Hello Peng,</p><p>There are mainly two lines of work regarding filtering/smoothing/parameter estimation (or more in general data assimilation):</p><ul><li>The first one is along the lines of <strong>variational</strong> filters/smoothers and is presented in <a rel="nofollow" href="http://jmlr.org/papers/v19/17-747.html">"Inference via low-dimensional couplings"</a>. It is already implemented in TransportMaps 2.0, in the version described in the paper.</li><li>The second one is along the lines of <strong>ensemble</strong> filters/smoothers and is presented in <a rel="nofollow" href="https://arxiv.org/abs/1907.00389">"Coupling techniques for nonlinear ensemble filtering"</a> . The lead in this case is Ricardo Baptista, and you should contact him for more details. These versions of filters are not included in the code yet (I know Ricardo has some software for it). It might be included in future releases of TransportMaps.</li></ul><div>On both fornts there are many open questions and new challenges which we could discuss off-line.</div><div> </div><div>Best,</div><div> Daniele</div>theoryhttps://transportmaps.mit.edu/qa/index.php?qa=251&qa_1=applying-optimal-tranport-map-to-filtering-theory&show=256#a256Fri, 16 Aug 2019 15:32:26 +0000Answered: constructing transport map from given samples and use it to get/samples from standard normal
https://transportmaps.mit.edu/qa/index.php?qa=205&qa_1=constructing-transport-given-samples-samples-standard-normal&show=232#a232
<p>Hi Saad, your question got cut out for some reasons, but I imagine you are referring to the rescaling done by the map \(L\), which (practically) takes the original sample and scales it to get a mean 0 and variance 0 sample. This is done because the map \(S\) is going to use polynomials orthogonal with respect ot \(N(0,1)\), which implies that they are mostly "accurate" on the bulk of \(N(0,1)\).</p><p>This question is similar to the issue described <a rel="nofollow" href="https://transportmaps.mit.edu/qa/index.php?qa=5&qa_1=cant-build-standard-normal-distribution-gumbel-distribution">here</a></p><p>I hope this helps,</p><p> Daniele</p>theoryhttps://transportmaps.mit.edu/qa/index.php?qa=205&qa_1=constructing-transport-given-samples-samples-standard-normal&show=232#a232Tue, 23 Jul 2019 15:43:39 +0000Answered: Composition of maps and order adaptativity
https://transportmaps.mit.edu/qa/index.php?qa=36&qa_1=composition-of-maps-and-order-adaptativity&show=37#a37
<p>Hi Paul,</p><p>I don't have personal experience with the approach described in [TM1] "Bayesian inference with optimal maps", but here are my insights with regard to map composition and tempering. In the following I assume that you have whitened the posterior, so that the prior distribution is a Standard Normal and tempering is applied to the whitened likelihood (either by noise covariance progression, data injection or forward accuracy).</p><ul><li>I would say that the progression of the noise covariance should be slow enough so that at each step the map is able to capture most of the relation between reference (Standard Normal) and the tempered posterior. You should measure this using the variance diagnostic.</li><li>Regarding computational cost: if the maps are simple enough (at least order two or three for accuracy) then the approach can result in something more efficient than directly computing a transport map of high-order. You can think to the final map as many layer of a neural network with each layer corresponding to a map in the composition. This can help explain the expressivity of the representation. On the upside, of using compositions of monotone triangular maps is that the transformation is invertible (a property sometimes needed).</li><li>The composition of maps should take the prior/reference \(\nu_\rho\) to posterior \(\nu_\pi\) progressively, but it should not result in the "optimal composition" due to the inherent sequential construction. One could correct the maps in a final sweep over the maps to improve them, e.g. solving the \(n\) problems:<br>\[ T_i = \arg\min_{T\in \mathcal{T}_>} \mathcal{D}_{\text{KL}}\left( (T_1\circ T_{i-1})_\sharp \nu_\rho \middle\Vert T^\sharp (T_{i+1}\circ T_n)^\sharp \nu_\pi \right) \]<br>warm started at the \(T_i\) already learned through the tempering procedure.</li></ul><div>Can you clarify what you mean with "first map to get low-rank coupling"? Do you mean to find the rotation such that the next maps become the identity almost everywhere (like Likelihood Informed sub-spaces or Active sub-spaces)?</div><div> </div><div>Also what do you mean with "unscaled"? Usually the scaling problem can arise when one tries to find <a target="_blank" rel="nofollow" href="https://transportmaps.mit.edu/docs/examples-transport-from-samples.html">maps from samples</a> not when constructing <a target="_blank" rel="nofollow" href="https://transportmaps.mit.edu/docs/examples-direct-transport.html">maps from densities </a>. So using a linear map at the beginning is not strictly necessary, but it shouldn't hurt either.</div><div> </div><div>I hope to have addressed some of your questions.</div><div>I will try to gather more insights from my collegues in the coming days.</div><div> </div><div>Best,</div><div> Daniele</div>theoryhttps://transportmaps.mit.edu/qa/index.php?qa=36&qa_1=composition-of-maps-and-order-adaptativity&show=37#a37Fri, 22 Jun 2018 10:02:17 +0000Answered: Why I can't build TM from non standard normal distribution to Gumbel distribution ?
https://transportmaps.mit.edu/qa/index.php?qa=5&qa_1=cant-build-standard-normal-distribution-gumbel-distribution&show=7#a7
<p>Hi Paul, Youssef's comment is spot on. Here is the code implementing his suggestion:</p><pre><code class="language-python">import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import TransportMaps as TM
import TransportMaps.Functionals as FUNC
import TransportMaps.Maps as MAPS
import TransportMaps.Distributions as DIST
class GumbelDistribution(DIST.Distribution):
def __init__(self, mu, beta):
super(GumbelDistribution,self).__init__(1)
self.mu = mu
self.beta = beta
self.dist = stats.gumbel_r(loc=mu, scale=beta)
def pdf(self, x, params=None):
return self.dist.pdf(x).flatten()
def log_pdf(self, x, params=None):
return self.dist.logpdf(x).flatten()
def grad_x_log_pdf(self, x, params=None):
m = self.mu
b = self.beta
z = (x-m)/b
return (np.exp(-z)-1.)/b
def hess_x_log_pdf(self, x, params=None):
m = self.mu
b = self.beta
z = (x-m)/b
return (-np.exp(-z)/b**2.)[:,:,np.newaxis]
mu = -63.
beta = 3.
pi = GumbelDistribution(mu,beta)
M=np.array([[-50],[-70],[-60]])
xnew=np.linspace(-70,-50,201)[:,np.newaxis]
mu = np.array([-60])
sigma = np.array([[8]])
rho=DIST.StandardNormalDistribution(1)
# Linear map
L = MAPS.LinearTransportMap(mu, sigma)
# New target (pullback of pi through L)
pull_L_pi = DIST.PullBackTransportMapDistribution(L, pi)
x = np.linspace(-70., -50., 100).reshape((100,1))
order=7
T = TM.Default_IsotropicIntegratedSquaredTriangularTransportMap(
1, order, 'full')
push_rho=DIST.PushForwardTransportMapDistribution(T,rho)
qtype = 3 # Gauss quadrature
qparams =[20] # Quadrature order
reg = None # No regularization
tol = 1e-6 # Optimization tolerance
ders = 2 # Use gradient and Hessian
# Solve D_KL(T_\sharp \rho || L^\sharp \pi)
log = push_rho.minimize_kl_divergence(
pull_L_pi, qtype=qtype, qparams=qparams, regularization=reg,
tol=tol, ders=ders)
# Obtain \pi \approx L_\sharp T_\sharp \rho
push_LT_rho = DIST.PushForwardTransportMapDistribution(L, push_rho)
plt.figure()
plt.plot(x, push_LT_rho.pdf(x),'b',label=r'pushrho');
plt.plot(x, pi.pdf(x),'g',label=r'π');
plt.legend();
</code></pre><p>To know more on composition of maps, you can see <a target="_blank" rel="nofollow" href="http://transportmaps.mit.edu/docs/example-beta-1d.html">this</a> page of the tutorial.</p><p>Best,</p><p> Daniele</p>theoryhttps://transportmaps.mit.edu/qa/index.php?qa=5&qa_1=cant-build-standard-normal-distribution-gumbel-distribution&show=7#a7Fri, 03 Nov 2017 15:26:16 +0000