Institut de Robòtica i Informàtica Industrial

rand

PURPOSE ^

Generates random points on a GMixture.

SYNOPSIS ^

function v=rand(gm,varargin)

DESCRIPTION ^

   Generates random points on a GMixture.

   Return random vectors following the distribution represented by the
   mixture. Observe that this works for unnormalized mixtures too. The
   components are selected proportionally to the absolute value of their
   corresponding weigth.
   This function accepts two parameters
     - The Gaussian mixture.
     - The number of samples to drawn. If not given only one sample is
       generated.

CROSS-REFERENCE INFORMATION ^

This function calls:
  • rand Random state from a discrete belief.
  • get Get for GBeliefs.
  • rand Random state from a belief.
  • get Get function for the GMixture object.
  • rand Generates random points on a GMixture.
  • get Gaussian object get function.
  • rand Generates random ponts on a Gaussian.
  • RandVector Selects and element from a discrete probability distribution.
  • get Get function for CS_CO_CA_POMDPs.
  • get Get function for CS_CO_DA_POMDPs.
  • get Get function for CS_CO_POMDPs.
  • get Get function for CS_DO_CA_POMDPs.
  • get Get function for CS_DO_DA_POMDPs.
  • get Get function for CS_POMDPs.
  • get Get function for DS_CO_CA_POMDPs.
  • get Get function for DS_CO_DA_POMDPs.
  • get Get function for DS_DO_CA_POMDPs.
  • get Get function for DS_DO_DA_POMDPs.
  • get Get functio for POMDPs.
  • dim Dimensionality of a continuous space.
  • rand Random state from a continuous space.
  • dim Dimensionality of a discrete space.
  • rand Random state from a discrete space.
This function is called by:
  • Prediction Belief evolution under the given action.
  • Prediction Belief evolution under the given action.
  • Prediction Belief evolution given a transition model.
  • Update Belief evolution under an observation model.
  • MakeFigure3 Generates Figure 3.
  • CompressGR Gaussian mixture compression using the Golberger and Roweis method.
  • rand Generates random points on a GMixture.
  • RandVector Selects and element from a discrete probability distribution.
  • CS_CO_ObsModel CS_CO_ObsModel constructor.
  • CS_DO_ObsModel CS_DO_ObsModel constructor.
  • DiscretizeObsModel Discretizes the observation model on the observation side.
  • Perseus The Perseus point-based POMDP solver.
  • RandomAction Draws a random action from a POMDP.
  • SampleBeliefs Samples a set of beliefs from a POMDP.
  • SimulateFrom Simulates a POMDP from a given belief.
  • SimulationStep Executes one step of a POMDP simulation.
  • iPerseus Improved version of Perseus.
  • Discretize Converts a continuous space into a discrete one.
  • rand Random state from a continuous space.
  • rand Random state from a discrete space.

SOURCE CODE ^

0001 function v=rand(gm,varargin)
0002 %   Generates random points on a GMixture.
0003 %
0004 %   Return random vectors following the distribution represented by the
0005 %   mixture. Observe that this works for unnormalized mixtures too. The
0006 %   components are selected proportionally to the absolute value of their
0007 %   corresponding weigth.
0008 %   This function accepts two parameters
0009 %     - The Gaussian mixture.
0010 %     - The number of samples to drawn. If not given only one sample is
0011 %       generated.
0012 
0013   if gm.n==0
0014     v=0;
0015   else
0016     if nargin>1
0017       n=varargin{1};
0018     else
0019       n=1;
0020     end
0021     
0022     dim=get(gm.g{1},'dim');
0023     v=zeros(dim,n);
0024     for i=1:n
0025       v(:,i)=rand(gm.g{RandVector(gm.w)},1);
0026     end
0027   end
0028


Institut de Robòtica i Informàtica Industrial

Generated on Wed 05-Aug-2009 15:05:21 by m2html © 2003