This site is to serve as my note-book and to effectively communicate with my students and collaborators. Every now and then, a blog may be of interest to other researchers or teachers. Views in this blog are my own. All rights of research results and findings on this blog are reserved. See also http://youtube.com/c/hongqin @hongqin
Sunday, October 6, 2013
Handess is not determinded by genetics, good topic for student critiques
A general definition of failure intensity function
It starts with a discrete definition, and then extend to continuous time. $\bar{F(x)}= 1 - F(X)$ is the survival function.
http://132.187.98.10:8080/encyclopedia/en/failureIntensityfunction.pdf
Saturday, October 5, 2013
mixture models, pdf, CDF, and intensity functions, GG01, GG91, !!!!!!!!!!
Mixture models frequently are applied to the probability density function, not the cumulative functions. But, based on wikipedia entry on "mixture density" , mixture can be defined in both pdf and CDF, and it seems to interchangeable. In fact, this is quit natural, because mixture is a linear form. Derivative of linear combinations of CDFs lead to linear combinations of pdfs.
GG01 applied binomial formula to the mortality rate functions, not the viability functions. GG91 used the same approach, page 258-261, section 6.6.
What would happen if we apply binomial formula to the survival functions? Interestingly, GG91 page 265-266, section 6.7, applied binomial formula to the failure CDF function, $F(x)$ in GG01. So, proof changed from GG91 to GG01.
The failure CDF for binomial active change of $q$ of $n$ elements is:
$ F(x) = (1- q exp(-kx))^n $,
which is a pleasantly clean form.
In contrast, Witten85 applied weights to the reliability (viability) function, though his formulation of the Gompertz model did not use this approach.
The more that I compare GG91 and GG01, the more it looks like linear rules are the same between viability function and intensity functions (mortality rates). However, I have not been able to prove this myself. In fact, I found it otherwise, somehow.
Reference:
http://en.wikipedia.org/wiki/Mixture_density
Labels:
GG01,
GG91,
mixture,
network aging,
reliability,
star
auxotrophic effect, growth and CLS, modified BY4741 background (in progress)
Muelleder12 found auxotrophic marker influences growth and CLS in BY4741 background.
Yeast growth and aging seem to be quantified. I need to read the supporting info for the details.
http://www.sysbiol.cam.ac.uk/Muellederetalnbt2442.pdf
Yeast growth and aging seem to be quantified. I need to read the supporting info for the details.
http://www.sysbiol.cam.ac.uk/Muellederetalnbt2442.pdf
Useful Python tips (in progress)
-tt
sorted( x, reverse=T, key=len)
'hello:world'.split(":")
a = [(1,'b'), (2,'b'),(1,'a')]
sorted(a)
'aaa bbb ccc'.split() #default split is white spaces
(x,y) = (2, 3)
d = {}
d['a'] = 'alpha'
d['o'] = 'omega'
'o' in d
genetic_code = {
'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M',
'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T',
'AAC':'N', 'AAT':'N', 'AAA':'K', 'AAG':'K',
'AGC':'S', 'AGT':'S', 'AGA':'R', 'AGG':'R',
'CTA':'L', 'CTC':'L', 'CTG':'L', 'CTT':'L',
'CCA':'P', 'CCC':'P', 'CCG':'P', 'CCT':'P',
'CAC':'H', 'CAT':'H', 'CAA':'Q', 'CAG':'Q',
'CGA':'R', 'CGC':'R', 'CGG':'R', 'CGT':'R',
'GTA':'V', 'GTC':'V', 'GTG':'V', 'GTT':'V',
'GCA':'A', 'GCC':'A', 'GCG':'A', 'GCT':'A',
'GAC':'D', 'GAT':'D', 'GAA':'E', 'GAG':'E',
'GGA':'G', 'GGC':'G', 'GGG':'G', 'GGT':'G',
'TCA':'S', 'TCC':'S', 'TCG':'S', 'TCT':'S',
'TTC':'F', 'TTT':'F', 'TTA':'L', 'TTG':'L',
'TAC':'Y', 'TAT':'Y', 'TAA':'_', 'TAG':'_',
'TGC':'C', 'TGT':'C', 'TGA':'_', 'TGG':'W'}
f = open(filename, 'rV')
lines = f.readlines() #entire file to one list
OneString = f.read() #entire file to one string.
f.close()
import re
match_object = re.search(pattern, text)
match_object.group()
if match:
r'c\.'' #raw pattern
r':\w\w\w' #match 3 characters
r'\d+\s+\d+'
r'\w[\w.]*@[\w.]+' #for email addresses
re.findall()
sorted( x, reverse=T, key=len)
'hello:world'.split(":")
a = [(1,'b'), (2,'b'),(1,'a')]
sorted(a)
'aaa bbb ccc'.split() #default split is white spaces
(x,y) = (2, 3)
d = {}
d['a'] = 'alpha'
d['o'] = 'omega'
'o' in d
genetic_code = {
'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M',
'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T',
'AAC':'N', 'AAT':'N', 'AAA':'K', 'AAG':'K',
'AGC':'S', 'AGT':'S', 'AGA':'R', 'AGG':'R',
'CTA':'L', 'CTC':'L', 'CTG':'L', 'CTT':'L',
'CCA':'P', 'CCC':'P', 'CCG':'P', 'CCT':'P',
'CAC':'H', 'CAT':'H', 'CAA':'Q', 'CAG':'Q',
'CGA':'R', 'CGC':'R', 'CGG':'R', 'CGT':'R',
'GTA':'V', 'GTC':'V', 'GTG':'V', 'GTT':'V',
'GCA':'A', 'GCC':'A', 'GCG':'A', 'GCT':'A',
'GAC':'D', 'GAT':'D', 'GAA':'E', 'GAG':'E',
'GGA':'G', 'GGC':'G', 'GGG':'G', 'GGT':'G',
'TCA':'S', 'TCC':'S', 'TCG':'S', 'TCT':'S',
'TTC':'F', 'TTT':'F', 'TTA':'L', 'TTG':'L',
'TAC':'Y', 'TAT':'Y', 'TAA':'_', 'TAG':'_',
'TGC':'C', 'TGT':'C', 'TGA':'_', 'TGG':'W'}
f = open(filename, 'rV')
lines = f.readlines() #entire file to one list
OneString = f.read() #entire file to one string.
f.close()
import re
match_object = re.search(pattern, text)
match_object.group()
if match:
r'c\.'' #raw pattern
r':\w\w\w' #match 3 characters
r'\d+\s+\d+'
r'\w[\w.]*@[\w.]+' #for email addresses
re.findall()
Thursday, October 3, 2013
Notes on Expectation maximization, Brown University CS
From reference 1:
EM can be thought of as a deterministic version of Gibbs sampling. EM operates on the means or modes of unknown variables using expected sufficient statistics instead of sampling unknown variables as does Gibbs sampling. Both EM and Gibbs sampling are used for approximation with incomplete data. [1]
Define Q(theta | theta') as follows:
Q(theta | theta') = E[log p(x, y | theta) | theta', y]where x is the random variable and we are taking the expectation with respect to the probability density p(x | theta',y).
The EM algorithm works as follows
- 1. Set i to 0 and choose theta_i arbitrarily.
- 2. Compute Q(theta | theta_i) The E-step.
- 3. Choose theta_i+1 to maximize Q(theta | theta_i) The M-step.
- 4. If theta_i != theta_i+1, then set i to i+1 and return to Step 2.
Reference:
(1) http://cs.brown.edu/research/ai/dynamics/tutorial/Documents/ExpectationMaximization.html
Bacillus cell death and biofilm wrinkles, student research topic
http://www.ncbi.nlm.nih.gov/pubmed?term=Localized%20cell%20death%20focuses%20mechanical%20forces%20during%203D%20patterning%20in%20a%20biofilm
sytoX green is used to monitor cell death, image analysis
sytoX green is used to monitor cell death, image analysis
Changes of n, p, lambda and the Strehler-Mildvan correlation in yeast natural isolates
The red line is the observed lnR-G correlation in yeast natural isolates. Effect on R and G by changing n, p, and lambda are plotted in the background. Each continuous curve is colored by n.
##################################################
#######second simulation to improve the range
lambda_v = 1 / seq(200,600, by=100)
m = 1000 ; #1000 essential genes
n_v = seq(3,10,by=1); #each essential gene interacts with n non-essential genes
p_v = seq(0.5, 0.95, by=0.005) ; #the chance that each gene interaction is active at t=0
#c = 1 / (1 - (1-p)^n ) ; #for un-normalized simulation
#t0 = (1-p)/(lambda * p)
sim_names = c( "m", "n","p", "c","lambda", "R","G","t0", "t_median")
sim2 = t(rep(NA, length(sim_names)))
sim2 = data.frame(sim2)
names(sim2) = sim_names
for( lambda in lambda_v) {
for( n in n_v ){
for( p in p_v ) {
c = 1 / (1 - (1-p)^n )
t0 = (1-p)/(lambda * p)
G =lambda * (n-1) * p/(1-p)
R = c*m*n*(p*lambda)*(1-p)^(n-1)
t_median = log(1 + log(2)*G/R)/G
ret = c(m, n, p, c, lambda, R, G, t0, t_median)
sim2 = rbind(sim2, ret)
}
}
}
sim2.good = sim2[sim2$G<0.2 & sim2$G>0.05
& sim2$R<0.01 & sim2$R>1E-4, ]
sim2.good = sim2.good[sim2.good$t_median>20 & sim2.good$t_media < 50, ]
summary(sim2.good)
my.colors = c("red","green","blue","purple","brown","black","darkgreen")
model.sim2 = lm( log10(sim2.good$R) ~ sim2.good$G )
summary(model.sim2)
plot( log10(sim2.good$R) ~ sim2.good$G, col=my.colors[sim2.good$n - 3], pch=3 )
points( log10(tb$R0) ~ tb$G, pch=19, xlim=c(0.05, 0.19), ylim=c(-3, -2.1), col="red" )
title("p=0.007, Strehler-Mildvan, natural isolates")
text( tb$G*1.02, log10(tb$R0)*1.025, tb$strain)
model = lm(log10(tb$R0) ~ tb$G )
summary( model ) #p=0.007, strehler-mildvan correlation!
abline(model, col='red')
The above plot is conditioned on lambda=1/300. It makes that large n leads to smaller R and G. The dashed line care caused by change of p.
library(RColorBrewer);
#hmcol = colorRampPalette(brewer.pal(5,"RdBu"))(8);
hmcol = colorRampPalette(brewer.pal(3,"Blues"))(4);
#sim2.good = sim2[sim2$G<0.2 & sim2$G>0.05 & sim2$R<0.01 & sim2$R>1E-4, ]
sg2.lambda = sim2.good[sim2.good$lambda == 1/300 & sim2.good$n<=7, ]
#plot( log10(tb$R0) ~ tb$G, pch=19, xlim=c(0.05, 0.19), ylim=c(-3, -2.5), col="red" )
plot( log10(tb$R0) ~ tb$G, pch=19, ylim=c(-4,-2), xlim=c(0.05,0.2), col="red" )
#lines( log10(sg2.lambda$R) ~ sg2.lambda$G, col=my.colors[sg2.lambda$n - 3] )
for( n in unique(sg2.lambda$n)) {
#tmp = sg2.lambda[ sg2.lambda$n==n & sg2.lambda$t_median>20 & sg2.lambda$t_media < 50, , ]
tmp = sg2.lambda[ sg2.lambda$n==n , ]
lines( log10(tmp$R) ~ tmp$G, col=hmcol[n-3], lty=2 )
text(max(tmp$G, na.rm=T), log10(min(tmp$R, na.rm=T)), paste('n=',n))
}
title(paste("lambda=", "1/300"))
text( tb$G*1.02, log10(tb$R0)*1.025, tb$strain)
abline(model, col='red')
lambda = 1/350 is better than 1/300.
Strehler-Mildvan, s288c + Exg06 data, p=0.007
S288C is added to the natural isolates from QinEXG06.
#2013 Sep 30, Oct 1, Oct 3, add 's288c' into exg06 data
setwd("~/projects/jtb13")
rm( list = ls() );
list.files(, pattern="csv|tab")
s288c = read.csv("s288c.RG.csv")
# tb = read.table("summary.new.by.strain.csv", header=T, sep="\t"); #incomplete data
tb = read.table("061405.rls.for.publication.tab", header=T)
names(tb) = c("strain","sample_size","ARLS","RLS.sd","R0","R.sd", "G","G.sd")
tb$strain = as.character(tb$strain)
tb.original = tb;
tb[19,] = NA
tb$strain[19] = 'S288c'
tb[19, c("R0","G")] = t(c(s288c$V1[1],s288c$V2[1]))
tb$strain[grep('RM11', tb$strain)] = 'RM11'
plot( log10(tb$R0) ~ tb$G, pch=19 )
text( tb$G, log10(tb$R0), tb$strain)
tb = tb[-grep("BY4743", tb$strain), ]
tb = tb[-grep("PSY", tb$strain), ]
tb = tb[-grep("W303", tb$strain), ]
tb = tb[-grep("SK1", tb$strain), ]
model = lm(log10(tb$R0) ~ tb$G )
summary( model ) #p=0.007, strehler-mildvan correlation!
plot( log10(tb$R0) ~ tb$G, pch=19, xlim=c(0.06, 0.19), ylim=c(-3.6, -2), xlab='G',ylab='lnR' )
title("p=0.007, Strehler-Mildvan, natural isolates")
text( tb$G + 0.01*nchar(tb$strain)/4, log10(tb$R0)-0.1*nchar(tb$strain)/4, tb$strain, pos=3)
abline(model, col='red')
#2013 Sep 30, Oct 1, Oct 3, add 's288c' into exg06 data
setwd("~/projects/jtb13")
rm( list = ls() );
list.files(, pattern="csv|tab")
s288c = read.csv("s288c.RG.csv")
# tb = read.table("summary.new.by.strain.csv", header=T, sep="\t"); #incomplete data
tb = read.table("061405.rls.for.publication.tab", header=T)
names(tb) = c("strain","sample_size","ARLS","RLS.sd","R0","R.sd", "G","G.sd")
tb$strain = as.character(tb$strain)
tb.original = tb;
tb[19,] = NA
tb$strain[19] = 'S288c'
tb[19, c("R0","G")] = t(c(s288c$V1[1],s288c$V2[1]))
tb$strain[grep('RM11', tb$strain)] = 'RM11'
plot( log10(tb$R0) ~ tb$G, pch=19 )
text( tb$G, log10(tb$R0), tb$strain)
tb = tb[-grep("BY4743", tb$strain), ]
tb = tb[-grep("PSY", tb$strain), ]
tb = tb[-grep("W303", tb$strain), ]
tb = tb[-grep("SK1", tb$strain), ]
model = lm(log10(tb$R0) ~ tb$G )
summary( model ) #p=0.007, strehler-mildvan correlation!
plot( log10(tb$R0) ~ tb$G, pch=19, xlim=c(0.06, 0.19), ylim=c(-3.6, -2), xlab='G',ylab='lnR' )
title("p=0.007, Strehler-Mildvan, natural isolates")
text( tb$G + 0.01*nchar(tb$strain)/4, log10(tb$R0)-0.1*nchar(tb$strain)/4, tb$strain, pos=3)
abline(model, col='red')
Wednesday, October 2, 2013
Overlay of natural isolates with reliability simulations, draft
I want to see what range of $n$, $p$, $\lambda$ can explain the observed yeast natural isolates.
It seems n=5,6,7 with changes of p can cover the lnR-G scatter plots in Qin06EXG.
It seems n=5,6,7 with changes of p can cover the lnR-G scatter plots in Qin06EXG.
Tuesday, October 1, 2013
Colors() in R
colors();
> colors()
[1] "white" "aliceblue" "antiquewhite" "antiquewhite1"
[5] "antiquewhite2" "antiquewhite3" "antiquewhite4" "aquamarine"
[9] "aquamarine1" "aquamarine2" "aquamarine3" "aquamarine4"
[13] "azure" "azure1" "azure2" "azure3"
[17] "azure4" "beige" "bisque" "bisque1"
[21] "bisque2" "bisque3" "bisque4" "black"
[25] "blanchedalmond" "blue" "blue1" "blue2"
[29] "blue3" "blue4" "blueviolet" "brown"
[33] "brown1" "brown2" "brown3" "brown4"
[37] "burlywood" "burlywood1" "burlywood2" "burlywood3"
[41] "burlywood4" "cadetblue" "cadetblue1" "cadetblue2"
[45] "cadetblue3" "cadetblue4" "chartreuse" "chartreuse1"
[49] "chartreuse2" "chartreuse3" "chartreuse4" "chocolate"
[53] "chocolate1" "chocolate2" "chocolate3" "chocolate4"
[57] "coral" "coral1" "coral2" "coral3"
[61] "coral4" "cornflowerblue" "cornsilk" "cornsilk1"
[65] "cornsilk2" "cornsilk3" "cornsilk4" "cyan"
[69] "cyan1" "cyan2" "cyan3" "cyan4"
[73] "darkblue" "darkcyan" "darkgoldenrod" "darkgoldenrod1"
[77] "darkgoldenrod2" "darkgoldenrod3" "darkgoldenrod4" "darkgray"
[81] "darkgreen" "darkgrey" "darkkhaki" "darkmagenta"
[85] "darkolivegreen" "darkolivegreen1" "darkolivegreen2" "darkolivegreen3"
[89] "darkolivegreen4" "darkorange" "darkorange1" "darkorange2"
[93] "darkorange3" "darkorange4" "darkorchid" "darkorchid1"
[97] "darkorchid2" "darkorchid3" "darkorchid4" "darkred"
[101] "darksalmon" "darkseagreen" "darkseagreen1" "darkseagreen2"
[105] "darkseagreen3" "darkseagreen4" "darkslateblue" "darkslategray"
[109] "darkslategray1" "darkslategray2" "darkslategray3" "darkslategray4"
[113] "darkslategrey" "darkturquoise" "darkviolet" "deeppink"
[117] "deeppink1" "deeppink2" "deeppink3" "deeppink4"
[121] "deepskyblue" "deepskyblue1" "deepskyblue2" "deepskyblue3"
[125] "deepskyblue4" "dimgray" "dimgrey" "dodgerblue"
[129] "dodgerblue1" "dodgerblue2" "dodgerblue3" "dodgerblue4"
[133] "firebrick" "firebrick1" "firebrick2" "firebrick3"
[137] "firebrick4" "floralwhite" "forestgreen" "gainsboro"
[141] "ghostwhite" "gold" "gold1" "gold2"
[145] "gold3" "gold4" "goldenrod" "goldenrod1"
[149] "goldenrod2" "goldenrod3" "goldenrod4" "gray"
[153] "gray0" "gray1" "gray2" "gray3"
[157] "gray4" "gray5" "gray6" "gray7"
[161] "gray8" "gray9" "gray10" "gray11"
[165] "gray12" "gray13" "gray14" "gray15"
[169] "gray16" "gray17" "gray18" "gray19"
[173] "gray20" "gray21" "gray22" "gray23"
[177] "gray24" "gray25" "gray26" "gray27"
[181] "gray28" "gray29" "gray30" "gray31"
[185] "gray32" "gray33" "gray34" "gray35"
[189] "gray36" "gray37" "gray38" "gray39"
[193] "gray40" "gray41" "gray42" "gray43"
[197] "gray44" "gray45" "gray46" "gray47"
[201] "gray48" "gray49" "gray50" "gray51"
[205] "gray52" "gray53" "gray54" "gray55"
[209] "gray56" "gray57" "gray58" "gray59"
[213] "gray60" "gray61" "gray62" "gray63"
[217] "gray64" "gray65" "gray66" "gray67"
[221] "gray68" "gray69" "gray70" "gray71"
[225] "gray72" "gray73" "gray74" "gray75"
[229] "gray76" "gray77" "gray78" "gray79"
[233] "gray80" "gray81" "gray82" "gray83"
[237] "gray84" "gray85" "gray86" "gray87"
[241] "gray88" "gray89" "gray90" "gray91"
[245] "gray92" "gray93" "gray94" "gray95"
[249] "gray96" "gray97" "gray98" "gray99"
[253] "gray100" "green" "green1" "green2"
[257] "green3" "green4" "greenyellow" "grey"
[261] "grey0" "grey1" "grey2" "grey3"
[265] "grey4" "grey5" "grey6" "grey7"
[269] "grey8" "grey9" "grey10" "grey11"
[273] "grey12" "grey13" "grey14" "grey15"
[277] "grey16" "grey17" "grey18" "grey19"
[281] "grey20" "grey21" "grey22" "grey23"
[285] "grey24" "grey25" "grey26" "grey27"
[289] "grey28" "grey29" "grey30" "grey31"
[293] "grey32" "grey33" "grey34" "grey35"
[297] "grey36" "grey37" "grey38" "grey39"
[301] "grey40" "grey41" "grey42" "grey43"
[305] "grey44" "grey45" "grey46" "grey47"
[309] "grey48" "grey49" "grey50" "grey51"
[313] "grey52" "grey53" "grey54" "grey55"
[317] "grey56" "grey57" "grey58" "grey59"
[321] "grey60" "grey61" "grey62" "grey63"
[325] "grey64" "grey65" "grey66" "grey67"
[329] "grey68" "grey69" "grey70" "grey71"
[333] "grey72" "grey73" "grey74" "grey75"
[337] "grey76" "grey77" "grey78" "grey79"
[341] "grey80" "grey81" "grey82" "grey83"
[345] "grey84" "grey85" "grey86" "grey87"
[349] "grey88" "grey89" "grey90" "grey91"
[353] "grey92" "grey93" "grey94" "grey95"
[357] "grey96" "grey97" "grey98" "grey99"
[361] "grey100" "honeydew" "honeydew1" "honeydew2"
[365] "honeydew3" "honeydew4" "hotpink" "hotpink1"
[369] "hotpink2" "hotpink3" "hotpink4" "indianred"
[373] "indianred1" "indianred2" "indianred3" "indianred4"
[377] "ivory" "ivory1" "ivory2" "ivory3"
[381] "ivory4" "khaki" "khaki1" "khaki2"
[385] "khaki3" "khaki4" "lavender" "lavenderblush"
[389] "lavenderblush1" "lavenderblush2" "lavenderblush3" "lavenderblush4"
[393] "lawngreen" "lemonchiffon" "lemonchiffon1" "lemonchiffon2"
[397] "lemonchiffon3" "lemonchiffon4" "lightblue" "lightblue1"
[401] "lightblue2" "lightblue3" "lightblue4" "lightcoral"
[405] "lightcyan" "lightcyan1" "lightcyan2" "lightcyan3"
[409] "lightcyan4" "lightgoldenrod" "lightgoldenrod1" "lightgoldenrod2"
[413] "lightgoldenrod3" "lightgoldenrod4" "lightgoldenrodyellow" "lightgray"
[417] "lightgreen" "lightgrey" "lightpink" "lightpink1"
[421] "lightpink2" "lightpink3" "lightpink4" "lightsalmon"
[425] "lightsalmon1" "lightsalmon2" "lightsalmon3" "lightsalmon4"
[429] "lightseagreen" "lightskyblue" "lightskyblue1" "lightskyblue2"
[433] "lightskyblue3" "lightskyblue4" "lightslateblue" "lightslategray"
[437] "lightslategrey" "lightsteelblue" "lightsteelblue1" "lightsteelblue2"
[441] "lightsteelblue3" "lightsteelblue4" "lightyellow" "lightyellow1"
[445] "lightyellow2" "lightyellow3" "lightyellow4" "limegreen"
[449] "linen" "magenta" "magenta1" "magenta2"
[453] "magenta3" "magenta4" "maroon" "maroon1"
[457] "maroon2" "maroon3" "maroon4" "mediumaquamarine"
[461] "mediumblue" "mediumorchid" "mediumorchid1" "mediumorchid2"
[465] "mediumorchid3" "mediumorchid4" "mediumpurple" "mediumpurple1"
[469] "mediumpurple2" "mediumpurple3" "mediumpurple4" "mediumseagreen"
[473] "mediumslateblue" "mediumspringgreen" "mediumturquoise" "mediumvioletred"
[477] "midnightblue" "mintcream" "mistyrose" "mistyrose1"
[481] "mistyrose2" "mistyrose3" "mistyrose4" "moccasin"
[485] "navajowhite" "navajowhite1" "navajowhite2" "navajowhite3"
[489] "navajowhite4" "navy" "navyblue" "oldlace"
[493] "olivedrab" "olivedrab1" "olivedrab2" "olivedrab3"
[497] "olivedrab4" "orange" "orange1" "orange2"
[501] "orange3" "orange4" "orangered" "orangered1"
[505] "orangered2" "orangered3" "orangered4" "orchid"
[509] "orchid1" "orchid2" "orchid3" "orchid4"
[513] "palegoldenrod" "palegreen" "palegreen1" "palegreen2"
[517] "palegreen3" "palegreen4" "paleturquoise" "paleturquoise1"
[521] "paleturquoise2" "paleturquoise3" "paleturquoise4" "palevioletred"
[525] "palevioletred1" "palevioletred2" "palevioletred3" "palevioletred4"
[529] "papayawhip" "peachpuff" "peachpuff1" "peachpuff2"
[533] "peachpuff3" "peachpuff4" "peru" "pink"
[537] "pink1" "pink2" "pink3" "pink4"
[541] "plum" "plum1" "plum2" "plum3"
[545] "plum4" "powderblue" "purple" "purple1"
[549] "purple2" "purple3" "purple4" "red"
[553] "red1" "red2" "red3" "red4"
[557] "rosybrown" "rosybrown1" "rosybrown2" "rosybrown3"
[561] "rosybrown4" "royalblue" "royalblue1" "royalblue2"
[565] "royalblue3" "royalblue4" "saddlebrown" "salmon"
[569] "salmon1" "salmon2" "salmon3" "salmon4"
[573] "sandybrown" "seagreen" "seagreen1" "seagreen2"
[577] "seagreen3" "seagreen4" "seashell" "seashell1"
[581] "seashell2" "seashell3" "seashell4" "sienna"
[585] "sienna1" "sienna2" "sienna3" "sienna4"
[589] "skyblue" "skyblue1" "skyblue2" "skyblue3"
[593] "skyblue4" "slateblue" "slateblue1" "slateblue2"
[597] "slateblue3" "slateblue4" "slategray" "slategray1"
[601] "slategray2" "slategray3" "slategray4" "slategrey"
[605] "snow" "snow1" "snow2" "snow3"
[609] "snow4" "springgreen" "springgreen1" "springgreen2"
[613] "springgreen3" "springgreen4" "steelblue" "steelblue1"
[617] "steelblue2" "steelblue3" "steelblue4" "tan"
[621] "tan1" "tan2" "tan3" "tan4"
[625] "thistle" "thistle1" "thistle2" "thistle3"
[629] "thistle4" "tomato" "tomato1" "tomato2"
[633] "tomato3" "tomato4" "turquoise" "turquoise1"
[637] "turquoise2" "turquoise3" "turquoise4" "violet"
[641] "violetred" "violetred1" "violetred2" "violetred3"
[645] "violetred4" "wheat" "wheat1" "wheat2"
[649] "wheat3" "wheat4" "whitesmoke" "yellow"
[653] "yellow1" "yellow2" "yellow3" "yellow4"
[657] "yellowgreen"
> colors()
[1] "white" "aliceblue" "antiquewhite" "antiquewhite1"
[5] "antiquewhite2" "antiquewhite3" "antiquewhite4" "aquamarine"
[9] "aquamarine1" "aquamarine2" "aquamarine3" "aquamarine4"
[13] "azure" "azure1" "azure2" "azure3"
[17] "azure4" "beige" "bisque" "bisque1"
[21] "bisque2" "bisque3" "bisque4" "black"
[25] "blanchedalmond" "blue" "blue1" "blue2"
[29] "blue3" "blue4" "blueviolet" "brown"
[33] "brown1" "brown2" "brown3" "brown4"
[37] "burlywood" "burlywood1" "burlywood2" "burlywood3"
[41] "burlywood4" "cadetblue" "cadetblue1" "cadetblue2"
[45] "cadetblue3" "cadetblue4" "chartreuse" "chartreuse1"
[49] "chartreuse2" "chartreuse3" "chartreuse4" "chocolate"
[53] "chocolate1" "chocolate2" "chocolate3" "chocolate4"
[57] "coral" "coral1" "coral2" "coral3"
[61] "coral4" "cornflowerblue" "cornsilk" "cornsilk1"
[65] "cornsilk2" "cornsilk3" "cornsilk4" "cyan"
[69] "cyan1" "cyan2" "cyan3" "cyan4"
[73] "darkblue" "darkcyan" "darkgoldenrod" "darkgoldenrod1"
[77] "darkgoldenrod2" "darkgoldenrod3" "darkgoldenrod4" "darkgray"
[81] "darkgreen" "darkgrey" "darkkhaki" "darkmagenta"
[85] "darkolivegreen" "darkolivegreen1" "darkolivegreen2" "darkolivegreen3"
[89] "darkolivegreen4" "darkorange" "darkorange1" "darkorange2"
[93] "darkorange3" "darkorange4" "darkorchid" "darkorchid1"
[97] "darkorchid2" "darkorchid3" "darkorchid4" "darkred"
[101] "darksalmon" "darkseagreen" "darkseagreen1" "darkseagreen2"
[105] "darkseagreen3" "darkseagreen4" "darkslateblue" "darkslategray"
[109] "darkslategray1" "darkslategray2" "darkslategray3" "darkslategray4"
[113] "darkslategrey" "darkturquoise" "darkviolet" "deeppink"
[117] "deeppink1" "deeppink2" "deeppink3" "deeppink4"
[121] "deepskyblue" "deepskyblue1" "deepskyblue2" "deepskyblue3"
[125] "deepskyblue4" "dimgray" "dimgrey" "dodgerblue"
[129] "dodgerblue1" "dodgerblue2" "dodgerblue3" "dodgerblue4"
[133] "firebrick" "firebrick1" "firebrick2" "firebrick3"
[137] "firebrick4" "floralwhite" "forestgreen" "gainsboro"
[141] "ghostwhite" "gold" "gold1" "gold2"
[145] "gold3" "gold4" "goldenrod" "goldenrod1"
[149] "goldenrod2" "goldenrod3" "goldenrod4" "gray"
[153] "gray0" "gray1" "gray2" "gray3"
[157] "gray4" "gray5" "gray6" "gray7"
[161] "gray8" "gray9" "gray10" "gray11"
[165] "gray12" "gray13" "gray14" "gray15"
[169] "gray16" "gray17" "gray18" "gray19"
[173] "gray20" "gray21" "gray22" "gray23"
[177] "gray24" "gray25" "gray26" "gray27"
[181] "gray28" "gray29" "gray30" "gray31"
[185] "gray32" "gray33" "gray34" "gray35"
[189] "gray36" "gray37" "gray38" "gray39"
[193] "gray40" "gray41" "gray42" "gray43"
[197] "gray44" "gray45" "gray46" "gray47"
[201] "gray48" "gray49" "gray50" "gray51"
[205] "gray52" "gray53" "gray54" "gray55"
[209] "gray56" "gray57" "gray58" "gray59"
[213] "gray60" "gray61" "gray62" "gray63"
[217] "gray64" "gray65" "gray66" "gray67"
[221] "gray68" "gray69" "gray70" "gray71"
[225] "gray72" "gray73" "gray74" "gray75"
[229] "gray76" "gray77" "gray78" "gray79"
[233] "gray80" "gray81" "gray82" "gray83"
[237] "gray84" "gray85" "gray86" "gray87"
[241] "gray88" "gray89" "gray90" "gray91"
[245] "gray92" "gray93" "gray94" "gray95"
[249] "gray96" "gray97" "gray98" "gray99"
[253] "gray100" "green" "green1" "green2"
[257] "green3" "green4" "greenyellow" "grey"
[261] "grey0" "grey1" "grey2" "grey3"
[265] "grey4" "grey5" "grey6" "grey7"
[269] "grey8" "grey9" "grey10" "grey11"
[273] "grey12" "grey13" "grey14" "grey15"
[277] "grey16" "grey17" "grey18" "grey19"
[281] "grey20" "grey21" "grey22" "grey23"
[285] "grey24" "grey25" "grey26" "grey27"
[289] "grey28" "grey29" "grey30" "grey31"
[293] "grey32" "grey33" "grey34" "grey35"
[297] "grey36" "grey37" "grey38" "grey39"
[301] "grey40" "grey41" "grey42" "grey43"
[305] "grey44" "grey45" "grey46" "grey47"
[309] "grey48" "grey49" "grey50" "grey51"
[313] "grey52" "grey53" "grey54" "grey55"
[317] "grey56" "grey57" "grey58" "grey59"
[321] "grey60" "grey61" "grey62" "grey63"
[325] "grey64" "grey65" "grey66" "grey67"
[329] "grey68" "grey69" "grey70" "grey71"
[333] "grey72" "grey73" "grey74" "grey75"
[337] "grey76" "grey77" "grey78" "grey79"
[341] "grey80" "grey81" "grey82" "grey83"
[345] "grey84" "grey85" "grey86" "grey87"
[349] "grey88" "grey89" "grey90" "grey91"
[353] "grey92" "grey93" "grey94" "grey95"
[357] "grey96" "grey97" "grey98" "grey99"
[361] "grey100" "honeydew" "honeydew1" "honeydew2"
[365] "honeydew3" "honeydew4" "hotpink" "hotpink1"
[369] "hotpink2" "hotpink3" "hotpink4" "indianred"
[373] "indianred1" "indianred2" "indianred3" "indianred4"
[377] "ivory" "ivory1" "ivory2" "ivory3"
[381] "ivory4" "khaki" "khaki1" "khaki2"
[385] "khaki3" "khaki4" "lavender" "lavenderblush"
[389] "lavenderblush1" "lavenderblush2" "lavenderblush3" "lavenderblush4"
[393] "lawngreen" "lemonchiffon" "lemonchiffon1" "lemonchiffon2"
[397] "lemonchiffon3" "lemonchiffon4" "lightblue" "lightblue1"
[401] "lightblue2" "lightblue3" "lightblue4" "lightcoral"
[405] "lightcyan" "lightcyan1" "lightcyan2" "lightcyan3"
[409] "lightcyan4" "lightgoldenrod" "lightgoldenrod1" "lightgoldenrod2"
[413] "lightgoldenrod3" "lightgoldenrod4" "lightgoldenrodyellow" "lightgray"
[417] "lightgreen" "lightgrey" "lightpink" "lightpink1"
[421] "lightpink2" "lightpink3" "lightpink4" "lightsalmon"
[425] "lightsalmon1" "lightsalmon2" "lightsalmon3" "lightsalmon4"
[429] "lightseagreen" "lightskyblue" "lightskyblue1" "lightskyblue2"
[433] "lightskyblue3" "lightskyblue4" "lightslateblue" "lightslategray"
[437] "lightslategrey" "lightsteelblue" "lightsteelblue1" "lightsteelblue2"
[441] "lightsteelblue3" "lightsteelblue4" "lightyellow" "lightyellow1"
[445] "lightyellow2" "lightyellow3" "lightyellow4" "limegreen"
[449] "linen" "magenta" "magenta1" "magenta2"
[453] "magenta3" "magenta4" "maroon" "maroon1"
[457] "maroon2" "maroon3" "maroon4" "mediumaquamarine"
[461] "mediumblue" "mediumorchid" "mediumorchid1" "mediumorchid2"
[465] "mediumorchid3" "mediumorchid4" "mediumpurple" "mediumpurple1"
[469] "mediumpurple2" "mediumpurple3" "mediumpurple4" "mediumseagreen"
[473] "mediumslateblue" "mediumspringgreen" "mediumturquoise" "mediumvioletred"
[477] "midnightblue" "mintcream" "mistyrose" "mistyrose1"
[481] "mistyrose2" "mistyrose3" "mistyrose4" "moccasin"
[485] "navajowhite" "navajowhite1" "navajowhite2" "navajowhite3"
[489] "navajowhite4" "navy" "navyblue" "oldlace"
[493] "olivedrab" "olivedrab1" "olivedrab2" "olivedrab3"
[497] "olivedrab4" "orange" "orange1" "orange2"
[501] "orange3" "orange4" "orangered" "orangered1"
[505] "orangered2" "orangered3" "orangered4" "orchid"
[509] "orchid1" "orchid2" "orchid3" "orchid4"
[513] "palegoldenrod" "palegreen" "palegreen1" "palegreen2"
[517] "palegreen3" "palegreen4" "paleturquoise" "paleturquoise1"
[521] "paleturquoise2" "paleturquoise3" "paleturquoise4" "palevioletred"
[525] "palevioletred1" "palevioletred2" "palevioletred3" "palevioletred4"
[529] "papayawhip" "peachpuff" "peachpuff1" "peachpuff2"
[533] "peachpuff3" "peachpuff4" "peru" "pink"
[537] "pink1" "pink2" "pink3" "pink4"
[541] "plum" "plum1" "plum2" "plum3"
[545] "plum4" "powderblue" "purple" "purple1"
[549] "purple2" "purple3" "purple4" "red"
[553] "red1" "red2" "red3" "red4"
[557] "rosybrown" "rosybrown1" "rosybrown2" "rosybrown3"
[561] "rosybrown4" "royalblue" "royalblue1" "royalblue2"
[565] "royalblue3" "royalblue4" "saddlebrown" "salmon"
[569] "salmon1" "salmon2" "salmon3" "salmon4"
[573] "sandybrown" "seagreen" "seagreen1" "seagreen2"
[577] "seagreen3" "seagreen4" "seashell" "seashell1"
[581] "seashell2" "seashell3" "seashell4" "sienna"
[585] "sienna1" "sienna2" "sienna3" "sienna4"
[589] "skyblue" "skyblue1" "skyblue2" "skyblue3"
[593] "skyblue4" "slateblue" "slateblue1" "slateblue2"
[597] "slateblue3" "slateblue4" "slategray" "slategray1"
[601] "slategray2" "slategray3" "slategray4" "slategrey"
[605] "snow" "snow1" "snow2" "snow3"
[609] "snow4" "springgreen" "springgreen1" "springgreen2"
[613] "springgreen3" "springgreen4" "steelblue" "steelblue1"
[617] "steelblue2" "steelblue3" "steelblue4" "tan"
[621] "tan1" "tan2" "tan3" "tan4"
[625] "thistle" "thistle1" "thistle2" "thistle3"
[629] "thistle4" "tomato" "tomato1" "tomato2"
[633] "tomato3" "tomato4" "turquoise" "turquoise1"
[637] "turquoise2" "turquoise3" "turquoise4" "violet"
[641] "violetred" "violetred1" "violetred2" "violetred3"
[645] "violetred4" "wheat" "wheat1" "wheat2"
[649] "wheat3" "wheat4" "whitesmoke" "yellow"
[653] "yellow1" "yellow2" "yellow3" "yellow4"
[657] "yellowgreen"
R ~ p, network aging
#2013 Oct 1
setwd("~/projects/jtb13")
rm( list = ls() );
set.seed(2013)
lambda = 1 / 25
m = 10 ; #1000 essential genes
n = 2
p_v = seq(-10,10,by=0.01)
# R = cmnp lambda (1-p)^(n-1)
Rfun = function(m, n, p, lambda ) {
c = 1 / (1 - (1-p)^n ) #for un-normalized simulation, !!!! major bug fix 20131001
R = c*m*n*(p*lambda)*(1-p)^(n-1) }
R_v = Rfun(m, n, p_v, lambda )
plot( R_v ~ p_v )
Derivative of R with respect to p, when $c$ is a constant
\begin{align}
\frac{dR}{dp} = cmn\lambda(1-p)^{n-1} + cmnp\lambda (n-1) (1-p)^{n-2}
\end{align}
When $c$ is treated as a constant, the mode is p = 1/n. Hence, when np>1, R decreases as p increases.
The above inference does not consider that the normalization parameter $c$ also depends on $p$.
2013 Oct 3: $c$ is actually very close to 1 in most simulations. So, $c$ can be considered as a constant in most cases. Besides, mode p=1/n clearly makes intuitive sense.
Subscribe to:
Posts (Atom)










