Uniform probability on a continuous space.
Generates a uniform distribution on the bounds defining the given
continuous space.
Right now, the output is a Gaussian mixture with a single component
with a spherical covariance defined given the bounds of the space in
each dimension.
Parameters:
CS: The continuous space where to define the probability
distribution.
Outputs:
p: The Gaussian mixture.
v: Value for the distribution in the continuous space. This is lower
as the space gets larger. In principle this is the same value as
that returned by UniformProbability but it could be slightly
different since the returned distribution is only an approximation
of the uniform distribution and not the real one.
See also @CSpace/UniformProbability.
0001 function [p v]=UniformDistribution(CS)
0002 % Uniform probability on a continuous space.
0003 %
0004 % Generates a uniform distribution on the bounds defining the given
0005 % continuous space.
0006 % Right now, the output is a Gaussian mixture with a single component
0007 % with a spherical covariance defined given the bounds of the space in
0008 % each dimension.
0009 %
0010 % Parameters:
0011 % CS: The continuous space where to define the probability
0012 % distribution.
0013 % Outputs:
0014 % p: The Gaussian mixture.
0015 % v: Value for the distribution in the continuous space. This is lower
0016 % as the space gets larger. In principle this is the same value as
0017 % that returned by UniformProbability but it could be slightly
0018 % different since the returned distribution is only an approximation
0019 % of the uniform distribution and not the real one.
0020 %
0021 % See also @CSpace/UniformProbability.
0022
0023 d=CS.max-CS.min;
0024 md=max(d);
0025 c=CS.min+d/2;
0026 g1=Gaussian(c,ones(CS.dim)*200*md);
0027 p=GMixture(1,{g1});
0028 v=Value(g1,CS.min);
0029