Dear List,


 I have some doubts regarding the model fitting and parameter optimization.


 Herewith am sending you a small reproducible code for the modeling and
parameter fitting using modFit function of FME package.



   1.

   after using the modFit function, I will get the optimized parameter
   values for “a” , “b”, “c” and those values of-course depends on the initial
   state values? So how would I get the best initial values for my state
   variables suppose in this case “X” ?
   2.

   second doubt is, how can I fit a discrete data sets to a continuous ode
   model?


 I tried to find the solution and also read the manual of FME but couldn't
find any promising answer. Please let me know your experiences with such
issues.


 Thanking you all in advance.

Looking forward for your replies. :)

Kind Regards,

Himanshu

here's the small reproducible code:

#######################################################

Lorenz<-function(t, state, parameters) {

 with(as.list(c(state, parameters)),{

dX <- a*X + Y*Z

dY <- b * (Y-Z)

dZ <- -X*Y + c*Y - Z

list(c(dX, dY, dZ))

})

}

 state<- c(X=0.5,Y=0.2,Z=0.6)

t <- seq(0,10,by=0.01)

pars<- c(a=0.3, b=0.4, c=0.8)


 out <- ode(y = state, func = Lorenz, parms = pars, times = t)

 obs<- data.frame(

names= rep("X",5),

time = 0:4,

X= c(0.00,0.03,0.20,0.40,1.00)

)

 Cost<- function(p) {

out <- ode(y = state, func = Lorenz, parms = p, times = obs$time)

return(modCost(obs = obs, model = out, y = "X", cost = NULL))

}

 fit<- modFit(f=Cost,p=pars)

-- 
With Regards:
Himanshu
email: bioinfo.himanshu@gmail.com

P.S: All good things come to those who wait..!!

	[[alternative HTML version deleted]]

