I am trying to calibrate parameters in a probabilistic cost-effective model I built. The model is a discrete state-transition (Markov) model. Before building models in R, I used the software TreeAge Pro. There one could set the model to run using the distribution means for each parameter, instead of drawing random values from the distributions. This made it easy see how varying single input parameters affected certain outcome variables.
My model uses many different distribution draws with Beta, Gamma and Normal distributions (rbeta
, rgamma
, rnorm
). I would like to be able to set them to take their mean value using one command and setting them back to draw values with another. Does something like this exist?
E.g. the Beta distribution rbeta(1, 45, 55)
would then take the value 0.45, when it is called, as long as it is set to take the mean.
I tried temporarily replacing the rbeta(1,
, rgamma(1,
etc. and parts of the distributions with qbeta(0.5
and qgamma(0.5
but this does not give me the means. For qbeta(0.5, 45,55)
it gave me 0.4496653 instead of 0.45; for qbeta(0.5, 1,99)
it gave me 0.006977 instead of 0.01.
The question is if there is a function in R that tells all distributions that draw random values to return the mean instead of random values, thereby avoiding having to replace every single distribution manually with its mean value.
I appreciate any hint on how to set the distributions to take their mean values. Does anyone know of any package that would be able to help?