Jump to content


Photo

Sequence command to initialize a differential equa


  • Please log in to reply
2 replies to this topic

#1 Mike Walker

Mike Walker

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 13 February 2012 - 10:36 AM

Hi,

 

I’ve got a question about the sequence command when used with a differential equation model. In the model below I’m using the sequence command to set the initial condition of each individual to a value of 169 which is the mean value for each of my individuals at time zero, but I have a measured value for each individual.

 

What I would like to know is there a way I can set each individuals initial condition to their measured value either by entering each piece of data in or (preferably) reading it from the data?

 

Thanks,

 

Mike

 

 

 

test(){ deriv(TuV = (lam0 - (k2*C))*TuV)

    cfMicro(A1, Ke, first = (Aa = Ka))

    dosepoint(Aa)

    C = A1 / V

    sequence{TuV = 169}

    error(TuVEps = 1)

    observe(TuVObs = TuV * (1 + TuVEps))

    stparm(Ka = tvKa)

    stparm(V = tvV)

    stparm(Ke = tvKe)

    stparm(lam0 = tvlam0 * exp(nlam0))

    stparm(k2 = tvk2 * exp(nk2))

    fixef(tvKa(freeze) = c(, 0.2, ))

    fixef(tvV(freeze) = c(, 0.5, ))

    fixef(tvKe(freeze) = c(, 2, ))

    fixef(tvlam0 = c(0, 0.0009, ))

    fixef(tvk2 = c(0, 0.0005, ))

    ranef(diag(nlam0, nk2) = c(1, 1))

}



#2 Jason Chittenden

Jason Chittenden

    Member

  • Members
  • PipPip
  • 17 posts

Posted 13 February 2012 - 04:09 PM

Hi Mike,

 

 

There are two options:

1. Use the value as a covariate. Put the initial condition in the dataset in a new column (e.g. "TuV0"). You will only need to fill in each individuals value at time = 0, leaving the rest blank. Put a statement "covariate(TuV0)" in your model and modify the sequence statement to "sequence{TuV = TuV0}". This method assumes there is no error in your observation of the initial condition.

 

2. Let the algorithm solve for the starting point. Create a stparm for the initial condition and assign it in the sequence statement.

fixef(tvTuV0 = 169)

stparm(TuV0 = tvTuV0*exp(nTuV0))

sequence{TuV=TuV0}

ranef(nTuV0 = 1)

This method allows for observation error at the zero time.

 

Happy modeling,

-Jason



#3 Mike Walker

Mike Walker

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 14 February 2012 - 04:52 PM

Hi Jason,

 

I tried the second option and it works fine. Thanks for your help.

 

Mike






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users