Importance sampling

Importance sampling is a variance reduction techniques that consists in estimating the properties of a particular distribution, while using a different sampling than the distribution of interest. It may help you saving CPU time if you choose to sample more times when the contribution to the distribution is bigger. An example can be a case when you want to estimate the dose of particles that reach a volume and you sample more particles when the distance to reach that volume is smaller; you may do this by duplicating a particle N times (of courser reducing its weight 1/N) when the particle comes closer to the volume, calculating N as an inverse of the distance to the volume.

In GAMOS you may do importance sampling using many different criteria: any of the GAMOS data can be used, as the importance sampling process uses a GAMOS distribution, taking the output value of the distribution as the splitting value that corresponds to each input value. If the splitting value (SPLIT_VALUE) is bigger than 1 it will duplicate the current particle SPLIT_VALUE-1 times (producing SPLIT_VALUE equal particles, with a weight reduced by 1/(SPLIT_VALUE). If the splitting value is smaller than 1, Russian roulette will be played with the particle with a surviving probability SPLIT_VALUE; if it survives its weight will be incremented by 1/(SPLIT_VALUE).

You may activate the importance sampling for a list of particles with the command:

/gamos/physics/VR/importanceSampling NAME DISTRIBUTION_NAME PARTICLE_NAME_1 PARTICLE_NAME_2 ...

where the NAME you give to the importance sampling will be later used to set the parameters.

As the number of particle duplications will be set by the classifier index, you may want to set a different index than the default of the classifier. See section on Classifiers to learn how to do this.

Several options can be controlled with GAMOS parameters. First you may decide to deactivate the splitting, leaving only Russian roulette, or viceversa, with the parameters:

/gamos/setParam IMPORTANCE_SAMPLING_NAME:ApplySplitting 0

/gamos/setParam IMPORTANCE_SAMPLING_NAME:ApplyRussianRoulette 0

If you do not want that a particle already split is split again, you may control how many times a particle is split with the parameter:

/gamos/setParam IMPORTANCE_SAMPLING_NAME:MaxSplitTimes VALUE

You may also set that the same particle is not split several times, by setting the parameter:

/gamos/setParam IMPORTANCE_SAMPLING_NAME:SplitAtSeveralSteps

Finally you may add one of more filters, so that particles have to pass them before being split:

/gamos/setParam IMPORTANCE_SAMPLING_NAME:Filters FILTER_1 FILTER_2 ...