### Post by Robin on Jul 28, 2017 13:12:49 GMT 8

I thought I might quickly warn those using constraints in their models. Whilst constraints are good for avoiding potentially unphysical solutions, they can affect the way in which the optimisation routine samples the parameter distributions.

As an example, one might impose the constraint that the effective radius of the bulge must not exceed that of the disk with the following:

This states that if the bulge radius becomes larger than the disk, set the bulge radius to be equal to the disk.

However, this can in some cases create the situation of "sticky parameters" where, as the MCMC routine is sampling the parameters, it tends to sample the parameters being constrained together. The results are posteriors that look like the following:

What you will notice is that the posterior distributions for each of the effective radii are almost exactly the same. Looking at the cross-correlation between these in the third panel on the top shows that the two parameters are highly correlated. This is due to the constraints being imposed which cause the bulge radius to equal the disk radius if the two overlap. This is

Here the parameters have been well sampled.

Moral of the story:

As an example, one might impose the constraint that the effective radius of the bulge must not exceed that of the disk with the following:

`constraints=function(modellist){`

if(modellist$sersic$re[1]>modellist$sersic$re[2]){modellist$sersic$re[1]=modellist$sersic$re[2]}

return=modellist

}

This states that if the bulge radius becomes larger than the disk, set the bulge radius to be equal to the disk.

**Note that there is not really a physical reason why this would necessarily be true; but it is useful to stop the two (otherwise, indistinguishable) Sersic profiles from swapping.*However, this can in some cases create the situation of "sticky parameters" where, as the MCMC routine is sampling the parameters, it tends to sample the parameters being constrained together. The results are posteriors that look like the following:

What you will notice is that the posterior distributions for each of the effective radii are almost exactly the same. Looking at the cross-correlation between these in the third panel on the top shows that the two parameters are highly correlated. This is due to the constraints being imposed which cause the bulge radius to equal the disk radius if the two overlap. This is

**NOT**to say that constraints will always cause the effective radii to be stuck, in fact, below I show an example of the same galaxy where the only thing that has been changed are the initial conditions.Here the parameters have been well sampled.

Moral of the story:

**Be careful when using constraints so as not to impede the sampling of your parameters.**