Clone wiki

cosmosis / demos / Demo22

Demo 22: The star sampler

This sampler deterministically scans along parameter axes through some central parameter vector: it varies one element of the central parameter vector at a time, scanning along equal incremental shifts in the elementʼs value, from one extreme to the other. The ranges in the values.ini file stipulate the extremes of each parameterʼs range and the central value for that parameter.

As with the grid and test samplers, the outputs can be inspected to reveal the overall shape of the likelihood surface; and here also the shifts along the parameter axes indicate the nature of the directional derivatives in orthogonal directions.

This demonstration is similar to Demo7 which explores the BOSS likelihood, but here the star sampler is used instead of the grid sampler, hence the same parameter space is explored but now activity is concentrated along orthogonal parameter axes.


Simply run Demo 22 with the command

cosmosis demos/demo22.ini

and inspect the outputs in demo22.txt.

Cosmosis Configuration

Regarding demo22.ini, the star sampler is selected in the top section, [runtime], of the file, and a new section called star is accordingly added to the file. The parameters to set here are as follows.

  • nsample_dimension is the number of equally spaced samples along each dimension (parameter axis). The total number of sample points will thus be this multiplied by the number of variable parameters (the ones with specified ranges in the values.ini file).

  • nstep is the number of samples between each line of output to the results file.

  • allow_large is a boolean option whose default value of FALSE will prevent the sampler from running if the product of dimensions and nsample_dimension is large; as this sampler is only useful for diagnosing problems with optimization of sample likelihood, excessive computation and output does not generally make sense. Set the option to TRUE to override this fail-safe.