benjaminmgross
Reputation
246
Top tag
Next privilege 250 Rep.
 Mar19 revised Except Zipline, are there any other Pythonic algorithmic trading library I can choose? added 19 characters in body Mar5 awarded Critic Feb27 answered Except Zipline, are there any other Pythonic algorithmic trading library I can choose? Nov8 revised How to calculate unsystematic risk? Added proper MathJax formatting for my answer Nov2 awarded Yearling Aug31 awarded Commentator Aug31 comment Rate Distortion Minimization in a Python Clustering Algorithm @BobJansen, hmmmm, that's very true (my current version is 1.52) Although, because my implementation is a simple k-cluster, centroid / distance algorithm, scikit-learn should accomplish things fine as well. Let me know if you'd like to work on the idea in parallel, it'd be a fun project to collaborate on. Aug31 comment Rate Distortion Minimization in a Python Clustering Algorithm @BobJansen, they're just Adj Close asset prices. Something like: data = pandas.io.dataDataReader(['IWB','IWR','IWM','SCZ','EFA','EEM','TIP','TLT','IEF,'‌​SHY','HYG','LQD','PCY','BWX','MBB','PFF','IYR','GLD','GSG'])['Adj Close'] should give you wide array of asset classes to set up (nearly) the same problem I was working on. And as an aside, I do see the PyCluster Library on PyPI. Nov19 comment Why do stocks with a negative beta return less than the risk free rate? They don't have the same "risk"... risk (from a perspective of $\beta$) is having a low payoff when consumption is low, and a high payoff when consumption is "high." Nov19 awarded Supporter Nov19 comment Why do stocks with a negative beta return less than the risk free rate? Stock B does have the same risk of bad returns... but they occur in states of converse consumption levels. Think of an insurance policy, I pay 10 per mo and if I die my spouse gets 100,000. In the event I die, my wife will have made the return of $\frac{100,000}{10 x num premiums I paid} - 1$. Otherwise, her rate of return is a loss of every penny we've invested in the policy. You refer to a $\beta$ "to the market" which has a very specific meaning: "correlated to the aggregate market, i.e. systematic risk." Remember, Stock B only pays you less in the event the market appreciates. Nov19 answered Why do stocks with a negative beta return less than the risk free rate? May7 comment Rate Distortion Minimization in a Python Clustering Algorithm May7 comment Rate Distortion Minimization in a Python Clustering Algorithm When you say my "observations aren't independent now", I'm not sure what you're referring to. I'm running a clustering algorithm on a correlation matrix, which I would call my "observations," and asset returns in finance are rarely (if ever) independent, so I'm not quite sure what you mean. May7 comment Rate Distortion Minimization in a Python Clustering Algorithm @quasi, thanks for the reply. A little clarification, $\mathbf{\Sigma}$ as I've defined it, is the covariance matrix as an input to the distortion calculation. The clustering algorithm is being run on the correlation matrix of asset returns. So you're saying, I should set $\mathbf{\Sigma}$ equal to the Covariance of the correlation matrix (which is the input to my clustering algorithm), instead of the covariance of asset returns (which I'm currently doing), correct? May7 revised Rate Distortion Minimization in a Python Clustering Algorithm added 616 characters in body May7 comment Rate Distortion Minimization in a Python Clustering Algorithm Just posted the data, as well as a small script to show you exactly what I'm seeing (as well as the output). Thanks for the suggestion @quasi May7 revised Rate Distortion Minimization in a Python Clustering Algorithm Added data and exact execution code to be able to run the analysis May7 awarded Student May7 asked Rate Distortion Minimization in a Python Clustering Algorithm