Commit f9c369ba authored by Tyson Littenberg's avatar Tyson Littenberg
Browse files

possibly functioning version of stochastic model


git-svn-id: https://svn.ligo.caltech.edu/svn/bayeswave/trunk@559 c56465c9-8126-4a4f-9d7d-ac845eff4865
parent c01e30f3
......@@ -82,10 +82,9 @@ double loglike_stochastic(int NI, int imin, int imax, double **r, double ***invC
}
for(i=imin; i<imax; i++)
{
//logL -= 0.5*logf(detC[i]);
logL -= logf(detC[i]);
//logL -= log(detC[i]); // this should have a square-root, no?
logL -= log(detC[i]);
}
return logL;
}
......@@ -309,11 +308,20 @@ void recompute_residual(struct Data *data, struct Model **model, struct Chain *c
model_x->logL = 0.0;
if(!data->constantLogLFlag)
{
if(data->stochasticFlag)
{
//TODO: No support for glitch model in stochastic likelihood
ComputeNoiseCorrelationMatrix(data, model_x->Sn, model_x->background);
model_x->logL = loglike_stochastic(data->NI, data->imin, data->imax, data->r, model_x->background->Cij, model_x->background->detCij);
}
else
{
for(ifo=0; ifo<NI; ifo++)
{
model_x->detLogL[ifo] = loglike(data->imin, data->imax, data->r[ifo], model_x->Sn[ifo], data->invSnf[ifo]);
model_x->logL += model_x->detLogL[ifo];
}
}
}
......
......@@ -1881,6 +1881,7 @@ void EvolveIntrinsicParameters(struct Data *data, struct Prior *prior, struct Mo
printf("%i: %i->%i logLy=%g logLx=%g py=%g px=%g qy=%g qx=%g, dx=%i,dy=%i,num=%g, den=%g, logH=%g\n",typ,model_x->size,model_y->size,model_y->logL,model_x->logL,wave_y->logp,wave_x->logp,logqy,logqx,wave_x->size,wave_y->size,wave_y->logp+ logqx,- wave_x->logp - logqy, logH);
}
*/
//if(chain->index[ic]==0 && data->stochasticFlag)printf("logLy=%g logLx=%g Ay=%g Ax=%g detC=%g logH=%g\n",model_y->logL-data->logLc,model_x->logL-data->logLc,model_x->background->logamp,model_y->background->logamp, model_y->background->detCij[data->N/4],logH);
/*
......
......@@ -1379,7 +1379,7 @@ void stochastic_background_proposal(struct Background *bkg_x, struct Background
{
double logAmin = -115;
double logAmax = 0;
double logAmax = -80;
double kmin = -6;
double kmax = 6;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment