-
Posts
8639 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by ecoli
-
if salary is related to the demand of labor, then judging by salaries in the sciences I'd say no.
-
correction... it would work given an arbitrary number of numeric symbols to pick from.
-
Although loops in R are much less efficient I believe my function is generalizable to any base, just replace the 3's with the desired base (or a replace with a variable for user input)
-
A solution written in R convert.ternary <- function(int) { unit.factor <- 1 mult.factor <- 1 total <- 0 ternary <- 0 while (mult.factor <= int) { temp <- trunc((int-total)/mult.factor) %% 3 total <- total + temp ternary <- ternary + (temp * unit.factor) unit.factor <- unit.factor * 10 mult.factor <- mult.factor * 3 } return(ternary) }
-
hint - a di-deoxy primer prevents elongation
-
Firefly... oh yeah
-
Does Progress Hamper The Economy Or Is It The Other Way Around?
ecoli replied to Phi for All's topic in Politics
That's a fair point, but doesn't necessarily prove that subsidies will scale. For example, if more subsidies increases the scope of solar manufacturing in the US, it doesn't necessarily follow that labor costs would scale the same way they would in China (or wherever). Aside: I'm all for ending oil subsidies, as you may know. Forgot another potential aspect to this: if by "maintaining the economy" you mean a stable/ no net-growth economy, this could lower the standard of living/employment/etc if it means GDP per capita falls. -
For #1 - try setting both parts (in paranthesis) equal to zero and solve for x. Sometimes, there's more than 1 value of x which satisfies an equation.
-
If it's not on NCBI, than maybe it hasn't been fully sequences yet. You can try: http://www.plantgdb.org/ What's the scientific name?
-
I recommend a command line program (such as R or S) to increase your computational power. However, if you just want a graphing feature that beats excel, I've used Prism and thought it was a step up (it's not free)
-
If you integrate over total lifetime happiness, you're more likely to have more happiness in your life if you live forever. OTOH, you don't get much utility from not being alive.
-
Does Progress Hamper The Economy Or Is It The Other Way Around?
ecoli replied to Phi for All's topic in Politics
But on the other hand, regulators don't really do a better job than the market at directing efficiency. Gov't subsidies aren't really helping American photo-voltaic manufacturers. Though I suppose this has somewhat do with labor costs in the US (which you can also think of as an efficiency problem... it's simply not efficient to have some types of jobs here). -
I've heard that you should drain a battery fully before re-charging. Also, don't run the computer while re-charging, and then recharge to full battery. If you're running low on battery and don't have a spare, take the battery out and just run off of AC (with no battery). Anyone want to confirm that this is the way to do it?
-
The benefit is, if you have a JVM, the bytecode will work universally on any machine. For languages without a interpreter (like C++), you have to compile the source code into a machine language, which aren't generally aren't compatible between different types of machines. Especially back in the old days, if you wanted to run a C++ script on a PC or a Mac, you'd have to recompile the source code on the new machine. With Java, once you compile the source into bytecode, it'll work on any machine (with a JVM).
-
Need help with code (to calculate mutual information)
ecoli replied to ecoli's topic in Homework Help
link? edit: sorry. I'm an idiot. you meant your SFN blog. -
Need help with code (to calculate mutual information)
ecoli replied to ecoli's topic in Homework Help
Yeah but you are right that he's estimating the probability distribution differently because he's using a histogram (fixed that problem, btw, my data points are being split up into equal bins now). That assumption probably won't work with real data though. -
Need help with code (to calculate mutual information)
ecoli replied to ecoli's topic in Homework Help
Ahh. damn I see what's going on a bit better now, and rebinning into equal portions definitely helped. -
Need help with code (to calculate mutual information)
ecoli replied to ecoli's topic in Homework Help
sorry i think we crossposted, but this just doesn't seem like what's going on in equation 17. He's taken N out of each k term, but adds it into the MI calculation separately. -
Need help with code (to calculate mutual information)
ecoli replied to ecoli's topic in Homework Help
Then is equation 17 in the paper incorrect? -
Need help with code (to calculate mutual information)
ecoli replied to ecoli's topic in Homework Help
ah shit. I hope this is the major problem I've been having. I'm looking for an easy solution in R to cut a vector into equal bins. Histogram does it, but only to plot data. weird. -
Need help with code (to calculate mutual information)
ecoli replied to ecoli's topic in Homework Help
http://bioinformatics.oxfordjournals.org/content/18/suppl_2/S231.full.pdf I'm not sure that it matters the bins are not formed the same. For example if your comparing two lists of different types the only thing that should matter is the probability distribution, not the exact numbers. In R, the cut function creates a list that looks something that replaces an exact number with a range, like (0.43,0.616], which is not numeric type. I can create a frequency table that counts how many times each range is present in the list. I have to do a character match to find the associated frequency. in the table, which I think is the marginal distribution (divided by N). The probability of the intersection is the frequency that both ranges appear at the same time in both lists. Unless I've misunderstood. Thanks a bunch for your help so far, btw. -
Personally, I wouldn't drink Corona at any temperature, but probably as cold as possible to numb you tastebuds. Wait, what was the question? ...
-
Need help with code (to calculate mutual information)
ecoli replied to ecoli's topic in Homework Help
So it's because i'm taking a log of a fraction < 1, which I guess means i'm doing the calculation incorrectly. -
Hi all, I'm writing this code in R and it should be relative straight forward, but I keep running into negative numbers, which MI should NOT have! Not sure if the code is buggy or if I'm getting the math wrong. Am I correct in thinking there should be 1 value for MI between each number in an associated list? First the pseudocode: 1 initialize parameters 2 Generate 2 lists of random numbers btw 0,1 called x and y 3 cut number list into bins 4 create frequency table for number of counts in each bin 5 create function to calculate marginal distribution of binned x for every x find the frequency of that value in x save as ki Do the same for y and call it kj 6 create function to calculate joint distribution of x and y a. generate frequency table for every x and y combo for every x and associated y find the frequency of that combination in the data call it kij 7 calculate mutual information (mi) mi = 0 for each value taken by x { sum = 0 for each value taken by y: { kij = find freq where x and y are associated ki = find freq of x kj = find freq of y sum = sum + kij * log2(kij/(ki*kj)) } mi = mi + sum } Here's the actual code in R [font="Courier New"]#calculate MI of random variables. Notation is taken from Steuer, et al. 2002 #Set sample size & bin number N <- 30 bins <- 2 #Generate N random "data" points for x and y in the space [0,1] x <- runif(N, 0, 1) y <- runif(N, 0, 1) #Cut x and y into bins xcut <- cut(x, bins) #ai ycut <- cut(y, bins) #bj #create frequency table for counts per bin xfreq <- data.frame(table(xcut)) #table for kis yfreq <- data.frame(table(ycut)) #table for kjs #script for reading freq table into kis/kjs #b/c cutting data into bins leads to weird character types ki.find <- function(n) { #### n <- xcut[i] for (k in 1:bins) { if (as.character(n) == xfreq$xcut[k]) { ki <- xfreq$Freq[k] return(ki) } } } kj.find <- function(m) { #### n <- ycut[i] for (l in 1:bins) { if (as.character(m) == yfreq$ycut[l]) { kj <- yfreq$Freq[l] return(kj) } } } #kij is the joint prob distribution, #AKA freqency that 2 bins are associated at a (x,y) point cut.table <- as.data.frame(table(xcut,ycut)) kij.find <- function(p) { for (g in 1:(2*bins)) { if (as.character(xcut[p]) == cut.table$xcut[g] && as.character(ycut[p]) == cut.table$ycut[g]) { kij <- cut.table$Freq[g] } } return(kij) } #start with assumption of no MI #then calculate MI MI <- 0 for (i in 1:N) { sum.temp <- 0 for (j in 1:N) { ki <- ki.find(xcut[j]) kj <- kj.find(ycut[j]) kij <- kij.find(j) sum.temp <- sum.temp + (kij * log2((kij/(ki*kj)))) sum.temp2 <- (sum.temp/N) } MI <- c(MI, log2(N) + sum.temp2) } [/font] sample output is: > MI [1] 82.288187 44.607130 36.576861 28.348042 20.119224 11.890405 [7] 3.661586 -4.567232 -12.796051 -21.024870 -29.253688 Please help me!!!
-
Human biodivesity can be interesting to study pre-recorded history, evolution and genetic diseases. For all interested, I highly recommend following Razib Khan's blog: Gene Expression: http://blogs.discovermagazine.com/gnxp/ Isn't this a good argument for studying human biodiversity/genetics? So when ignorant racists try to make argue, we have real and complete science to point out the flaws?