# NOT RUN {
params = c(50,50,0,5,1,0,0.5,0)
modellist=list(
sersic=list(
xcen= params[1], ycen=params[2],
mag= params[3], re=params[4],
nser=params[5], ang=params[6],
axrat=params[7], box=params[8]
)
)
tolog=list(
sersic=list(
xcen=FALSE, ycen=FALSE,
mag=FALSE, re=TRUE,
nser=TRUE, ang=FALSE,
axrat=TRUE, box=FALSE
)
)
# Setup s.d. = 1 for linear and 0.1 dex for logged parameters
linear = unlist(tolog)
sigmas = unlist(modellist)
sigmas[which(linear)] = 0.1
sigmas[which(!linear)] = 1
sigmas = relist(sigmas, modellist)
#Make the list structure of prior function:
priors=profitMakePriors(modellist, sigmas, tolog)
#Check that the priors return the expected likelihood:
stopifnot(abs(priors(modellist,modellist) - sum(dnorm(0,0,unlist(sigmas),log=TRUE)))
< 10*.Machine$double.eps)
# }
Run the code above in your browser using DataLab