MRS  1.0
A C++ Class Library for Statistical Set Processing
RSSample Class Reference

A class for the status of a Rejection Sampler. More...

+ Collaboration diagram for RSSample:

List of all members.

Public Member Functions

real IntegralEstimate ()
 A real estimate of the integral of the function over the domain.
std::vector< rvector > Mean ()
 Arithmetic mean of the sampled labeled points in a label-specific way.
void PrintMeans (std::ostream &out)
 Print label-specific sample means from Mean().
void Print (std::ostream &out)
 Print sampled labeled points in Samples as a matrix with TAB padding.
std::vector< LabPntgetSample ()
 Return a copy of the Samples of sampled labeled points.

Public Attributes

long Nprop
 Number of draws from proposal distribution.
long Ntopologies
 Number of labels or topologies.
std::vector< int > LabelSet
 The set of unique integer labels in LabDomainList.
int n_Dim_Max
 The maximum dimension of the labeled boxes in LabDomainList.
real EnvelopeIntegral
 The envelope integral as a cxsc::real.
std::vector< LabPntSamples
 An STL vector container to store accepted samples of labeled points.

Detailed Description

A class for the status of a Rejection Sampler.


Member Function Documentation

real RSSample::IntegralEstimate ( ) [inline]

A real estimate of the integral of the function over the domain.

Todo:
Needs LabelSet specifics like Mean()
    { 
      return EnvelopeIntegral*real(int(Samples.size()))/real(Nprop);
    }
std::vector<rvector> RSSample::Mean ( ) [inline]

Arithmetic mean of the sampled labeled points in a label-specific way.

Flag for IF a label has been encountered in the samples

number of distinct labels in the samples

sum of distinct labels in the samples

Todo:
Either replace with gsl_mean like computations due to their diff eqns form or Kahan Summations Function Obj using std::transform or DotAccum in c-xsc
    {
      std::cout << "   Number of labels or topologies = " << Ntopologies << std::endl;
      std::vector<int>::const_iterator itINTV = 
        max_element(LabelSet.begin(),LabelSet.end());
      int MaxLabelNum = *itINTV;
      
      std::vector<bool> first(MaxLabelNum+1, true);
      
      std::vector<long> L_sums(MaxLabelNum+1, 0);
                    
      std::vector<rvector> sums(MaxLabelNum+1);
      std::vector<LabPnt>::const_iterator it = Samples.begin();
      for(; it != Samples.end(); it++)
      {
        int label = it->L;
        if(first[label])
        {
          sums[label] = rvector(it->Pnt);
          L_sums[label] = 1;
          first[label] = false;
        }
        else
        {
          sums[label] += it->Pnt;
          L_sums[label] += 1;
        }
      }
      for(int i=0; i<Ntopologies; i++)
      {
        if(L_sums[LabelSet[i]] > 0)
        { 
          sums[LabelSet[i]] /= (real)L_sums[LabelSet[i]];
        }
        std::cout << "label: " << LabelSet[i] << "  proportion: " 
             << (real)L_sums[LabelSet[i]]/(real)(long)Samples.size() 
             << std::endl << "Labelled Mean:\n" << sums[LabelSet[i]] << std::endl;
      }
      return sums;
    }

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends