15 votes

Usage of Random forests in Quantitative analysis of stocks

Recently I attended a presentation by the first author of the following paper who gave us quite a creative and illuminating (kind of meta-)use of random forests in Quant Finance: All that Glitters Is ...
vonjd's user avatar
  • 27.4k
13 votes
Accepted

statistical arbitrage vs factor trading

1) Why would you trade the error on the residual instead of creating a long/short factor model and trade expected returns? I would posit that the biggest reason people do this is for orthogonality of ...
mperlow's user avatar
  • 456
12 votes
Accepted

Does Chan use the wrong state transition model in his Kalman filter code?

In addition to getting the right transition model for the Kalman filter, the main obstacle to optimizing filter performance is to implement an optimal initialization. I use an iterative approach to ...
Amanda G.'s user avatar
  • 361
11 votes
Accepted

What is the total correlation between assets in a portfolio?

This is indeed an interesting question. According to this website, a paper by Goldman Sachs [Tierens and Anadu (2004)] proposes three alternative methods for estimating average stock correlations: ...
vonjd's user avatar
  • 27.4k
10 votes

Implied Volatility of stock on Think or Swim

What they gave you is Newton's formula. If you have a function $f(x)$ then you can find the value $x_0$ such that $f(x_0) = 0$ by this method. It uses the derivative $f'$ which in your case is the ...
Richi Wa's user avatar
  • 13.7k
8 votes

What is the total correlation between assets in a portfolio?

I just want to add to vonjd's answer some info on the comparison of the 3 methods. This is too big for a comment so I'm posting as a separate answer but please upvote his answer, not mine. Do the ...
msitt's user avatar
  • 741
7 votes
Accepted

Creating a Covariance Matrix

here is how to get covariance matrix from correlations:
Valometrics.com's user avatar
7 votes

What color financial time series are there?

Bonus question: Does anyone know how to play/hear a (financial) time series recorded as a pandas series, dataframe, python list, numpy array, csv/txt file,... ? This is kind of fun and has practical ...
amdopt's user avatar
  • 4,338
6 votes
Accepted

Fama MacBeth cross-sectional Regression

Preliminary The main result of the Fama-MacBeth procedure is to calculate standard errors that correct for cross-sectional correlation in a panel. It is a commonly used method due to it's easily ...
skoestlmeier's user avatar
  • 2,916
6 votes

Quantitative finance for physicists

Physicists typically know PDEs but not stochastic calculus I have a masters in physics, so have a reasonable idea of the usual skillsets a physicist will know (at least at undergraduate level), and ...
oliversm's user avatar
  • 1,389
6 votes
Accepted

Is it always better to use the entire distribution of a financial returns series, not just $\mu$ and $\sigma$?

It depends. For example, if you're doing option pricing in the log normal world returns are completely described by the mean and standard deviation. If you add jumps, you would also need to ...
Bob Jansen's user avatar
  • 8,552
5 votes
Accepted

What are the assumptions in the first-stage of Fama-MacBeth (1973)?

The CAPM is an economic theory that expected returns in excess of the risk free rate should be linear in the regression beta on the market. $$ \operatorname{E}[R_i - R^f] = \beta_i \operatorname{E}[R^...
Matthew Gunn's user avatar
  • 6,944
5 votes
Accepted

Advances in financial machine learning (Marcos López de Prado): explanation of snippet 3.1

I can't comment on why MLDP is calculating returns this way (perhaps there is a reason explained in the book, which I don't have). However, from a pure code point-of-view he seems to be calculating ...
oronimbus's user avatar
  • 1,896
4 votes

CAPM Calculations

The question above looks somewhat confused. Where's the error term? A recipe for a standard calculation It's customary to work with monthly returns. For each portfolio $i$, calculate monthly ...
Matthew Gunn's user avatar
  • 6,944
4 votes
Accepted

Value at Risk - What if an account has never suffered from a negative return

By definition, your loss cannot be positive, so you'd set the VaR to zero. But it really depends, on how you calculate your VaR. If you calculate your returns, sort them and look at the 5% quantile (...
rbm's user avatar
  • 745
4 votes
Accepted

Does longer time horizon necessarily imply reduced risk?

It depends upon how you define risk. Assume a constant, positive equity risk premium and an equity index following geometric Brownian motion (GBM): $$d \log S_t = \mu \, dt + \sigma \, dZ_t = (\hat{\...
RRL's user avatar
  • 3,680
4 votes

Implied Volatility of stock on Think or Swim

Richard's answer is the correct answer to a slightly different question. I think what you’re asking for is the weighted average option implied volatility for a stock. The implied volatility of a ...
David Addison's user avatar
4 votes
Accepted

Implementation of Maximum Drawdown in python working directly with returns

You are missing a few things. The function below assumes that returns is either a pandas series or a column of a pandas dataframe. Try this: ...
amdopt's user avatar
  • 4,338
4 votes

Fat tailed can be estimated through a t-distributions?

B is the correct choice. I honestly would wish multiple choice would not even exist. It is the worst way of testing knowledge in my opinion. Without knowing the details of what was taught, I would say ...
AKdemy's user avatar
  • 8,739
4 votes
Accepted

How to identify daily returns as an unusual daily return given a dataset

Given you have your returns $$r_t = \frac{P_t - P_{t-1}}{P_{t-1}}$$ you can compute the absolute z-score as $$Z_t = \frac{r_t-\mu(r)}{\sigma(r)}$$ where $\mu(r)$ and $\sigma(r)$ are the mean and ...
AKdemy's user avatar
  • 8,739
3 votes

Central limit theorem and normality assumption of asset return distribution

No. I just published a paper on this. If return is defined as $$r_t=\frac{p_{t+1}q_{t+1}}{p_tq_t},$$ and since returns are not data while prices and volumes are, then it follows that the ...
Dave Harris's user avatar
  • 4,299
3 votes

Where can I find ideas for strategies?

There are lots of different sources out there where you can find various quantitative strategies. Usually, different blog aggregators like https://www.r-bloggers.com post on their websites ...
AK88's user avatar
  • 1,840
3 votes

Utility functions, are they used in the real world by hedge funds, banks, etc?

See also utility indifference pricing (Henderson, V., & Hobson, D. (2004) Utility Indifference Pricing - An Overview http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.321.994&rep=rep1&...
Antoine Conze's user avatar
3 votes

Asset return distribution

In the Black Scholes (1973) model, the stock price is assumed to follow a geometric Brownian motion $\mathrm{d}S_t=S_t\mu \mathrm{d}t + S_t \sigma \mathrm{d}W_t$. If you solve the SDE, $(S_t)$ is log-...
Kevin's user avatar
  • 15.9k
3 votes
Accepted

PCA FOR STOCK PICKING

The first observation I make is that the proportion of variance is not very high for the first PCs, with the implication that I would hypothesise that the PCs are not very stable, nor reliable. (You ...
Attack68's user avatar
  • 10.2k
3 votes

Fama/Macbeth Regression - negative estimate for market premium

It sounds like you have estimated a bunch of $\beta$s for excess returns $R_i=r_i-r_f$ and $R_M=r_M-r_f$ above the risk-free rate $r_f$ -- and then run the following model: $$ \bar{R}_i = \gamma_0 + \...
kurtosis's user avatar
  • 2,900
3 votes

How to use autocorrelation plot to interpret time series data?

Just by looking at the graphs, I'd say: Unit root Constant series Seasonality AR model No AC No AC
confused's user avatar
  • 717
3 votes

Issues making series stationary

Your shift is in the wrong direction. Do this: df.price = pd.to_numeric(df.price) df['logret'] = np.log(df.price/df.price.shift(1))
Quantoisseur's user avatar
3 votes

Reinforcement learning in finance

Really recommend this book for RL in finance : Dixon et al (2020) Machine Learning in Finance: From Theory to Practice He talks about QLBS, q-learning setup for black scholes, RL for investment ...
Dhruv Mahajan's user avatar
3 votes
Accepted

Starting Point for understanding Financial Theory for a Statistician

Brooks - Introductory Econometrics for Finance is a very comprehensive, accessible overview of all the mainstream models for capturing non-normality, serial correlation, non-stationarity and other ...
develarist's user avatar
  • 3,000

Only top scored, non community-wiki answers of a minimum length are eligible