I am using the TransportMaps (TM) for density estimation: I have 1M data points with 2 features and use TM to compute the map S which takes my distribution to the standard normal distribution. Computing S takes some reasonable time as shown in the log below. Now I need to compute the inverse map S^{-1} for large data sets (~10M) as well, but when I use the method S.inverse() to map those values back to my original space it takes way longer, in fact, about 100 times longer. I have also tried creating another object "T=TransportMaps.Maps.TransportMapBase.InverseTransportMap(S)" and use T, but it takes similarly long. Below I share a log for computing S using 1M and then trying to compute the inverse map for some 1M points.

My question is wether I am missing something e.g. there is a way in TM to compute inverse maps much faster? If not I am thinking of using e.g. K-neighbor regression for the inverse map, any tips or thoughts on that?

bests,

Hassan

runing log (OS: Fedora release 28, 32 cores and 128G memory - didn't use MPI tho):

```
Polynomial order: 4
Number of coefficients: 20
==========================
2019-03-04 20:41:38 INFO: TM.MonotonicIntegratedSquaredApproximation: Optimization terminated successfully
2019-03-04 20:41:38 INFO: TM.MonotonicIntegratedSquaredApproximation: Function value: 1.412383
2019-03-04 20:41:38 INFO: TM.MonotonicIntegratedSquaredApproximation: Norm of the Jacobian: 0.000000
2019-03-04 20:41:38 INFO: TM.MonotonicIntegratedSquaredApproximation: Number of iterations: 5
2019-03-04 20:41:38 INFO: TM.MonotonicIntegratedSquaredApproximation: N. function evaluations: 6
2019-03-04 20:41:38 INFO: TM.MonotonicIntegratedSquaredApproximation: N. Jacobian evaluations: 10
2019-03-04 20:41:38 INFO: TM.MonotonicIntegratedSquaredApproximation: N. Hessian evaluations: 5
2019-03-04 20:45:04 INFO: TM.MonotonicIntegratedSquaredApproximation: Optimization terminated successfully
2019-03-04 20:45:04 INFO: TM.MonotonicIntegratedSquaredApproximation: Function value: 1.009555
2019-03-04 20:45:04 INFO: TM.MonotonicIntegratedSquaredApproximation: Norm of the Jacobian: 0.000000
2019-03-04 20:45:04 INFO: TM.MonotonicIntegratedSquaredApproximation: Number of iterations: 14
2019-03-04 20:45:04 INFO: TM.MonotonicIntegratedSquaredApproximation: N. function evaluations: 16
2019-03-04 20:45:04 INFO: TM.MonotonicIntegratedSquaredApproximation: N. Jacobian evaluations: 29
2019-03-04 20:45:04 INFO: TM.MonotonicIntegratedSquaredApproximation: N. Hessian evaluations: 14
......
......
Computing inverse transport map for 1000001 points took 27807.015720441937 seconds
```

Another way to accelerate things is to relax the tolerances of the rootfininding functions (if you can live with giving away some digit of precision). There is no easy way to do this right now (I didn't think of exposing those parameters but it could be a good idea...

What you would have to do is to: