@@ -224,8 +224,7 @@ res60 <- forw.m(t = length(syn.input.60), input = syn.input.60, a = a, b = b, c
224224a <- MAP.a [1 ]
225225b <- MAP.b [1 ]
226226c <- MAP.c [1 ]
227- c / b
228-
227+ c / b # 0.2909254
229228a / b
230229# to change pool ratio, change c; to change flux ratio, change a
231230# flux.ratio <- a/b
@@ -255,7 +254,7 @@ reac.prog.tk <- reac.prog[101:length(reac.prog)]
255254lm.res.misha.2 <- lm(log(reac.prog.tk [200 : 800 ]) ~ c(200 : 800 ))
256255summary(lm.res.misha.2 )
257256lm.res.misha.2 $ coefficients [[1 ]] # intercept
258- lm.res.misha.2 $ coefficients [[2 ]] # slope
257+ lm.res.misha.2 $ coefficients [[2 ]] # slope lambda2
259258
260259exp(lm.res.misha.2 $ coefficients [[1 ]]) # f2
261260- 1 / lm.res.misha.2 $ coefficients [[2 ]]* log(2 ) # t1/2 = 330 days
@@ -270,7 +269,7 @@ plot(c(1:150),reac.prog.res1,ylab="residual: ln(1-F)",xlab="Days")
270269lm.res.misha.1 <- lm(reac.prog.res1 ~ c(1 : 150 ))
271270summary(lm.res.misha.1 )
272271lm.res.misha.1 $ coefficients [[1 ]] # intercept
273- lm.res.misha.1 $ coefficients [[2 ]] # slope
272+ lm.res.misha.1 $ coefficients [[2 ]] # slope lambda1
274273
275274exp(lm.res.misha.1 $ coefficients [[1 ]]) # f1 = 0.48
276275- 1 / lm.res.misha.1 $ coefficients [[2 ]]* log(2 ) # t1/2 = 20.5 days
@@ -281,13 +280,17 @@ exp(lm.res.misha.1$coefficients[[1]]) #f1 = 0.48
281280# f1/f2 ~= flux ratio
282281exp(lm.res.misha.1 $ coefficients [[1 ]])/ exp(lm.res.misha.2 $ coefficients [[1 ]])
283282
283+ # lambda1/(lambda2*f1*f2) ~= pool ratio
284+ lm.res.misha.2 $ coefficients [[2 ]]/ lm.res.misha.1 $ coefficients [[2 ]]/ exp(lm.res.misha.1 $ coefficients [[1 ]])/ exp(lm.res.misha.2 $ coefficients [[1 ]])
285+
284286# ################use a different ratio###################
285287# ###begin forward model####
286288# loading MAP estimates from posterior of the calibration
287289a <- 0.04
288290b <- MAP.b [1 ]
289291c <- MAP.c [1 ]
290292a / b
293+ c / b
291294# to change pool ratio, change c; to change flux ratio, change a
292295# flux.ratio <- a/b
293296# pool.ratio <- c/b
@@ -317,7 +320,7 @@ lm.res.frl.2 <- lm(log(reac.prog.frl.tk[200:800]) ~ c(200:800))
317320plot(1 : length(reac.prog.frl.tk ), log(reac.prog.frl.tk ),ylab = " ln(1-F)" ,xlab = " Days" ,main = " Slow turnover pool" )
318321summary(lm.res.frl.2 )
319322lm.res.frl.2 $ coefficients [[1 ]] # intercept
320- lm.res.frl.2 $ coefficients [[2 ]] # slope
323+ lm.res.frl.2 $ coefficients [[2 ]] # slope lambda2
321324
322325exp(lm.res.frl.2 $ coefficients [[1 ]]) # f2 = 0.2885
323326- 1 / lm.res.frl.2 $ coefficients [[2 ]]* log(2 ) # t1/2 = 271 days
@@ -331,7 +334,7 @@ plot(c(1:150),reac.prog.frl.res1,ylab="residual: ln(1-F)",xlab="Days")
331334lm.res.frl.1 <- lm(reac.prog.frl.res1 ~ c(1 : 150 ))
332335summary(lm.res.frl.1 )
333336lm.res.frl.1 $ coefficients [[1 ]] # intercept
334- lm.res.frl.1 $ coefficients [[2 ]] # slope
337+ lm.res.frl.1 $ coefficients [[2 ]] # slope lambda1
335338exp(lm.res.frl.1 $ coefficients [[1 ]]) # f1 = 0.711
336339- 1 / lm.res.frl.1 $ coefficients [[2 ]]* log(2 ) # t1/2 = 12.3 days
337340
@@ -340,3 +343,58 @@ exp(lm.res.frl.1$coefficients[[1]]) #f1 = 0.711
340343
341344# f1/f2 ~= flux ratio
342345exp(lm.res.frl.1 $ coefficients [[1 ]]) / exp(lm.res.frl.2 $ coefficients [[1 ]])
346+
347+ # lambda1/(lambda2*f1*f2) ~= pool ratio
348+ lm.res.frl.2 $ coefficients [[2 ]]/ lm.res.frl.1 $ coefficients [[2 ]]/ exp(lm.res.frl.1 $ coefficients [[1 ]])/ exp(lm.res.frl.2 $ coefficients [[1 ]])
349+ # #############use a different c #################
350+ a <- MAP.a [1 ]
351+ b <- MAP.b [1 ]
352+ c <- 0.001 # MAP.c = 0.0041
353+ c / b
354+
355+ # 2 number of days in the simulation
356+ t <- 900
357+
358+ # 3 generate input series with fixed duration#
359+ input.misha <- initiate.switch(t , n.switch = 1 , day.switch = 100 , a = 0.706 , gap = 0.005 , duration = 360 )
360+
361+ # 4 generate serum and bone series based on input series and turnover parameters#
362+ res <- forw.m(t = 900 , input = input.misha , a = a , b = b , c = c , R1.int = NULL , R2.int = NULL )
363+ res.prs <- res [[1 ]]
364+
365+ reac.prog.prs <- (0.711 - res.prs )/ (0.711 - 0.706 )
366+
367+ reac.prog.prs.tk <- reac.prog.prs [101 : length(reac.prog.prs )]
368+
369+ # after the inflection point: [200:800]
370+
371+ lm.res.prs.2 <- lm(log(reac.prog.prs.tk [200 : 800 ]) ~ c(200 : 800 ))
372+ plot(1 : length(reac.prog.prs.tk ), log(reac.prog.prs.tk ),ylab = " ln(1-F)" ,xlab = " Days" ,main = " Slow turnover pool" )
373+ summary(lm.res.prs.2 )
374+ lm.res.prs.2 $ coefficients [[1 ]] # intercept
375+ lm.res.prs.2 $ coefficients [[2 ]] # slope lambda2
376+
377+ exp(lm.res.prs.2 $ coefficients [[1 ]]) # f2 = 0.4700503
378+ - 1 / lm.res.prs.2 $ coefficients [[2 ]]* log(2 ) # t1/2 = 1284.937 days
379+
380+ # estimate of parameter c:
381+ - lm.res.prs.2 $ coefficients [[2 ]]/ (1 - exp(lm.res.prs.2 $ coefficients [[1 ]]))
382+
383+ # fit for pool 1
384+ reac.prog.prs.res1 <- log(reac.prog.prs.tk [1 : 150 ]- exp(1 : 150 * lm.res.prs.2 $ coefficients [[2 ]] + lm.res.prs.2 $ coefficients [[1 ]])) # first residual
385+ plot(c(1 : 150 ),reac.prog.prs.res1 ,ylab = " residual: ln(1-F)" ,xlab = " Days" )
386+ lm.res.prs.1 <- lm(reac.prog.prs.res1 ~ c(1 : 150 ))
387+ summary(lm.res.prs.1 )
388+ lm.res.prs.1 $ coefficients [[1 ]] # intercept
389+ lm.res.prs.1 $ coefficients [[2 ]] # slope lambda1
390+ exp(lm.res.prs.1 $ coefficients [[1 ]]) # f1 = 0.5343916
391+ - 1 / lm.res.prs.1 $ coefficients [[2 ]]* log(2 ) # t1/2 = 21.53086 days
392+
393+ # estimate of parameter a:
394+ - lm.res.prs.1 $ coefficients [[2 ]]* exp(lm.res.prs.1 $ coefficients [[1 ]])
395+
396+ # fin/f2 ~= flux ratio
397+ exp(lm.res.prs.1 $ coefficients [[1 ]]) / exp(lm.res.prs.2 $ coefficients [[1 ]])
398+
399+ # lambda1/(lambda2*f1*f2) ~= pool ratio
400+ lm.res.prs.2 $ coefficients [[2 ]]/ lm.res.prs.1 $ coefficients [[2 ]]/ exp(lm.res.prs.1 $ coefficients [[1 ]])/ exp(lm.res.prs.2 $ coefficients [[1 ]])
0 commit comments