Package-free solution [PK / PD]
Hi John,
Here's an offer of a quick and dirty package-free approach to yung-jin's dataset:
Here's an offer of a quick and dirty package-free approach to yung-jin's dataset:
Conc=function(D, K01, K10, V, t, tlag)
{
C = ((D*K01)/(V*(K01-K10))) * (exp(-K10*(t-tlag)) - exp(-K01*(t-tlag)))
return(C)
}
Cx=Conc(100, 1.67, 0.213, 10, 6, 0.5)
Cx ## this is the known!
##Let's assume we know D, K01, V, tlag
##We want to find a K10 that gives this result Cx at the given t.
K01_fubar=function(K01start, K01end, Gridsize)
{
tmpK01=K01start
hotK=K01start
minDiff=123456789e54321
d=(K01end-K01start)/Gridsize
for (i in 1:Gridsize)
{
if (abs(Cx-Conc(100, tmpK01, 0.213, 10, 6, 0.5))<minDiff)
{
minDiff=abs(Cx-Conc(100, tmpK01, 0.213, 10, 6, 0.5))
hotK=tmpK01
}
tmpK01=tmpK01+d
}
return(hotK)
}
Solution=K01_fubar(0.001, 10.0, 10000)
Solution
##want more decimals?? the interval above had a grid denisty of (10.0-0.001)/10000 so...
d=(10.0-0.001)/10000
Solution=K01_fubar(Solution-d, Solution+d, 10000)
Solution
—
Pass or fail!
ElMaestro
Pass or fail!
ElMaestro
Complete thread:
- 1 compartment model with lag time jag009 2013-07-17 15:58 [PK / PD]
- solve for k01? Helmut 2013-07-17 16:08
- solve for k01? jag009 2013-07-17 16:19
- solve for k01? ElMaestro 2013-07-17 17:09
- no closed form Helmut 2013-07-17 23:01
- solve for k01? jag009 2013-07-17 16:19
- 1 compartment model with lag time yjlee168 2013-07-17 20:57
- Package-free solutionElMaestro 2013-07-17 21:53
- Package-free solution yjlee168 2013-07-17 22:11
- Package-free solution ElMaestro 2013-07-17 22:27
- Package-free solution yjlee168 2013-07-17 22:42
- Package-free solution ElMaestro 2013-07-17 22:27
- Package-free solution ElMaestro 2013-07-17 23:21
- A new R-King was born d_labes 2013-07-18 08:45
- Brent ElMaestro 2013-07-18 09:07
- A new R-King was born yjlee168 2013-07-18 10:21
- OT: TTT in bear Helmut 2013-07-18 20:28
- OT: TTT in bear yjlee168 2013-07-18 22:17
- OT: TTT subtleties d_labes 2013-07-19 09:47
- OT: TTT subtleties yjlee168 2013-07-20 19:44
- OT: beyond TTT? Helmut 2013-07-21 00:08
- OT: beyond TTT? yjlee168 2013-07-22 13:45
- OT: keep TTT! Helmut 2013-07-22 14:21
- OT: keep TTT! yjlee168 2013-07-22 23:42
- OT: EOD (here) Helmut 2013-07-23 01:06
- OT: keep TTT! yjlee168 2013-07-22 23:42
- OT: keep TTT! Helmut 2013-07-22 14:21
- OT: beyond TTT? yjlee168 2013-07-22 13:45
- OT: beyond TTT? Helmut 2013-07-21 00:08
- OT: TTT subtleties yjlee168 2013-07-20 19:44
- OT: TTT subtleties d_labes 2013-07-19 09:47
- OT: TTT in bear yjlee168 2013-07-18 22:17
- OT: TTT in bear Helmut 2013-07-18 20:28
- Package-free solution yjlee168 2013-07-18 10:27
- Thank you guys! jag009 2013-07-18 16:37
- Thank you guys! ElMaestro 2013-07-18 18:57
- Thank you guys! jag009 2013-07-19 20:40
- Thank you guys! ElMaestro 2013-07-18 18:57
- Thank you guys! jag009 2013-07-18 16:37
- A new R-King was born d_labes 2013-07-18 08:45
- Package-free solution yjlee168 2013-07-17 22:11
- solve for k01? Helmut 2013-07-17 16:08