Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/tlittenberg/ldasoft
Browse files Browse the repository at this point in the history
  • Loading branch information
tlittenberg committed Mar 21, 2024
2 parents b86a824 + dbfd2cb commit 43c1e3e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 2 additions & 3 deletions ucb/src/glass_ucb_proposal.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ double draw_from_uniform_prior(UNUSED struct Data *data, struct Model *model, UN
return logQ;
}

double evaluate_uniform_prior(struct Data *data, struct Model *model, UNUSED struct Source *source, UNUSED struct Proposal *proposal, double *params, UNUSED gsl_rng *seed)
double uniform_prior_density(struct Data *data, struct Model *model, UNUSED struct Source *source, UNUSED struct Proposal *proposal, double *params)
{

double logQ = 0.0;
Expand Down Expand Up @@ -382,7 +382,6 @@ double evaluate_uniform_prior(struct Data *data, struct Model *model, UNUSED str
if(UCB_MODEL_NP>8)
{
n = 8;
params[n] = model->prior[n][0] + gsl_rng_uniform(seed)*(model->prior[n][1]-model->prior[n][0]);
logQ -= model->logPriorVolume[n];
}

Expand Down Expand Up @@ -817,7 +816,7 @@ void initialize_proposal(struct Orbit *orbit, struct Data *data, struct Prior *p
case 0:
sprintf(proposal[i]->name,"prior");
proposal[i]->function = &draw_from_uniform_prior;
proposal[i]->density = &evaluate_uniform_prior;
proposal[i]->density = &uniform_prior_density;
proposal[i]->weight = 0.1;
proposal[i]->rjweight = 0.2;
setup_prior_proposal(flags, prior, proposal[i]);
Expand Down
10 changes: 8 additions & 2 deletions ucb/src/glass_ucb_proposal.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ double draw_from_gmm_prior(struct Data *data, struct Model *model, struct Source
*/
double draw_from_uniform_prior(UNUSED struct Data *data, struct Model *model, UNUSED struct Source *source, UNUSED struct Proposal *proposal, double *params, gsl_rng *seed);
double evaluate_uniform_prior(struct Data *data, struct Model *model, UNUSED struct Source *source, UNUSED struct Proposal *proposal, double *params, UNUSED gsl_rng *seed);


/**
\brief Fair draw from prior for location and orientation parameters
Expand Down Expand Up @@ -353,6 +351,14 @@ void setup_covariance_proposal(struct Data *data, struct Flags *flags, struct Pr
*/
double evaluate_fstatistic_proposal(struct Data *data, UNUSED struct Model *model, UNUSED struct Source * source, struct Proposal *proposal, double *params);

/**
\brief Returns (log) uniform prior density
Returns \f$\sum \log\frac{1}{\Delta V}\f$ for each parameter except the SNR prior for \f$\mathcal{A}\f$.
*/
double uniform_prior_density(struct Data *data, struct Model *model, UNUSED struct Source *source, UNUSED struct Proposal *proposal, double *params);


/**
\brief Returns (log) prior density
Expand Down
2 changes: 1 addition & 1 deletion utils/src/gitversion.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define GITVERSION "37678b6"
#define GITVERSION "368bef07"

0 comments on commit 43c1e3e

Please sign in to comment.