TransportMaps Q&A - Recent questions in theory
https://transportmaps.mit.edu/qa/index.php?qa=questions&qa_1=theory
Powered by Question2Answerapplying optimal tranport map to filtering theory
https://transportmaps.mit.edu/qa/index.php?qa=251&qa_1=applying-optimal-tranport-map-to-filtering-theory
Hi there,<br />
<br />
I have seen your team has done a lot of work about developing parametric approximations of the Knothe-Rosenblatt rearrangement (Moselhy and Marzouk, 2012) to design a good map. I just want to know how many ways until now we can select to applying this Bayesian inference technology to non-linear filter .<br />
<br />
Pengchengtheoryhttps://transportmaps.mit.edu/qa/index.php?qa=251&qa_1=applying-optimal-tranport-map-to-filtering-theoryFri, 16 Aug 2019 15:21:44 +0000constructing 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
<p>Hello</p><p>I want to construct a map from given samples ( from unknown distrubution) that has standard normal distribution as target distribution so that I can get standard normal samples when samples from unknown distribution are plugged into the map.</p><p>I followed the tutorial example: Inverse transport from samples, where samples from Gumbel distribution are used to construct the map:Gumbel to Standard normal. However in the code, I could not understand in the following block ( where map is constructed):</p><p>####################################################</p><pre>S = TM.Default_IsotropicIntegratedSquaredTriangularTransportMap(
1, 3, 'total')
rho = DIST.StandardNormalDistribution(1)
push_L_pi = DIST.PushForwardTransportMapDistribution(L, pi)
push_SL_pi = DIST.PushForwardTransportMapDistribution(
S, push_L_pi)
qtype = 0 # Monte-Carlo quadratures from pi
qparams = 500 # Number of MC points
reg = None # No regularization
tol = 1e-3 # Optimization tolerance
ders = 2 # Use gradient and Hessian
log = push_SL_pi.minimize_kl_divergence(
rho, qtype=qtype, qparams=qparams, regularization=reg,
tol=tol, ders=ders)
#########################################################
specifically the line
"push_L_pi = DIST.PushForwardTransportMapDistribution(L, pi)".
Here we are explicitly specifying the "Gumbel distribution" ,defined by pi, instead of the samples, arent we supposed to not know the distribution in the first place ( instead we only have samples, like the situation that I have i.e. only samples without having any knowledge about its distribution)
Could you kindly clear my misunderstanding,if possible with an example code. I would be very grateful
thanks
saad
</pre>theoryhttps://transportmaps.mit.edu/qa/index.php?qa=205&qa_1=constructing-transport-given-samples-samples-standard-normalTue, 23 Jul 2019 14:55:49 +0000Composition of maps and order adaptativity
https://transportmaps.mit.edu/qa/index.php?qa=36&qa_1=composition-of-maps-and-order-adaptativity
Hi,<br />
<br />
I am using the TransportMaps library to solve sequential inference problems. One problem I'm facing is the adaptivity of map orders. I currently build the tranport maps by iteration on the maps order and monitoring of the variance diagnostic. However, I'm very interested in the composition of low-order maps described in ref [TM1] "Bayesian inference with optimal maps".<br />
<br />
Hence, I have some questions about it:<br />
<br />
- How to set the progression of the noise covariance to build intermediate maps ?<br />
- How to be sure that the first map is close to a normal distribution in order to have a low rank coupling ?<br />
- If the map is unscaled due to a too large variance, should I also add a linear map ?<br />
- Is this approach always efficient in terms of computation time in comparison to a direct map with high order degree (with non decomposable density) ?<br />
<br />
Best regards,<br />
<br />
Paul.theoryhttps://transportmaps.mit.edu/qa/index.php?qa=36&qa_1=composition-of-maps-and-order-adaptativityWed, 20 Jun 2018 13:54:22 +0000Why 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
<p><span style="color:#000000; font-family:helvetica; font-size:12px">Hi,</span></p><p><span style="color:#000000; font-family:helvetica; font-size:12px">Thank you for your software and all the support provided.</span></p><p>I am trying to use your TransportMaps library to solve some of my examples but I encounter some difficulties. I went back to a simple example which is not working.</p><p>I am trying to build a map between a gaussian distribution and a gumbel distribution (mu=-63, beta=3) (which is close to a posterior distribution I want to sample). When I use a standard normal gaussian distribution (rho) as reference distribution it’s working well. But when I use another gaussian distribution (mean=-60, stdd=8) (rho2) I can’t reach a good approximation building the map whatever the order of the map I use (see file attached). For me it will be easier to build the map between closer distributions. I can’t understand what I am doing wrong. </p><p>I would very appreciate if you can find some time to answer me.</p><p>Best regards,</p><p>Paul.</p><p>Here the python script I use:</p><pre><code class="language-python">import logging
import warnings
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import SpectralToolbox.Spectral1D as S1D
import TransportMaps as TM
import TransportMaps.Functionals as FUNC
import TransportMaps.Maps as MAPS
import scipy.io
import scipy.linalg as scila
import SpectralToolbox.SpectralND as SND
warnings.simplefilter("ignore")
TM.setLogLevel(logging.INFO)
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)
rho2=DIST.GaussianDistribution(mu,sigma)
x = np.linspace(-70., -50., 100).reshape((100,1))
order=7
T = TM.Default_IsotropicIntegratedSquaredTriangularTransportMap(
1, order, 'full')
T2 = TM.Default_IsotropicIntegratedSquaredTriangularTransportMap(
1, order, 'full')
push_rho=DIST.PushForwardTransportMapDistribution(T,rho)
push_rho2=DIST.PushForwardTransportMapDistribution(T2,rho2)
qtype = 3 # Gauss quadrature
qparams =[20] # Quadrature order
reg = None # No regularization
tol = 1e-10 # Optimization tolerance
ders = 2 # Use gradient and Hessian
log = push_rho.minimize_kl_divergence(
pi, qtype=qtype, qparams=qparams, regularization=reg,
tol=tol, ders=ders)
log = push_rho2.minimize_kl_divergence(
pi, qtype=qtype, qparams=qparams, regularization=reg,
tol=tol, ders=ders)
plt.figure()
plt.plot(x, push_rho.pdf(x),'b',label=r'$push rho$');
plt.plot(x, push_rho2.pdf(x),'r',label=r'$push rho2$');
plt.plot(x, pi.pdf(x),'g',label=r'$\pi$');
plt.legend();</code></pre><p> </p>theoryhttps://transportmaps.mit.edu/qa/index.php?qa=5&qa_1=cant-build-standard-normal-distribution-gumbel-distributionTue, 31 Oct 2017 16:30:12 +0000