Tammie Covington | 1 Jul 21:23
Favicon

MCSim model

I am trying to interpret a model that someone else wrote.  There is a series of parameters that start with “V_” and “M_” underscore in the code.  I know that the ones starting with “V_” are used to define the variances for the given parameters and are used in distribution definitions.  The ones starting with “M_” are not used anywhere (i.e., not in the input files) other than in the code where they are set to a value of 1.  Could you possible tell me what these parameters might represent and how they would be expected to be used (i.e., in distribution definitions)?  Thanks!

 

Tammie Covington

(318) 251-6974

tcovington <at> environcorp.com

 

_______________________________________________
Help-mcsim mailing list
Help-mcsim <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-mcsim
Frédéric BOIS | 2 Jul 08:11
Picon
Favicon

Rép. : MCSim model

There is no way to know waht was their intended purpose if they are not
used in the 
model file or input file. M_ (or V_) have no special conventional
meaning and you can name
your parameters the way you want.

F. Bois

==========================
Frederic Y. Bois,
Unite de Toxicologie Experimentale, responsable
INERIS
Parc ALATA, BP 2
5, rue Taffanel
60550 Verneuil en Halatte
FRANCE
tel: + 33 (0)3 44 55 65 96
fax: + 33 (0)3 44 55 66 05
email: frederic.bois <at> ineris.fr
web: http://www.ineris.fr, http://toxi.ineris.fr

>>> "Tammie Covington" <TCovington <at> environcorp.com> jeudi 1 juillet
2004 21:23:36 >>>
I am trying to interpret a model that someone else wrote.  There is a
series of parameters that start with "V_" and "M_" underscore in the
code.  I know that the ones starting with "V_" are used to define the
variances for the given parameters and are used in distribution
definitions.  The ones starting with "M_" are not used anywhere (i.e.,
not in the input files) other than in the code where they are set to a
value of 1.  Could you possible tell me what these parameters might
represent and how they would be expected to be used (i.e., in
distribution definitions)?  Thanks!

Tammie Covington

(318) 251-6974

tcovington <at> environcorp.com 
Eric Hack | 15 Jul 14:54
Picon
Favicon

MCSim beta version documentation

Dear group,

First, does anyone have the latest version of the beta version documentation 
that has been translated from texinfo to html?  How about PDF, postscript, 
or other formats?

Secondly, I think I downloaded version 5 beta, but I see that the latest is 
version 5 beta 2.  Is this an updated beta?  If so, what is new?

Thanks,
Eric

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Eric Hack | 20 Jul 20:37

translating a model into MCSim

Dear Frederic,

 

I want to translate a model to MCSim and have a couple of questions.  The model is a discrete-time model and the data are time (duration) of exposure, outcome (tumor or no), and frequency at many time points and exposure levels.  The model incorporates an ad hoc likelihood function which was being used to obtain MLEs for the parameters.

 

Can a user-defined likelihood function be easily implemented in MCSim?

 

There are also several logical constructs that I think may be difficult to translate to MCSim.  The code includes many if-then-else blocks, do loops, goto statements, and scheduled code blocks (to run at specific value of independent variable).  I think all of the do loops and goto statements facilitate array operations, so I should be able to use vector indexing, right?  Can the if-then-else blocks be coded in the model definition file, or should I code these into the model.c file after the translation by mod?

 

Thank you,

Eric

 

C. Eric Hack

Toxicology Excellence for Risk Assessment (TERA)

2300 Montana Avenue

Suite 409

Cincinnati, OH 45211

(513) 542 7475 x 19

 

 

_______________________________________________
Help-mcsim mailing list
Help-mcsim <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-mcsim
Frédéric BOIS | 22 Jul 10:24
Picon
Favicon

Rép. : Help-mcsim Digest, Vol 15, Issue 10

Hi !

Let see: 

- The latest version of the doc, with pdf etc. is attached. Your Unix
system should be able to
  automatically create the pdf ps etc from the texinfo file (that's
precribed in the makefile, but
  it may not work if you do not have the translation tools).

- The difference between v5beta and v5beta2 were minor and cosmetic.
See the MCSim-changelog 
  in the doc section for important changes. 

- Can a user-defined likelihood function be easily implemented in
MCSim? : it depends what you want to
  do with it. Assume you want the likelihood for one data point. You
should be able to represent your data
  as an input function, taking the observed value at a prescribed
observation time. Then the likelihood
  should be representable as a standard function of the parameters,
state and output variables and that data.
  Now if you want to compute the total likelihood for a dataset you
have to find a way to (say) form the product
  of individual datapoints likelihood. To do that you can setup an
output variable to act as an accumulator:
  this_point-like = f(params, this_data)
  total_like = total_like * this_point-like
  Just make sure that it behave correctly. That should be easy for
discrete-time sims. For integration it's more difficult
  because Calc-Deriv (the "model") may be called several times within
an integration step and the product would be formed
  too often (to avoid that I tend to use control input function of the
Spikes form).
  An alternative is to code the product in the "yourcode.c" file. The
TransformPred function is called after a Monte Carlo
  simulation and can be used for that. If you are not using MC
simulations you may need to add calls to TransformPred
  elsewhere in the program.

- I should be able to use vector indexing, right? : yes.

- Some If-then-else blocks can be implemented using the ( ? : )
construct. An alternative
  is the create a baseline model.c file and then change it manually
(it's written in C).
 Just make sure you keep a copy so that mod doesn't overwrite it at the
next compilation.

I hope this helps.

Best regards.

Frederic

==========================
Frederic Y. Bois,
Unite de Toxicologie Experimentale, responsable
INERIS
Parc ALATA, BP 2
5, rue Taffanel
60550 Verneuil en Halatte
FRANCE
tel: + 33 (0)3 44 55 65 96
fax: + 33 (0)3 44 55 66 05
email: frederic.bois <at> ineris.fr
web: http://www.ineris.fr, http://toxi.ineris.fr

>>> help-mcsim-request <at> gnu.org Mercredi 21 Juillet 2004 18:05:10 >>>

Message: 1
Date: Thu, 15 Jul 2004 07:54:38 -0500
From: "Eric Hack" <kcahcire <at> msn.com>
Subject: MCSim beta version documentation
To: help-mcsim <at> gnu.org 
Message-ID: <BAY4-F18KUUVbbpKlkj0001219f <at> hotmail.com>
Content-Type: text/plain; format=flowed

Dear group,

First, does anyone have the latest version of the beta version
documentation 
that has been translated from texinfo to html?  How about PDF,
postscript, 
or other formats?

Secondly, I think I downloaded version 5 beta, but I see that the
latest is 
version 5 beta 2.  Is this an updated beta?  If so, what is new?

Thanks,
Eric

Message: 2
Date: Tue, 20 Jul 2004 14:37:42 -0400
From: "Eric Hack" <hack <at> tera.org>
Subject: translating a model into MCSim
To: <frederic.bois <at> Ineris.fr>
Cc: help-mcsim <at> gnu.org 
Message-ID:
	<ABEC59A68A73FA4F9C93E89B308F14CE299237 <at> TERAS0002.tera.org>
Content-Type: text/plain; charset="us-ascii"

Dear Frederic,

I want to translate a model to MCSim and have a couple of questions.
The model is a discrete-time model and the data are time (duration) of
exposure, outcome (tumor or no), and frequency at many time points and
exposure levels.  The model incorporates an ad hoc likelihood function
which was being used to obtain MLEs for the parameters.

Can a user-defined likelihood function be easily implemented in MCSim?

There are also several logical constructs that I think may be
difficult
to translate to MCSim.  The code includes many if-then-else blocks, do
loops, goto statements, and scheduled code blocks (to run at specific
value of independent variable).  I think all of the do loops and goto
statements facilitate array operations, so I should be able to use
vector indexing, right?  Can the if-then-else blocks be coded in the
model definition file, or should I code these into the model.c file
after the translation by mod?

Thank you,

Eric

 
C. Eric Hack

Toxicology Excellence for Risk Assessment (TERA)
2300 Montana Avenue
Suite 409
Cincinnati, OH 45211
(513) 542 7475 x 19

Attachment (doc.tar.gz): application/x-gzip, 641 KiB
_______________________________________________
Help-mcsim mailing list
Help-mcsim <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-mcsim
Eric Hack | 27 Jul 22:08

MCMC with user-defined LnLike

Hi

Thanks for the documentation.  I did not have the proper translation tools.

In an earlier message, I asked:
- Can a user-defined likelihood function be easily implemented in
MCSim?
You wrote:
it depends what you want to
  do with it. Assume you want the likelihood for one data point. You
should be able to represent your data
  as an input function, taking the observed value at a prescribed
observation time. Then the likelihood
  should be representable as a standard function of the parameters,
state and output variables and that data.
  Now if you want to compute the total likelihood for a dataset you
have to find a way to (say) form the product
  of individual datapoints likelihood. To do that you can setup an
output variable to act as an accumulator:
  this_point-like = f(params, this_data)
  total_like = total_like * this_point-like
  Just make sure that it behave correctly. That should be easy for
discrete-time sims. For integration it's more difficult
  because Calc-Deriv (the "model") may be called several times within
an integration step and the product would be formed
  too often (to avoid that I tend to use control input function of the
Spikes form).
  An alternative is to code the product in the "yourcode.c" file. The
TransformPred function is called after a Monte Carlo
  simulation and can be used for that. If you are not using MC
simulations you may need to add calls to TransformPred
  elsewhere in the program.

Thanks for these helpful tips.  The accumulator was part of the question.

I am also wondering if this likelihood function can be used in MCMC simulations?  I have looked briefly at a
paper describing this model, and I think it is essentially the MVK 2-stage clonal growth cancer model.  The
likelihood contribution is different for survivors, fatal tumors, and incidental tumors.  I believe
that the contributions work out as follows:
 S(t)=exp(-H(t)) for the survivors,
 h(t)S(t) for the fatal tumors, and
 S(t)F(t) for the incidental tumors, 
 where S(t) is the survival function, H(t) is the cumulative hazard function, h(t) is the instantaneous
hazard, and F(t) is the cumulative probability of a malignant transformation.  Each type of contribution
is based on H(t), a function of the number of 2nd stage mutations.

Is there an easy way to set this model up in MCSim to do MCMC analysis of the data?  My first guess was to modify
the LnLikeData, or add a user distribution to LnDensity and put the function in 'yourcode.c' or wherever
the other likelihoods are calculated.  The thing about adding a distribution to LnDensity is that I did not
know if 'mod' would let me get away with an unknown distribution name.  Can I add it to a list of keywords someplace?

You may be aware of more appropriate distributions that I have not thought of for these data, so any
suggestions are welcome.

Thanks again,
Eric

 
C. Eric Hack

Toxicology Excellence for Risk Assessment (TERA)
2300 Montana Avenue
Suite 409
Cincinnati, OH 45211
(513) 542 7475 x 19

Gmane