# 分享Reshape R data frame from long to wide format

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: 继续阅读 »

# 分享Use SQL to operate R data frames

In both research and application, we need to manipulate data frames by selecting desired columns, filtering records, transforming and aggregating data. 继续阅读 »

# 分享Fit an Ornstein–Uhlenbeck process with discrete time series data

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. 继续阅读 »