How to create an 8-dimensional network

Using Matlab, how to create a grid of 3 ^ 10 points that are evenly spaced (or distributed) on an 8-dimensional unit sphere?

+3
source share
3 answers

from wikipedia n-sphere

To generate uniformly distributed random points on an (n - 1) -sphere (i.e., the surface of an n-ball), Marsaglia (1972) gives the following algorithm.

Create an n-dimensional vector of normal deviations (it is enough to use N (0, 1), although in fact the choice of variance is arbitrary), \ Mathbf {x} = (x_1, X_2, \ ldots, x_n).

Now calculate the "radius" of this point, r = \ SQRT {x_1 ^ 2 + x_2 ^ 2 + \ cdots + x_n ^ 2}.

\frac {1} {r}\mathbf {x} n-.

MATLAB-, :

numdims = 8;
numpts = 3^10;
x = randn([numdims numpts]);
lx = repmat(sqrt(sum(x.^2,1)), [numdims 1]);
x = x./lx;
%x(:,j) is the jth point on the circle)
0

n- n-d , 1. , .

, , .

nd () - nd -,

%# set-up
nPoints = 3^10;
nDim = 8;

%# create normally distributed variables
points = randn(nPoints,nDim);

%# normalize by dividing by the norm (=square root of sum(points.^2,2) )
points = bsxfun(@rdivide,points,sqrt(sum(points.^2,2)));
+3

, ,

n- r (n + 1) - , r , r

3 ^ 10 7-. , r = 1. , 7-, .

- , , , , , OP. .

pointset = rand(3^10,7);
normset = zeros(3^10,1);
for ix = 1:3^10
  normset(ix) = norm(pointset(ix,:));
end
for ix = 1:3^10
  pointset(ix,:) = pointset(ix,:)/normset(ix);
end

, , Matlab PRNG, 8-.

0

Source: https://habr.com/ru/post/1755249/


All Articles