2014-06-26 Kun Ren
In recent years, non-relational data have attracted more and more attentions. Roughly speaking, all datasets that are hard to put into a rectangular table with rows and columns are non-relational datasets. 继续阅读 »
2014-05-31 Kun Ren
Gitbook is rather a relatively new concept on the web. It provides a user-friendly framework for authors to write and produce online books with beautiful illustrations and responsive interactions. It allows authors to write in Markdown syntax, which is very easy to learn and use, so that they can focus more on the cont 继续阅读 »
2014-04-08 Kun Ren
In data-driven statistical computing and data analysis, applying a chain of commands step by step is a common situation. However, it is neither straightforward nor flexible to write a group of deeply nested functions. It is because the function that comes later must be written first. 继续阅读 »
2014-04-05 Kun Ren
As we know, a Brownian motion is usually formulated as $$dx_t = \mu\,dt+\sigma\,dW_t$$ which is the continuous case of a random walk. In some cases, it is quite convenient to use this formulation to describe the characteristic of asset prices due to its highly unpredictable behavior. 继续阅读 »
2014-03-15 Kun Ren
In R, function may not be as special as it is in other programming languages; it is regarded as one of the many types and can be passed as an argument to some other function. The way we deal with other objects such list and data.frame definitely applies to function. Here is a simple example in which we define two funct 继续阅读 »
2014-03-14 Kun Ren
Oftentimes, we obtain a long or a wide table from a certain data source, and it may be the only format we can get. For example, some financial databases provide daily tick data for all stocks in a financial market. The data table may be arranged in a long format like this: 继续阅读 »
2014-02-20 Kun Ren
People love dealing with well-structured data. It costs much less efforts than working with disorganized raw texts. In economic and financial research, we typically download data from open-access websites or authentication-required databases. These sources may provide data in multiple formats. For example, almost all 继续阅读 »
2014-02-15 Kun Ren
r
Writing R code can be very easy. It depends on how much you want to achieve with your code and what features you want your code to support. 继续阅读 »
2014-02-07 Kun Ren
In both research and application, we need to manipulate data frames by selecting desired columns, filtering records, transforming and aggregating data. 继续阅读 »
2014-02-01 Kun Ren
For R beginners, for loop is an elementary flow-control device that simplifies repeatedly calling functions with different parameters. A possible block of code is like this: 继续阅读 »