# Simulating an ODE model with non-constant parameter

I have a model, I can formulate the model using ordinary differential equation with parameter $P$. I want to simulate the model, but instead of using a fixed constant $P$ for the parameter, I want to force that the parameter $P$ is normally distributed. Can I do this ?

NB: I can also run a Gillespie Algorithm for my mode, but can I use a non-constant rate for my parameter ?

Thanks...

There is many way to introduce uncertainty of the parameters in a ordinary differential equation (ode) corresponding to different physical interpretation.

First example : Your parameter $P$ is theoricaly fix but the measure of this parameter came from a statistical study that shows that the estimator of $P$ : $\hat P \tilde\ \mathcal N$.

In this case you can sample $P$ in its law and do as much ode resolution as the number of sample.

In R code :

# Your ode
x0 = ..
nu = ..
a = ..

n = 100 # number of sample
P  = rnorm(n,p_theo=0,p_sd=1)

out = as.list(1:n)
for( i in 1:n)
{
params = list(P=P[i],..)
out[[i]] <- out <- ssa(x0,a,nu,params,tf=100,simName="My model")
}


Then you will have $n$ different trajectories in out that represent all the possible trajectories of your model.

Second example : Your parameter $P$ is theoricaly random : it can depend on complex biological aspect of an individual in an epidemiological study, it can depend on the humitity level (respiratory diseases)... Here you can randomly chose your parameter $P$ at each step of your ode resolution.

With gillespieSSA you can call the iteration time of the algorithm with : .t

# Your ode
x0 = ..
nu = ..
a = c('P(.t)*...',...)
params = ...