Simulation

C

c language

Hello,

This is my first experience in writing a program with 'C'. I am
doing a simulation to do some study on the genome. I am calculating the
LOD score (Maximum Likelihood) in the simulation. I did 10000
replicates and the results were something that I can't understand.
Actually the average of the answers was started from about 100, then
decreased to about 10 in about replicate 1500 and increased to 150 in
replicate 10000. I don't know what the problem is. Is it the problem
of my program or the C random number generator or ....
Just to let you know, the program is very long, more than 1000 lines.

Thanks,
Mohsen
 
V

Vladimir S. Oka

c said:
Hello,

This is my first experience in writing a program with 'C'. I am
doing a simulation to do some study on the genome. I am calculating the
LOD score (Maximum Likelihood) in the simulation. I did 10000
replicates and the results were something that I can't understand.
Actually the average of the answers was started from about 100, then
decreased to about 10 in about replicate 1500 and increased to 150 in
replicate 10000. I don't know what the problem is.

Are you sure the problem is not in the algorithm. Things do get lost in
translation between a method and the code. You should double check that
in whatever group deals with the moethods you're using. Nothing to do
with C yet.
Is it the problem of my program or the C random number generator or ....

The random number generator provided by your implementation may indeed
not be up to scratch, but you can't know until you test it (and it also
depends on your application). Once you've tested, and determined it's
not good enough, search for a better implementation. Again, there are
better groups for that, but if you run into problem implementing your
choice RNG in C, do come back and ask here.
Just to let you know, the program is very long, more than 1000 lines.

Don't post it whole, then. Try to cut it down to a minimal example that
will compile, run, and exhibit the erroneous behaviour. If that is
managable in size post it here. If you can't do it, then post it on a
web site and put the link here. There's bound to be people willing to
have a look.

Good luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top