[R] How to find best parameter values using deSolve n optim() ?

mhimanshu bioinfo.himanshu at gmail.com
Mon Mar 26 16:43:46 CEST 2012


Hello,
Can someone please help me out with the optim() function.

# parameters 
pars<- c(a1= 0.9, a2= 0.7, a3= 0.06, a4=0.02)

y<- c(Y=0.2, Z=0.1)
Ymax<- c(0.8)
#### fucntion deriv
derivs <- function(time, y, pars) {

with (as.list(c(y, pars)), {
dy = a1*Y*(1-Y/Ymax) - a2*(Y+0.001) 
 dz = a3*Y- a4*Z; 
 return(list(c(dy, dz)))
 })
 }

 times <- c(seq(0, 10, 0.1))
 out <- ode(y = y, parms = pars, times = times, func = derivs)
 as.data.frame(out)

I have a set of 2 differential equations, and i want to find the best
parameter values for a1 & a2. 
I have an experimental data for dy so that I have to find the best values
for a1 & a2 according to the experimental values so that the observed values
for dy should come near to experimental dy values.

can someone please suggest me how to proceed further or may give their
opinion.

Thanks alot in advance..!!
Himanshu

--
View this message in context: http://r.789695.n4.nabble.com/How-to-find-best-parameter-values-using-deSolve-n-optim-tp4506042p4506042.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list