English

ggplot2 Version of Figures in “25 Recipes for Getting Started with R”

August 16, 2011 |

In order to provide an option to compare graphs produced by basic internal plot function and ggplot2, I recreated the figures in the book, 25 Recipes for Getting Started with R, with ggplot2. The code used to create the images is in separate paragraphs, allowing easy comparison. Read More: 336 Words Totally [Read more...]

the batman equation

August 13, 2011 |

HardOCP has an image with an equation which apparently draws the Batman logo. Read More: 1295 Words Totally [Read more...]

ProjectEuler-Problem 46

June 21, 2011 |

It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square. 9 = 7 + 212 15 = 7 + 222 Read More: 461 Words Totally [Read more...]

On Dirichlet’s approximation theorem

June 19, 2011 |

This is one of my favourites: in 1840 the German mathematician Dirichlet proved an elegant theorem, known as “Dirichlet’s approximation theorem“. The proof is surprisingly simple, but the usefulness of the proposition in some fields of mathematics, such as Diophantine analysis is remarkable. It goes as follows: Let a be ... [Read more...]

R package DOSE released

June 12, 2011 |

Disease Ontology (DO) provides an open source ontology for the integration of biomedical data that is associated with human disease. DO analysis can lead to interesting discoveries that deserve further clinical investigation. DOSE was designed for semantic similarity measure and enrichment analysis. Read More: 619 Words Totally [Read more...]

Always learn and never know

June 3, 2011 |

I have been using R for about two years, with no previous coding background. So, I feel like the title says, “always learn and never know”. This time, I decided to use R to study a simple, non-statistical problem that came up some time ago. Suppose the exponential function 2^x ... [Read more...]

Dicetributions – episode I

May 29, 2011 |

Suppose the following game with two players: In every round, the two players pick a random number, each. Instead of using a dice, they pick a number from an interval. Player A picks a number from [9,11] and player B from [8,12]. Variation 1. The greater number wins. Who is more likely to ... [Read more...]

Music file graphs with R

May 22, 2011 |

Today we will use R to extract some interesting summary statistics regarding the music files stored in the computer. For all mp3 files I keep certain metadata in their ID3 tag. We will use this information to explore the distribution of music files with respect to the year of release. ... [Read more...]

[Project Euler] – Problem 58

May 21, 2011 |

Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length 7 is formed. 37 36 35 34 33 32 31 38 17 16 15 14 13 30 Read More: 597 Words Totally [Read more...]

Smaller or greater? – episode II

May 20, 2011 |

In a previous post I introduced the following game: Suppose you play the following game: Someone holds a set of cards with the numbers {1,2,…,N} in random order, opens up the first card and asks if the next card is greater or smaller. Every time you predict correctly, you get ... [Read more...]

[Project Euler] – Problem 57

May 19, 2011 |

It is possible to show that the square root of two can be expressed as an infinite continued fraction. √ 2 = 1 + 1/(2 + 1/(2 + 1/(2 + … ))) = 1.414213… By expanding this for the first four iterations, we get: Read More: 547 Words Totally [Read more...]

Machine Learning Ex3 – Multivariate Linear Regression

March 29, 2011 |

Part 1. Finding alpha. The first question to resolve in Exercise 3 is to pick a good learning rate alpha. This require making an initial selection, running gradient descent and observing the cost function. Read More: 221 Words Totally [Read more...]

clusterProfiler in Bioconductor 2.8

March 26, 2011 |

In recently years, high-throughput experimental techniques such as microarray and mass spectrometry can identify many lists of genes and gene products. The most widely used strategy for high-throughput data analysis is to identify different gene clusters based on their expression profiles. Another commonly used approach is to annotate these genes ... [Read more...]

Machine Learning Ex2 – Linear Regression

March 22, 2011 |

Thanks to this post, I found OpenClassroom. In addition, thanks to Andrew Ng and his lectures, I took my first course in machine learning. These videos are quite easy to follow. Exercise 2 requires implementing gradient descent algorithm to model data with linear regression. Read More: 243 Words Totally [Read more...]

The easiest way to get UTR sequence

March 2, 2011 |

I just figure out the way to query UTR sequence from ensembl by biomart tool. It is very simple compare with using bioperl to parse gbk file to extract UTR sequence. Read More: 232 Words Totally [Read more...]

Estimate Probability and Quantile

January 25, 2011 |

Simple root finding and one dimensional integrals algorithms were implemented in previous posts. These algorithms can be used to estimate the cumulative probabilities and quantiles. Here, take normal distribution as an example. Read More: 281 Words Totally [Read more...]

Single variable optimization

January 1, 2011 |

Optimization means to seek minima or maxima of a funtion within a given defined domain. If a function reach its maxima or minima, the derivative at that point is approaching to 0. If we apply Newton-Raphson method for root finding to f’, we can get the optimizing f. Read More: 223 Words ... [Read more...]

one-dimensional integrals

December 25, 2010 |

The foundamental idea of numerical integration is to estimate the area of the region in the xy-plane bounded by the graph of function f(x). The integral was esimated by divide x to small intervals, then add all the small approximations to give a total approximation. Read More: 468 Words Totally [Read more...]

Project Euler — Problem 187

December 23, 2010 |

http://projecteuler.net/index.php?section=problems&id=187 A composite is a number containing at least two prime factors. For example, 15 = 3 × 5; 9 = 3 × 3; 12 = 2 × 2 × 3. There are ten composites below thirty containing precisely two, not necessarily distinct, prime factors: 4, 6, 9, 10, 14, 15, 21, 22, 25, 26. Read More: 671 Words Totally [Read more...]

Root finding

December 4, 2010 |

Numerical root finding methods use iteration, producing a sequence of numbers that hopefully converge towards a limits which is a root. In this post, only focus four basic algorithm on root finding, and covers bisection method, fixed point method, Newton-Raphson method, and secant method. Read More: 1896 Words Totally [Read more...]
1 2