Institut de Robòtica i Informàtica Industrial

get

PURPOSE ^

Gaussian object get function.

SYNOPSIS ^

function out=get(g,field)

DESCRIPTION ^

   Gaussian object get function.

   Returns the information associated with a Gaussian
   Possible queries are
      - dim: The dimensionality of the space where the Gaussian is defined
      - mean:  The mean vector.
      - covariance: The covariance matrix.
      - invCovariance: The inverse of the covariance matrix.
      - volume: The volume of the ellipsoid defined from the covariance matrix.
      - normalizationFactor: The normalization factor for a Gaussian (the constant
        that multiplies the exponential defining the Gaussian
        distribution).
      - ellipse: Returns a line representing the iso-countour of the
        ellipse defined from the mean and covariance at a 95% confidence
        value. For higher-dimensional Gaussians, we marginalize and only
        use the first 2 components of the Gaussians.

CROSS-REFERENCE INFORMATION ^

This function calls:
  • size Returns the size of a policy.
This function is called by:

SOURCE CODE ^

0001 function out=get(g,field)
0002 %   Gaussian object get function.
0003 %
0004 %   Returns the information associated with a Gaussian
0005 %   Possible queries are
0006 %      - dim: The dimensionality of the space where the Gaussian is defined
0007 %      - mean:  The mean vector.
0008 %      - covariance: The covariance matrix.
0009 %      - invCovariance: The inverse of the covariance matrix.
0010 %      - volume: The volume of the ellipsoid defined from the covariance matrix.
0011 %      - normalizationFactor: The normalization factor for a Gaussian (the constant
0012 %        that multiplies the exponential defining the Gaussian
0013 %        distribution).
0014 %      - ellipse: Returns a line representing the iso-countour of the
0015 %        ellipse defined from the mean and covariance at a 95% confidence
0016 %        value. For higher-dimensional Gaussians, we marginalize and only
0017 %        use the first 2 components of the Gaussians.
0018 
0019   switch field
0020     case 'dim'
0021       out=g.dim;
0022         case 'mean'
0023             out=g.m;
0024         case 'covariance'
0025             out=g.S;
0026         case 'information'
0027             out=g.iS;
0028         case 'volume'
0029             out=g.d;
0030         case 'normalizationFactor'
0031             out=g.ct;
0032         case 'ellipse'
0033             S2d=g.S(1:2,1:2);
0034       % For 2 dim, a Xi squared distribution gives that the
0035       % 90% confidence level is obtained at 2.1459
0036       R=chol(S2d);
0037       y = 2.1459*[cos(0:0.1:2*pi);sin(0:0.1:2*pi)];
0038       el=R*y;
0039       out = [el el(:,1)]+repmat(g.m(1:2),1,size(el,2)+1);
0040       
0041     otherwise
0042       error('Unknow field in Gaussian get');
0043     end


Institut de Robòtica i Informàtica Industrial

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