## GSLIB Help Page: PFSIM

Description:

- The `pfsim` program is for simulation of categorical or continuous variables with p-field simulation.

Parameters:

- vartype: the variable type (1=continuous, 0=categorical)
- idist: if set to 1, then the conditional distributions are taken to be defined by indicator thresholds. If set to 0, then the conditional distributions are Gaussian requiring a mean and variance
- ncat: number of thresholds or categories (idist=1 or vartype=0)
- cat: the threshold values or category codes (there should be ncat values on this line of input)
- datafl: the data file containing z-data that provides the details between the IK thresholds. This file is used only if table look-up values are called for in one of the interpolation/extrapolation options.
- icolvr and icolwt: when either ltail, middle or utail is 3 then these variables identify the column for the values and the column for the (declustering) weight in datafl that will be used for the global distribution.
- zmin and zmax: minimum and maximum data values allowed. Even when not using linear interpolation it is safe to control the minimum and maximum values entered. The lognormal or hyperbolic upper tail is constrained by zmax
- ltail and ltpar specify the extrapolation in the lower tail: ltail=1 implements linear interpolation to the lower limit zmin; ltail=2 implements power model interpolation, with w=ltpar, to the lower limit zmin; and ltail=3 implements linear interpolation between tabulated quantiles.
- middle and midpar specify the interpolation within the middle of the distribution: middle=1 implements linear interpolation to the lower limit zmin; middle=2 implements power model interpolation, with w=midpar, to the lower limit zmin; and middle=3 allows for linear interpolation between tabulated quantile values;
- utail and utpar specify the extrapolation in the upper tail of the distribution: utail=1 implements linear interpolation to the upper limit zmax, utail=2 implements power model interpolation, with w=utpar, to the upper limit zmax; utail=3 implements linear interpolation between tabulated quantiles; and, utail=4 implements hyperbolic model extrapolation with w=utpar.
- distfl: input data file with the conditional distributions.
- imean and ivar: columns for the Gaussian ccdf means and variances (idist=0) or the ccdf values (idist=1).
- tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
- pfile: file containing the input p-field probability realizations
- icolp: column number in pfile for the p-field probability value.
- pflag: if set to 0, then the p-field probability values are taken to be Gaussian deviates that need to be converted to cumulative probability values. If set to 1, then the p-field probability values are already cumulative distribution values between 0 and 1.
- outfl: the output grid is written to this file. The output file will contain the results, cycling fastest on x, then y, then z, then simulation by simulation.
- nsim: number of realizations
- nx, ny, and nz: size of the simulation grid A short description of the program