Next: Basic classes
Up: Algorithms
Previous: Sequential Simulation, Multiple-Variable Case
Subsections
-
template<class gval_iterator, class forward_iterator,
class neighborhood, class cdf, class cdf_estimator>
void
pfield_simulation(gval_iterator begin, gval_iterator end,
neigborhood* neighbors,
cdf& ccdf, cdf_estimator& estim,
forward_iterator pf_begin, forward_iterator pf_end)
-
template<class gval_iterator, class forward_iterator,
class neighborhood, class cdf, class cdf_estimator>
void
pfield_simulation(gval_iterator begin, gval_iterator end,
neigborhood** first_neighbors,
unsigned int nb_of_neighborhoods,
cdf& ccdf, cdf_estimator& estim,
forward_iterator pf_begin, forward_iterator pf_end)
This function performs a p-field simulation on geo-values in range [begin,end). For each geo-value, a cdf conditional to only the original data (contrary to sequential simulation where the cdf at each geo-value is conditional to both the original data and the previously simulated values) is estimated by Cdf Estimator estim. All the cdf's are then sampled using the correlated probabilities stored in range [pf_begin, pf_end) (``pf'' stands for p-field).
The cdf corresponding to the geo-value that begin+i points to, is sampled using the probability that pf_begin+i points to. Hence the order in which the geo-values and the p-field values are stored is important.
Version 2 of the algorithm allows to use multiple properties to estimate each cdf.
In header file <simulation.h>
- Ranges [begin,end) and [pf_begin, pf_end) are of the same size (i.e. there are as many geo-values as p-field values).
- The values of the p-field (in range [pf_begin, pf_end)) are probabilities, i.e. real numbers between 0 and 1.
- estim and ccdf do not conflict: if estim is designed to estimate Gaussian cdf's, ccdf should be a Gaussian cdf.
- In version 2 of the function, first_neigh[n] is a pointer to the (n+1)-th neighborhood to be accounted for. (n < nb_of_neighborhoods).
- gval_iterator is a model of Forward Iterator, which iterates on Geo-Values. It is not a model of GeoValue Iterator.
- forward_iterator is a model of Forward Iterator, iterating on floating points values.
- neighborhood is a model of Neighborhood. The find method of the neighborhood must consider only original data as potential neighbors, and ignore any other geo-value: in p-field simulation, each cdf is only conditional to the original data.
- cdf is a model of Cdf.
- cdf_estimator is a model of CDF Estimator.
The cdf corresponding to the geo-value that begin+i points to, is sampled using the probability that pf_begin+i points to. This means that the two sequences of geo-values and p-field values are tightly linked. Element i of the geo-value range and element i of the p-field form a pair. Swapping elements of either range would completely change the correlation of the simulated field. In particular, gval_iterator can not be a random path.
Next: Basic classes
Up: Algorithms
Previous: Sequential Simulation, Multiple-Variable Case
nicolas
2002-05-07