contents next up previous
Next: Kriging Weights Up: Algorithms Previous: Construct Non-Parametric Cdf

Subsections

CDF Transform

template<class target_cdf, class data_cdf, class forward_iterator>
void
cdf_transform(forward_iterator first, forward_iterator last,
              data_cdf& from, target_cdf& to) 

cdf_transform transforms the range of values [first,last) so that their final cumulative distribution function is to. Cdf from is the cumulative distribution function before the data are transformed. It could be computed with build_cdf.



Where defined

In header file <univariate_stats.h>



Preconditions



Requirements on types



Remark

The values in range [first,last) are overwritten by the transformed values.



Example

Transform 100 uniformly distributed values so that the transformed values follow a standard normal distribution:

int main()
{
  vector<double> uniform_values;

  for(int i=1; i<=100; i++)
    uniform_values.push_back( rand() );

  non_param_cdf from;
  vector<double> tmp(uniform_values);
  build_cdf(tmp.begin(), tmp.end(), from);

  gaussian_cdf normal_cdf(0,1);

  cdf_transform(uniform_values.begin(), uniform_values.end(),
                from, normal_cdf);
}


contents next up previous
Next: Kriging Weights Up: Algorithms Previous: Construct Non-Parametric Cdf
nicolas
2002-05-07