Category: R

Fractional Logit Model with Python

In [1]: import pandas as pd In [2]: import statsmodels.api as sm In [3]: data = pd.read_table(‘/home/liuwensui/Documents/data/csdata.txt’) In [4]: Y = data.LEV_LT3 In [5]: X = sm.add_constant(data[[‘COLLAT1’, ‘SIZE1’, ‘PROF2’, ‘LIQ’,...continue reading.

Portfolio Trading

In finance and investing the term portfolio refers to the collection of assets one owns. Compared to just holding a single asset at a time a portfolio has a number...continue reading.

Picturing Trees

  In this post I like to illustrate the R package “ape” for phylogenetic trees for the purpose of assembling trees. The function read.tree creates a tree from a text...continue reading.

Fit and Visualize A MARS Model

################################################# ## FIT A MULTIVARIATE ADAPTIVE REGRESSION ## ## SPLINES MODEL (MARS) USING MDA PACKAGE ## ## DEVELOPED BY HASTIE AND TIBSHIRANI ## ##############################################…continue reading.

Learning Kernels SVM

Machine Learning and Kernels A common application of machine learning (ML) is the learning and classification of a set of raw data features by a ML algorithm or technique. In...continue reading.

ggplot2 Time Series Heatmaps

How do you easily get beautiful calendar heatmaps of time series in ggplot2? E.g:From MarginTaleI was impressed by the lattice-based  implementation from Paul Bleicher of Humedica, which you can find...continue reading.

Boxplots and Day of Week Effects

THIS BLOG DOES NOT CONSTITUTE INVESTMENT ADVICE. ACTING ON IT WILL MOST LIKELY BE DETRIMENTAL TO YOUR FINANCIAL HEALTH.After following some R-related quant finance blogs like Timely Portfolio, Systematic Investor or Quantitative tho…continue reading.