I have a 4-dimensional ellipsoid from which I want to draw samples uniformly. I thought of an approach using a hyper cube around the ellipsoid. We can draw a sample from it and check if it is in the ellipsoid. But the volume ratio of hypercube and ellipsoid in 4 dimensions is 0.3. That means I have only 30 percent success rate. As my algorithm has speed issues I don't want to use this approach. I have also been looking at Inverse transform sampling. Can you give me an insight on how to do this with a 4-dimensional ellipsoid ?
1 に答える
1
超楕円体を球体に変換できます。
したがって、与えられたアルゴリズムは球に対して有効ですが、楕円体に簡単に変換できます。
- すべての座標 x1 から x4 についてガウス分布 N(0,1) から描画します。x=[x1,x2,x3,x4].
- ベクトル x を正規化します。==> 表面に均一に分布したベクトルが得られました。
- ここで、単位球の内側の点として [0,1] から半径 u を描きます。
- p=u**(1/4)*x は、4 次元単位球内で均一に分布するベクトルです。
于 2014-07-01T16:35:51.533 に答える