CosmoCoffee Forum Index CosmoCoffee

 
 FAQFAQ   SearchSearch  MemberlistSmartFeed   MemberlistMemberlist    RegisterRegister 
   ProfileProfile   Log inLog in 
Arxiv New Filter | Bookmarks & clubs | Arxiv ref/author:

CosmoMC as a sampler for parameter fitting
 
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software
View previous topic :: View next topic  
Author Message
P. Nipanjana



Joined: 06 Apr 2012
Posts: 1
Affiliation: Raman Research Institute

PostPosted: April 06 2012  Reply with quote

I have some confusion about the use of cosmoMC. I want to give a user
defined likelihood function to cosmoMC and get back the fit parameters.
I followed the instructions as given in the web but a bit confused. The
program calclike.c is a module where GenericLikelihoodFunction is
defined to be the output of a user defined likelihood function
GreatLike. My confusion is, where should I write this function
Greatlike? Inside which program? I can write it as a separate
subroutine. But in calclike.c GreatLike(Params) is supposed to be a
subroutine. Also, can I write the subroutine in C and use it with
cosmoMC?
Which one is the main program in the entire list of source codes? My data is two arrays of x and y having 1024 elements in each. So to calculate
the likelihood function I would first like to read this data in the main
program and store these arrays as global variable. Then for each sampling
of the parameter space, the data doesn't have to be read again and again.
How can I do this?

I am not familiar with fortran language at all and usually do all the
programming in C only. The above problems might even be too simple to
be solved but I have difficulties in understanding the structure due to
the language.
Back to top
View user's profile  
Antony Lewis



Joined: 23 Sep 2004
Posts: 682
Affiliation: University of Sussex

PostPosted: April 07 2012  Reply with quote

You can write your likelihood function in a separate module and use it in calclike, or various other options. Likelihood functions often initialize/read in their data the first time they are called (easily done in fortran using a SAVE local boolean variable, or a module variable).
Back to top
View user's profile [ Hidden ] Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software All times are GMT + 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group. Sponsored by WordWeb online dictionary and dictionary software.