Hi all,
Is there an easy way to convert from log priors to "real" parameter values in GetDist to plot in Matlab?
I ran CosmoMC using log priors and now want to plot the contours using the "real" values. If I convert the chains to the real params then run GetDist, the axis are NOT logscale, so much of the information is lost. Because the meshed data in plot_data/ is so limited, the information cannot be retrieved.
Is there an easy way of doing this, or am I restricted to quoting log values for my parameters?
Thanks in advance! Apologies if there is a simple answer, I don't normally use Matlab.
Lisa
CosmoMC: matlab plots and logscales

 Posts: 144
 Joined: September 24 2004
 Affiliation: University College London (UCL)
 Contact:
CosmoMC: matlab plots and logscales
Hi Lisa,
So you ran CosmoMC with flat priors on the log of your parameters and want to now plot with axes = parameters.
There are two separate issues here to decide on
* what priors you want to apply
* what axes you want to plot.
N.B. If you do the simplest thing to plot with axes = parameters then you still have the same priors as before (flat on the log of parameters). If you want to change the priors (e.g. to flat on the parameters) then you need to apply an additional correction.
Assuming you want to keep the log priors, sounds to me like you did the right thing by converting the chains to real parameters (ie. replace log(param) with param, in the columns).
I'm afraid I can't picture what you mean by "so much of the information is lost" though. Could you elaborate?
Maybe just need to change the axes on your plot a bit (to remove e.g. v large parameter values).
In which case:
e.g.
par1min=0.1
par1max=1.0
par2min=0.05
par2max=0.2
axes([par1min par1max par2min par2max])
should do it.
Hope that helps,
Sarah
So you ran CosmoMC with flat priors on the log of your parameters and want to now plot with axes = parameters.
There are two separate issues here to decide on
* what priors you want to apply
* what axes you want to plot.
N.B. If you do the simplest thing to plot with axes = parameters then you still have the same priors as before (flat on the log of parameters). If you want to change the priors (e.g. to flat on the parameters) then you need to apply an additional correction.
Assuming you want to keep the log priors, sounds to me like you did the right thing by converting the chains to real parameters (ie. replace log(param) with param, in the columns).
I'm afraid I can't picture what you mean by "so much of the information is lost" though. Could you elaborate?
Maybe just need to change the axes on your plot a bit (to remove e.g. v large parameter values).
In which case:
e.g.
par1min=0.1
par1max=1.0
par2min=0.05
par2max=0.2
axes([par1min par1max par2min par2max])
should do it.
Hope that helps,
Sarah
CosmoMC: matlab plots and logscales
Thanks for the info Sarah. I finally managed to change the original logscaled matlab file, using:
x1=exp(x1)
and then setting the axis to logscale using:
set(cga,'xscale','log')
Using the nonlog chains, the output data (in plot_data/) was still plotted on a linear scale. Hence, data on small scales was lost (this is what I meant by information loss)
The above works though. Thanks!
x1=exp(x1)
and then setting the axis to logscale using:
set(cga,'xscale','log')
Using the nonlog chains, the output data (in plot_data/) was still plotted on a linear scale. Hence, data on small scales was lost (this is what I meant by information loss)
The above works though. Thanks!