Jump to content


Photo

lagtime model diff equations


  • Please log in to reply
30 replies to this topic

#21 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 23 February 2013 - 11:58 PM

Emily: Many thanks; this is brilliant: there are 3 different optional models. As I understand it each model is independent of the other 2 models. The Savic model (from Sweden) does not pull information from the others. It is independent. Yes? It was originally for NONMEM. I have that program here, but I lost interest in it since it is too difficult to work with. { Diane Mould is an expert in that program}. I think you are involved in the Pharsight equivalent program.

Therefore you have written the code to accommodate all of the compartments of the original WinNonlin model into the Savic model. Immediately i do not see the code sections that allow all the lagtime compartments of the original model in WinNonlin. Should I be able to see that? You do not see the Savic model in the graphic form {like the other 2} and that is because you wrote it in text as the code
Yes?
Is it possible to write the Savic model in the graphical form?

I went back to my original WinNonlin model and ran it today. It is very good.

I think the Savic option may be the best fit and is as good as my original effort.


Angus
  • AlexKawn and RonaldAxon like this

#22 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 24 February 2013 - 09:24 PM

Emily: What I did today is that I compared the absorption LAG model you wrote in Phoenix equivalent to the DIFF Equation model I wrote in WinNonlin. The results were almost identical. The Savic transit model was interesting too, since it was also a good fit {but at some earlier points not so good better at later points}.

 

Then following Simon's direction I tried to perform a multiple dose simulation with the absorption LAG model. You do not have to write a loop. I did have difficulty in the sense that when switching over from SIMPLE to SIMULATION I found I had to delete the column of observations in order to get the model to run. So that we only have a columnar series of Time values. {Most probably you do not have to delete the obs column. There is a way of retaining them?}. I composed a dose Table withe multiple doses for the SIMULATION.

 

The multiple dose simulation ran . I was thinking I would have to copy the parameter values e.g. V, K10 over from the SIMPLE fitting to the PARAMETER table, but I did not do this. Only blank cells were there and the model ran OK. I found this odd, since it differs from WinNonlin.

The program must beholding the fitted values?

 

 

Angus



#23 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 25 February 2013 - 05:51 PM

Emily: From the LAGmodel, which you wrote I have said above is that I was able to perform a multiple dose stimulation by switching from SIMPLE to SIMULATION. { I did have difficulty yesterday} I then included 6 doses in the dosing Table. Ie One dose each day out 5 days (120 Hr). I made sure the units were OK ie. ng and hr.

 

I copied the fitted parameters from SIMPLE into a new parameters Table for the multiple dose simulation and checked the units were "numerical". For mapping I only used Time IN THE ORANGE CHECKBOX.. Now yesterday I had great difficulty getting the program to run the multiple dose simulation. Repeatedly I got the error message

 

"could not merge sort times.....some data that is expected to be numeric is not".

 

 

I checked the data again and saw that all data had appropriate units. After ~ 1 hour yesterday I did get the multiple dose simulation to run so I thought I had solved the problem.

 

Today after 3 hours I still have this problem.....it does not run and I get the same message.

 

It is confusing because once I get the program to run then it runs forever under any of the conditions I stipulate. It is just that when I try and repeat the process then the same problems reappears and I cannot rationalize it what I did to get the porgram to run.

 

Do you have any insight?

 

 

Angus



#24 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 25 February 2013 - 07:10 PM

Emily: Lag model: another way of putting is some of the time the multiple dose simulation works and some of the time it does not work. I do not follow the first part of the error message.."could not merge sort times"

I have checked that all of my data when numeric is set to "numeric" so do not think that applies to this problem.

Right now I am thinking that there is a precise sequence of events to follow and the program performs the multiple dose simulation well. On the other hand if you deviate from that sequence of events then the program produces that error message.

Angus

#25 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 25 February 2013 - 08:09 PM

EMILY: here is what I did to perform multiple dose simulation for Lag model:

 

(a) simple to simulation check box.

 

(B) #points 144, max time to 144 and check the box for simulations at time points.

check at column C

 

Made the new dosing Table and entered dose at 0. 24, 48, 72, 96 and 120: the corresponding does were all the same as the fitting dose 625000000 ng.

 

Entered the parameters from the fitting into parameter table. Finally mapped the the time to the orange checkbox only.

 

Ran program and it worked.

 

Repeated above and it did not work. Again another repeat ....it did not work.

 

Same error message as above.

 

So where do I go from here?

 

Angus



#26 Emily Colby

Emily Colby

    Advanced Member

  • Members
  • PipPipPip
  • 88 posts

Posted 25 February 2013 - 08:16 PM

Hi Angus,

 

Chances are you will need to set up a dose group variable and make it a Sort in the Main and Dosing sections. If you'll send the project I'll take a look at it. It should never take more than a few seconds or minutes to run a simulation. Cancel execution if it takes too long.

 

Emily



#27 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,318 posts

Posted 25 February 2013 - 09:43 PM

Angus,

the non-numeric /sort error message is most likely caused by a blank line in the supplide dosing data; Posted Image

to remove a line you will need to highlight it and then right-click and choose delete.

the reason in PHX you don't have to copy the estimates over to do simulation is that it will use the initial estimates, or if you 'accept all fixed..." you will see it takes the last runs final estimate and populates it back into the input Posted Image

Simon.

#28 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 25 February 2013 - 10:56 PM

Simon: Thanks, this is brilliant. I am telling you that some of the time the model runs and some of the time it does not run. Also I am telling you I am doing the same thing. Well not quite. I had thought that leaving blank line in the dose Table would not make a difference. I did think about it but rejected the idea that it could make a difference. You seed some of my efforts had a blank line at the bottom and some did not. Do not think it makes a difference in WinNonlin.

 

So you are correct .....that is the source of the problem.

 

Thank you for the direction about initial considerations that relate to multiple dosing. It is a common error people make in WinNonlin to use the initial estimates for a multiple dose simulation instead of substituting the final parameters from the fitting step.

 

Phoenix is more convenient for this then.

 

Angus



#29 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 25 February 2013 - 11:07 PM

Emily: Thanks.....think Simon has come across this before. He is familiar with WinNonlin so he probably knows the errors people like me will make.

 

I note with interest your reference to covariates, since I will be involved soon with different dose groups in terms of mg dosed and also different patient groups in terms of adults/adolescents/children.

 

Is there an example of Phoenix handling such data. I do not mean POP PK data just PK. The reason I ask is that it would be more convenient {and less error prone} to perform sorting in Phoenix rather than moving the data into Excel.

 

 

Angus



#30 Emily Colby

Emily Colby

    Advanced Member

  • Members
  • PipPipPip
  • 88 posts

Posted 27 February 2013 - 02:40 PM

Angus,

 

To answer your quesiton about using covariates in a non-population PK model, here is an example of using a covariate in a Phoenix model without population checked. In the example below, body weight is a covariate for Cl and V.

 

test(){

    covariate(wt) #this will open up a column in the Main Mappings panel for wt

    deriv(Aa = - Ka * Aa)

    deriv(A1 = Ka * Aa - Cl * C)

    dosepoint(Aa)

    C = A1 / V

    error(CEps = 1)

    observe(CObs = C + CEps)

    stparm(Ka = tvKa)

    stparm(V = tvV * (wt/70)^dVdwt) #here wt scales V

    stparm(Cl = tvCl * (wt/70)^dCldwt)

    fixef(tvKa = c(, 0.21, ))

    fixef(tvV = c(, 400000, ))

    fixef(tvCl = c(, 10, ))

    fixef(dVdwt = c(, 1, )) #intial estimate for the power

    fixef(dCldwt = c(, 0.75, ))

}

 

Alternatively you can type a number in place of ^dVdwt and ^dCldwt and delete the fixef() statements for those two effects if you know the number you want to scale by.

 

Also, Simon and I came up with some multiple dose simulations for the example we were looking at. They are in the attached project. Simon chose a dose at 0 hours and a dose at 48 hours. This worked fine for the lag time model and the 0/1st sequential model, but not for the Savic transit model as it is designed for single dosage. Hence, I refined the lag time model based on the results of the Savic transit model in order to perform the multiple dose simulation. Note that the number of transit compartments can be a non-integer, which I think equates to one of the compartments having a different rate. However, since the decimal was small, I chose to use a standard model with 13 absorption compartmens with equal rate constants.

 

Best regards,

Emily [file name=LagTime_01stSeq_SavicTransitPlusSIMS.phxproj size=2722476]http://www.pharsight.com/extranet/media/kunena/attachments/legacy/files/LagTime_01stSeq_SavicTransitPlusSIMS.phxproj[/file]



#31 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 28 February 2013 - 05:34 PM

Emily: Thank you for your advice: I will think about the covariate information you present and study the code with a view to understanding it and how to use it.

 

Regarding the mutliple dose simulation the lag compartment approach originally written in WinNonlin as a series of DIFF equations by me and then converted into Phoenix{graphically} by yourself works well in the multiple dose mode. The problem I had was I left a blank line in the dose Table at the end and this gives an error message that is not easy to interpret.

 

 

I am a little puzzled by the refinement presented with 13 compartments. In what way is it a refinement in terms of the result? Is it a better result?

 It does not run, since it gives an error message.....'tvKtr' already belongs to the Table. I am thinking that one too many kTr ' were put in?

 

 

Angus






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users