Python equivalent of `wavedec3` from MATLAB - python

I am trying to implement a discrete wavelet transform (DWT) in 3D, and I have found the MATLAB equivalent, wavedec3. Does anyone know if there is a Python equivalent I can use rather than going ahead and writing my own?

I used pywt the wavedecn(array, method, level) and it does what I wanted to do: perform discrete wavelet transform on a 3D array in multi-levels.

Related

Is there a NumPy equivalent for SciPy's cKDTree function?

I'm trying to convert a radial distribution function for my use, but the code I'm looking at uses a cKDTree. The problem is that I want to use only numpy in my function.
Does anyone know an equivalent function in numpy that can be used or a way to make an equivalent "tree"?

Multi Dimensional approximation in Python

I need to approximate (by the gaussian function) 2 or 3 dimensional data sets using Python, but i found only interpolation methods. Anyone have heard about some library, that can do that ?

What is the easiest way to solve matrix inverse using python

I Wanted to solve matrix inverse without calling numpy into python. I want to know if it possible or not.
your question title:
What is the easiest way to solve matrix inverse using python
import numpy
numpy.linalg.inv(your_matrix)
or the same with scipy instead of numpy -- that's definitely the easiest, for you as a programmer.
What is your reason not to use numpy?
You can of course look for an algorithm and implement it manually. But the built-in function are based on the Fortran LAPACK algorithms, which are tested and optimized for the last 50 years... they will be hard to surpass...

scipy.interpolate.griddata equivalent in CUDA

I'm trying to perform Fitted Value Iteration (FVI) in python (involving approximating a 5 dimensional function using piecewise linear interpolation).
scipy.interpolate.griddata works perfectly for this. However, I need to call the interpolation routine several thousand times (since FVI is a MC based algorithm).
So basically, the set of points where the function is known is static (and large - say 32k), but the points i need to approximate (which are small perturbations of the original set) is very large (32k x 5000 say).
Is there an implementation of what scipy.interpolate.griddata does that's been ported to CUDA?
alternatively, is there a way to speed up the calculation somehow?
Thanks.
For piece-wise linear interpolation, the docs say that scipy.interpolate.griddata uses the methods of scipy.interpolate.LinearNDInterpolator, which in turn uses qhull to do a Delaunay tesellation of the input points, then performs standard barycentric interpolation, where for each point you have to determine inside which hypertetrahedron each point is, then use its barycentric coordinates as the interpolation weights for the hypertetrahedron node values.
The tesellation is probably hard to parallelize, but you can access the CPU version with scipy.spatial.Delaunay. The other two steps are easily parallelized, although I don't know of any freely available implementation.
If your known-function points are on a regular grid, the method described here is specially easy to implement in CUDA, and I have worked with actual implementations of it, albeit none publicly available.
So I am afraid you are going to have to do most of the work yourself...

What is the corresponding function for corrmtx (in MATLAB) in Python?

I'm translating some code from MATLAB to Python and I'm stuck with the corrmtx() MATLAB function. Is there any similar function in Python, or how could I replace it?
The spectrum package has such a function.
How about:
http://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.toeplitz.html
The matlab docs for corrmtx state:
X = corrmtx(x,m) returns an (n+m)-by-(m+1) rectangular Toeplitz matrix
X, such that X'X is a (biased) estimate of the autocorrelation matrix
for the length n data vector x.
The scipy function gives the Toeplitz matrix, although I'm not sure if the implementations are identical.
Here is a list of alternatives that can help you in translating your code, all of which contain that function:
scipy (toeplitz | corrmtx)
spectrum (corrmtx)
The following is a link to another post that tells you how to use numpy for the auto correlation since it seems to be the default funcationality of corrmtx
Additional Information:
Finding the correlation matrix in Python
Unbiased Estimation of Covariance Matrix

Categories