bug-mcsim
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mcsim and bayesian network


From: Celine BROCHOT
Subject: mcsim and bayesian network
Date: Wed, 18 Jul 2001 10:27:47 +0200

Dear Kuppa Kiran Kumar,

To run McSim with Bayesian MCMC estimations, you have to write two 
files, one with the model specification and the other with the statistics 
(or simulation) specification. In this last file, the keyword Level is 
essential. 
You should create at least one Level section which includes all the prior 
distributions or data likelihood. You can open an another Level 
section (which is included in the first one) to define a hierarchical model.
The last (bottom) level of the hierarchy should be an "Experiment"  (an 
Experiment is a level containing data specification).

For example, suppose that you have data Y modeled as normally
distributed around prediction aX, X being some design variable and a  a 
parameter to estimate.

The structure of your simulation file will be as follow:

      Definition of simulation

      Level { # top level
    
              # Definition of a priori distribution for a
               Distrib (a, Uniform, -10, 10);

              # Likelihood 
              Likelihood ( Y, Normal, Prediction(Y), 1);

              Level { # all data
 
                     Experiment { # experiment 1
                             X = 0;
                            Print ( Y, 1); # printing at an arbitory time
                            # the corresponding value of Y for X = 0 
                           Data ( Y, 0.65);
                    }

                    Experiment { # experiment 2
                             X = 1;
                            Print ( Y, 1); # printing at an arbitory time
                            # the corresponding value of Y for X = 1 
                           Data ( Y, 0.83);
                    }

              } # end all data
       } # end top level


You could have several Experiment sections, which have to be included in
a Level section.

The Experiment section allows you to define simulation conditions and to
specify outputs. In this section you have to include the data values. You can 
also set there parameters or variables to a constant value. 

After compiling and running the program, you will obtain an output file.
The first line of this file indicates which variables are sampled. Each 
column corresponds to one variable. In a column you obtain the posteriori
distribution of one variable. 


I am sending you the latest versions of the programs and some examples
of MCMC use and level definitions.

Feel free to ask me more questions if needed.

Best regards

CĂ©line Brochot
 

Attachment: mcsamples.tar.gz
Description: Binary data

Attachment: mcsimint.tar.gz
Description: Binary data

Attachment: mod.tar.gz
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]