flavour
Proposal Class Reference

A class containing the parameters of a proposal for the next step in the Markov Chain. More...

#include <MCMC.h>

Collaboration diagram for Proposal:

Public Member Functions

 Proposal (const Model *m)
 
void findPeaks (uint ns=1, int max=0)
 
void getProposal ()
 
void getNextPoint ()
 

Public Attributes

const Modelmodel
 
vector< PeakvPeak
 
Peak floatPeak
 
Peak proposal
 
double total
 

Detailed Description

A class containing the parameters of a proposal for the next step in the Markov Chain.

Definition at line 162 of file MCMC.h.

Constructor & Destructor Documentation

Proposal::Proposal ( const Model m)
inline

Definition at line 165 of file MCMC.h.

165 : model(m), floatPeak(m),proposal(m){}
Peak floatPeak
Definition: MCMC.h:223
Peak proposal
Definition: MCMC.h:223
const Model * model
Definition: MCMC.h:220

Member Function Documentation

void Proposal::findPeaks ( uint  ns = 1,
int  max = 0 
)
inline

Definition at line 167 of file MCMC.h.

References parameters::area(), Peak::findPeak(), Peak::llmax, Peak::lmax, and Peak::pr.

Referenced by main().

167  {
168  //float pmin=-100, pmax=100, s=0.1;
169  //floatPeak.s=s;
170  //floatPeak.lmax=0;
171  //int imax=-1;
172  floatPeak=Peak(model,max);
173  floatPeak.lmax=0;
174  floatPeak.llmax=-1000;
175  cout<<"started"<<endl;
176  //for(uint i=5e1;i;i--){
177  for(uint i=ns;i;i--){
178  Peak pp(model,max);
179  pp.findPeak();
180  if(pp.llmax>-15){
181  //for(uint j=0; j< pp.pr.size();j++){
182  //cout<<j<<" "<<pp.pr[j].value<<endl;
183  //}
184  //lst l=model->getlist(pp.pr);
185  //for(uint j=0; j< model->size();j++){
186  // double mean=model->at(j).calculate(l);
187  //cout<<j<<" "<<mean<<" "<<sqrt(2*model->at(j).o->loglikelihood(mean))<<endl;
188  //}
189  }
190  if(pp.lmax>floatPeak.lmax){
191  cout<<i<<" "<<pp.lmax<<endl;
192  floatPeak.lmax=pp.lmax;
193  floatPeak.pr=pp.pr;
194  }
195  }
197 
198 }
Peak floatPeak
Definition: MCMC.h:223
double area() const
Definition: model.h:215
unsigned int uint
Definition: script.cpp:4
A class containing the parameters of a maximum of the likelihood function.
Definition: MCMC.h:11
double area
Definition: MCMC.h:156
const Model * model
Definition: MCMC.h:220
double lmax
Definition: MCMC.h:155
double llmax
Definition: MCMC.h:155
parameters pr
Definition: MCMC.h:154

Here is the call graph for this function:

Here is the caller graph for this function:

void Proposal::getNextPoint ( )
inline

Definition at line 210 of file MCMC.h.

Referenced by main().

210  {
211  getProposal();
212  double l1=0;
214  if(model->r->Rndm()<=l1/floatPeak.lmax){
215  floatPeak.lmax=l1;
217  }
218 }
TRandom3 * r
Definition: model.h:405
void getProposal()
Definition: MCMC.h:200
Peak floatPeak
Definition: MCMC.h:223
double likelihood(const parameters &p, bool check=1, int max=0) const
calculates the probability of getting all the experimental measures if the model describes the realit...
Definition: model.h:374
Peak proposal
Definition: MCMC.h:223
const Model * model
Definition: MCMC.h:220
double lmax
Definition: MCMC.h:155
void setvalues(const parameters &p)
Definition: model.h:208
parameters pr
Definition: MCMC.h:154

Here is the caller graph for this function:

void Proposal::getProposal ( )
inline

Definition at line 200 of file MCMC.h.

200  {
201  if(model->r->Rndm()<=0.9) {
203  proposal.pr.next(model->r);
204  return;
205  }
206 
208 }
TRandom3 * r
Definition: model.h:405
Peak floatPeak
Definition: MCMC.h:223
virtual parameters generateparameters(int max=0) const =0
Peak proposal
Definition: MCMC.h:223
const Model * model
Definition: MCMC.h:220
void next(TRandom3 *r, double f=1)
changes randomly the value of the parameters
Definition: model.h:182
parameters pr
Definition: MCMC.h:154

Member Data Documentation

Peak Proposal::floatPeak

Definition at line 223 of file MCMC.h.

Referenced by main().

const Model* Proposal::model

Definition at line 220 of file MCMC.h.

Peak Proposal::proposal

Definition at line 223 of file MCMC.h.

double Proposal::total

Definition at line 224 of file MCMC.h.

vector<Peak> Proposal::vPeak

Definition at line 222 of file MCMC.h.


The documentation for this class was generated from the following file: