instruction
stringlengths
15
26.1k
Spectrum analysis is often used to analyse waveforms. A common configuration, for example, is to create a graph where X is time, Y is frequency, and the brightness of each position represents amplitude. Has spectrum analysis ever been used successfully as an indicator to analyse historical price data, for example th...
Has spectrum analysis ever been used successfully to analyse historical price data?
Yes. Check out [Time-Series Analysis][1] by Shumway and Stoffer. Spectral Analysis and Filtering is covered in Chapter 4. [1]: http://www.amazon.com/Time-Analysis-Its-Applications-Statistics/dp/1441921257/ref=sr_1_1?ie=UTF8&qid=1327435164&sr=8-1
Big concept! Have a look at my blog post on the topic, I've taken a lot of care to put it all in very simple terms: click [here](http://fermatslastspreadsheet.wordpress.com/wp-admin/index.php?page=stats&blog=30479741 "www.fermatslastspreadsheet.com").
Fractal spectra are covered in [Multifractal Volatility: Theory, Forecasting, and Pricing][1]. Also note that your run-of-the-mill moving average of a price series is a low-pass filter (filters out the higher frequencies), and moving averages are very used in basic financial analysis. [1]: http://rcm.amazon.com/...
[Here][1] is a gentle introduction to wavelet methods. [1]: http://www.amazon.ca/Introduction-Wavelets-Filtering-Methods-Economics/dp/0122796705/ref=sr_1_1?ie=UTF8&qid=1327458407&sr=8-1
The Quantitative Finance Stack Exchange is intended for **professionals** and **academics/students** involved in quant modeling or trading. **Basically, if you aren't earning a living at this, it's probably off topic.** Good questions are focused on an **actual problem you face in the course of your work** as a quant ...
The risk-netural measure has a massively important property which is worth making very clear: > The price of any trade is equal to the expectation of the trade’s winnings and losses under the risk-neutral measure. This property gives us a scheme for pricing derivatives: 1. take a collection of prices of trades...
Fractal spectra are covered in [Multifractal Volatility: Theory, Forecasting, and Pricing][1]. Also note that your run-of-the-mill moving average of a price series is a low-pass filter (filters out the higher frequencies), and moving averages are very used in basic financial analysis. [1]: http://www.amazon.com/...
The risk-netural measure has a massively important property which is worth making very clear: > The price of any trade is equal to the expectation of the trade’s winnings and losses under the risk-neutral measure. This property gives us a scheme for pricing derivatives: 1. take a collection of prices of trades...
The risk-netural measure has a massively important property which is worth making very clear: > The price of any trade is equal to the expectation of the trade’s winnings and losses under the risk-neutral measure. This property gives us a scheme for pricing derivatives: 1. take a collection of prices of trades...
I have read about something like Kelly criterion for long term expectation maximization assuming a fixed starting bankroll. But if one can assume unlimited leverage, and one has a signal for a price movement..how could one go about deciding optimal trading sizes? It would seem to me like there are a lot of factors invo...
From a high frequency point of view, with a price prediction and assuming infinite leverage, how do you determine optimal trade size?
I have read about something like Kelly criterion for long term expectation maximization assuming a fixed starting bankroll. But if one can assume unlimited leverage, and one has a signal for a price movement..how could one go about deciding optimal trading sizes? It would seem to me like there are a lot of factors invo...
to limit interest rate paths to a 'reasonable' range (if we could define reasonable). Now we calibrate log-normal skew and mean reversion monthly to robust basket of atm swaptions and in and out caps. Sometimes resulting in at least five percent of the paths exceeding 40% (1 month forward rate) and reaching over 250...
Should we apply practical constraints on the distribution of monte carlo paths?
There are few things to consider. 1. Trading moves the price, to minimize your market impact and maximize your return it is generally optimal to split your order in several child orders. See the [Kyle model][1]. 2. Splitting optimally dependents on specific assumptions that you make. The simplest (and first) appr...
There are few things to consider. 1. Trading moves the price, to minimize market impact and maximize return it is generally optimal to split an order in several child orders. See the [Kyle model][1]. 2. Splitting optimally dependents on specific assumptions that you make. The simplest (and first) approach is that...
Given historical implied volatility and all other know variables (stock price, option strike price, option expiration date, dividend rate, interest rate) what is the best way to calculate the probability of an option being in the money at expiration?
what is the best way to calculate the probability of an equity option ending in the money?
The risk-netural measure has a massively important property which is worth making very clear: > The price of any trade is equal to the expectation of the trade’s winnings and losses under the risk-neutral measure. This property gives us a scheme for pricing derivatives: 1. take a collection of prices of trades...
N(d2) is near to the probability the option will expire in the money; I have a video showing how [d2 is similar to distance to default in the Merton here on youtube][1]. N(d1) is the delta. The technical issue is that N(d2) is a risk-neutral probability; the input in d2 is the riskfree rate, although the theory i...
How to obtain true probabilities from Black-Scholes option pricing equation? Suppose, that we know risk adjusted discount rate for the underlying asset (the drift term in the physical measure) and risk free rate. The task is to find a real (not risk neutral) expected payoff for a call option.
How to obtain true probabilities from Black-Scholes?
As you know, the _key equation_ of risk neutral pricing is the following: $\exp^{-rt} S_t = E_Q[\exp^{-rT} S_T | \mathcal{F}_t]$ That is, discounted prices are Q-martingales. It makes real-sense for me from an economic point of view, but is there any "proof" of that? I'm not sure my question makes real sens...
Say, I have hourly returns $r_1,r_2,...,r_T$, where $r_t$ = $ln(p_t)$ - $ln(r_0)$ for $t = 1...T$. So what is the value of $E[r_t]$? Would $r_T$ be the $\pi{(r_t)}$? Basically $r_t$s are the returns w.r.t to a fixed point $t_0$. My question then is how can I mathematically prove that the $E[r_t]$ is $r_T$ or it isn...
How to model the daily return using intraday data?
Say, I have hourly returns $r_1,r_2,...,r_T$, where $r_t$ = $ln(p_t)$ - $ln(p_0)$ for $t = 1...T$. So what is the value of $E[r_t]$? Would $r_T$ be the $\prod{(r_t)}$? Basically $r_t$s are the returns w.r.t to a fixed point $t_0$. My question then is how can I mathematically prove that the $E[r_t]$ is $r_T$ or it i...
I am doing extensive research on portfolio replication and was hoping to get some help with some problems I am encountering. I am running a regression between 2 assets that I believe replicate another asset well. For example, let A be the asset we are replicating and let B and C be the assets we will use to mimic A...
I am doing extensive research on portfolio replication and was hoping to get some help with some problems I am encountering. I am running a regression between 2 assets that I believe replicate another asset well. For example, let A be the asset we are replicating and let B and C be the assets we will use to mimic A...
My 2c worth. Experience tells me that the better ways to get a feel for whether their strategy is based on something more than luck are amongst: 1) `getting to know your traders' -- have a chat, pick their brains, try to get some insight into their methods; 2) see how hard the market has been -- check whether ...
Is there a standard (or maybe even intuitive?) way of ranking pairs of cointegrated time series so that one could make statements like the following: series A is MOST cointegrated with series M series A is NEXT MOST cointegrated with series Y ... series A is NEXT, ... NEXT (i.e. LEAST) cointegrate...
I'm looking to convert some tickdata .csv files into a database on a local disk and then use R to call the data and do my various analytics and modelling. What are some best practices / implementation techniques that could be recommended to minimize any headaches? Noted that packages such as `mmap` help enormousl...
R: How feasible is it to store -- and work with -- tick data in a database connected to R?
I've been a researching minimum variance portfolios (a la http://quantivity.wordpress.com/2011/04/17/minimum-variance-portfolios/ - which is an excellent blog btw) and find that by building MVP portfolios adding constraints on portfolio weigths and a few other tweaks to the methods outlined I get generally positive ret...
I've been researching algorithmic (non discretionary) trading at the several-day to month timescale, i.e. not HFT. I am not interested in voodoo i.e. no technical analysis, I am looking for solid quant type techniques that can have a positive edge at smaller capacities that are interesting to an individual but that a l...
Home/hobbyist quant trading - possible to profitable or just an intellectual hobby?
Say, I have hourly returns $r_1,r_2,...,r_T$, where $r_t$ = $ln(p_t)$ - $ln(p_{t-1})$ for $t = 1...T$. So what is the value of $E[r_t]$? Would $r_T$ be the $\prod{(r_t)}$? Basically $r_t$s are the returns w.r.t to a fixed point $t_0$. My question then is how can I mathematically prove that the $E[r_t]$ is $r_T$ or ...
Say, I have hourly returns $r_1,r_2,...,r_T$, where $r_t$ = $ln(p_t)$ - $ln(p_0)$ for $t = 1...T$. So what is the value of $E[r_t]$? Would $r_T$ be the $\prod{(r_t)}$? Basically $r_t$s are the returns w.r.t to a fixed point $t_0$. My question then is how can I mathematically prove that the $E[r_t]$ is $r_T$ or it i...
I've been a researching minimum variance portfolios (a la http://quantivity.wordpress.com/2011/04/17/minimum-variance-portfolios/ - which is an excellent blog btw) and find that by building MVP portfolios adding constraints on portfolio weigths and a few other tweaks to the methods outlined I get generally positive ret...
I've been a researching minimum variance portfolios (from this [link][1]) and find that by building MVP portfolios adding constraints on portfolio weigths and a few other tweaks to the methods outlined I get generally positive returns over a six-month or year scale. I am looking to build some portfolios that are low...
The minimum variance solution loads up on securities that have low variances and co-variances. Theoretically you are correct that this should have a low expected return profile. However, it turns out - in contradiction to modern portfolio theory - that securities that have low-volatility or low-beta experience *high...
**This post is Quant Stack Exchange's master list of data sources.** Please append your links to other data sources to the list below. Include your opinion of the data as a comment on this answer. ## Economic Data ## <br> See [What are the most useful sources of economics data?][1] on the economics SE. **Wo...
I do recommend to you the chapter 8 of the Ernest Chan book "Quantitative Trading: How to Build Your Own Algorithmic Trading Business" The chapter's name is "Conclusion: Can Independent Traders Succeed? " The conclusion is that yes but I now cant remember very well the chapter...
The minimum variance solution loads up on securities that have low variances and co-variances. Theoretically you are correct that this should have a low expected return profile. However, it turns out - in contradiction to modern portfolio theory - that securities that have low-volatility or low-beta experience *high...
Lets assume that I have an equity strategy that generates signals intraday to buy and sell. I run this strategy across the SP500 names. Now within my strategy I want to incorporate a method to help me decide if I want to take a certain trade on or not, based on my current portfolio composition. Currently I have a ve...
How to manage equity portfolio risk intraday?
I constructed a model to forecast the prepayment rates for mortgage loan portfolio using probit regression through the factors as LTV, PTI, TFS(time from settlement), and the several characteristics of the borrower. However when testing with the historical data the forrecast is not so accurate.My question is : "what...
I constructed a model to forecast the prepayment rates for mortgage loan portfolio using probit regression through the factors as LTV, PTI, TFS(time from settlement), and the several characteristics of the borrower. However when testing with the historical data the forrecast is not so accurate.My question is : "what...
I constructed a model to forecast the prepayment rates for mortgage loan portfolio using probit regression through the factors as LTV, PTI, TFS (time from settlement), and the several characteristics of the borrower. However when testing with the historical data the forecast is not so accurate. My question is: "wha...
I have seen multiple instances where people try to explain the diversification effects of having assets with a certain level of correlation, especially in the "most diversified portfolio" literature. A nice example is in the NewEdge's ["Superstars vs. Teamwork"][1]: ![enter image description here][2] My question...
Minimizing risk alone would not imply a positive expected return, except for the following: The assets that are being included have positive expected returns. If you took a portfolio of assets that had a negative expected return, and minimized their risks, you would probably still end up with a portfolio that has...
An investor at time $t_0$ can invest his wealth $w_0$ in a risky asset $x$ for an amount $a$ and the remain part in the riskless asset $w_0-a$. At the end of the period $t_1$, the investor will obtain the wealth $w$: $$ w = a(1+x)+(w_0-a)(1+r_f) =a(x-r_f)+w_0(1+r_f). $$ Using a CARA (exponential negative) util...
Maximization of CARA utility function: unique solution with an unbounded parameter?
An investor at time $t_0$ can invest his wealth $w_0$ in a risky asset $x$ for an amount $a$ and the remain part in the riskless asset $w_0-a$. At the end of the period $t_1$, the investor will obtain the wealth $w$: $$ w = a(1+x)+(w_0-a)(1+r_f) =a(x-r_f)+w_0(1+r_f). $$ Using a CARA (exponential negative) util...
This looks like a general equilibrium model in Economics. It should be described in most of microeconomics textbooks (e.g. [this][1]). Yes, you need a budget constraint here for$\ a$, otherwise your optimization problem makes no sense. Moreover, the household prefers consumption today to consumption tomorrow and, hence...
This looks like a general equilibrium model in Economics. It should be described in most of microeconomics textbooks (e.g. [this][1]). Yes, you need a budget constraint here for$\ a$, otherwise your optimization problem makes no sense. Moreover, the household prefers consumption today to consumption tomorrow and, hence...
This looks like a general equilibrium model in Economics. It should be described in most of microeconomics textbooks (e.g. [this][1]). Yes, you need a budget constraint here for$\ a$, otherwise your optimization problem makes no sense. Moreover, the household prefers consumption today to consumption tomorrow and, hence...
This [book][1] by Richard Harris is a great intro. [1]: http://www.amazon.com/Using-Cointegration-Analysis-Econometric-Modelling/dp/0133558924/ref=sr_1_1?ie=UTF8&qid=1328288495&sr=8-1
> **Possible Duplicate:** > [What is the intuition behind cointegration?](http://quant.stackexchange.com/questions/219/what-is-the-intuition-behind-cointegration) <!-- End of automatically inserted text --> Although having a postgrad degree in mathematics, I haven't used any maths 'in anger' for quite a few years...
I have a daily rebalanced portfolio of several strategies. After one month, I now want to attribute the performance to the different strategies. There are several ways to do it. For instance one could compute what each strategy has actually contributed. But it is not always fair as it is dependent on the path of ...
How to compute performance attribution between daily rebalanced strategies?
This [book][1] by Richard Harris is a great intro. The book is short but informative and technically rigorous. As a primer, it's fine. For the advanced student or professional it's obviously lacking, but that's the definition of a primer. ECM and VECM are particularly well treated. [1]: http://www.amazon.com/...
Pre-payment rates are difficult to forecast because of [path dependency][1]. The historical interest rate path - not just current market conditions and borrower characteristics - matters because borrowers may have exercised their right to call the mortgage bond and re-finance if rates had previously been at lower level...
I currently have a local volatility model that uses the standard Black Scholes world things... My question is when calculating the volatility surface what is the difference between the call volatility surface, and the put surface? Thanks
I am trying to calculate the log returns of a dataset in R using the usual log differencibg method. However, the calculated data is simply a vector of zeroes. I can't see what I'm doing wrong. Here is the snippet showing what I'm doing > prices <- data$cl > head(prices) [1] 1108.1 1095.4 1095.4 1102...
I am trying to calculate the log returns of a dataset in R using the usual log differencing method. However, the calculated data is simply a vector of zeroes. I can't see what I'm doing wrong. Here is the snippet showing what I'm doing > prices <- data$cl > head(prices) [1] 1108.1 1095.4 1095.4 1102...
In kamikaze_pilot's defense, the question is not that naive or simple. First of all, you need to define what options you are talking about. Consider a digital option for example (which is really fairly vanilla since you can proxy it as a combination of two European calls), which pays 1 of the stock is beyond a certa...
The reason for put and call volatilities to appear different is that the implied vol has been calculated using different drift parameters than those implied by the market. Let's take everything in the model as given except the interest rate $r$ and the volatility $\sigma$. For European options we have the Black-Sch...
I currently have a local volatility model that uses the standard Black Scholes assumptions. When calculating the volatility surface, what causes the difference between the call volatility surface, and the put surface?
What causes the call and put volatility surface to differ?
I constructed a model to forecast the prepayment rates for a mortgage loan portfolio (of mortgages in an emerging market) using probit regression on factors such as loan-to-value, PTI, time from settlement, and several characteristics of the borrower. However when testing with historical data the forecast is not so ...
What is the best way to forecast prepayment rate in an emerging market mortgage loan portfolio?
I've been a researching minimum variance portfolios (from this [link][1]) and find that by building MVPs adding constraints on portfolio weights and a few other tweaks to the methods outlined I get generally positive returns over a six-month to one year time scale. I am looking to build some portfolios that are low ...
Why does the minimum variance portfolio provide good returns?
I thought implied volatility, as well as the VIX, primarily increase due to increases in the underlying asset's volatility, as well as the options themselves being bid up because more people were buying that usual. For instance, during an IV crush, usually people are selling the contract heavily. When IV is building...
What drives changes in implied volatility on ETFs/ETNs?
I am doing extensive research on portfolio replication and was hoping to get some help with some problems I am encountering. I am running a regression between 2 assets that I believe replicate another asset well. For example, let A be the asset we are replicating and let B and C be the assets we will use to mimic A...
How to run an asset replication regression?
I have seen multiple instances where people try to explain the diversification effects of having assets with a certain level of correlation, especially in the "most diversified portfolio" literature. A nice example is in the NewEdge's ["Superstars vs. Teamwork"][1]: ![enter image description here][2] **How can I...
How to simulate correlated assets for illustrating portfolio diversification?
Where can I find the data on interbank market?
My 2c worth. Experience tells me that the better ways to get a feel for whether their strategy is based on something more than luck are amongst: 1) `getting to know your traders' -- have a chat, pick their brains, try to get some insight into their methods; 2) see how hard the market has been -- check whether ...
Given that we want to find the Value at Risk for a portfolio of stocks only, there are two main methods to proceed. In the problem, we also assume that stocks follow a geometric Brownian motion. A full scale simulation: 1. simulate normal deviates B; 2. plug into `S = S0 *exp((\mu-0.5*sigma**2)t + sigma*t*B)`;...
How to minimize the difference between a parametric VaR and a MC-VaR with lognormal assumption?
Where can I find data on the interbank lending market?
Where can I find disaggregated interbank lending data (i.e. bank A lends to bank B x money at y rate)? I could only find data on interest rates. I would accept LIBOR market data as well as any national data of a country with an internationally important banking sector. I also checked some articles on the interba...
The Quantitative Finance Stack Exchange is intended for **professionals** and **academics/students** involved in quant modeling or trading. **Basically, if you aren't earning a living at this, it's probably off topic.** Good questions are focused on an **actual problem you face in the course of your work** as a quant ...
Given that we want to find the Value at Risk for a portfolio of stocks only, there are two main methods to proceed. In the problem, we also assume that stocks follow a geometric Brownian motion. A full scale simulation: 1. simulate normal deviates B; 2. plug into `S = S0 *exp((\mu-0.5*sigma**2)t + sigma*t*B)`;...
Given that we want to find the Value at Risk for a portfolio of stocks only, there are two main methods to proceed. In the problem, we also assume that stocks follow a geometric Brownian motion. A full scale simulation: 1. simulate normal deviates B; 2. plug into $S = S_0 e^{(\mu-0.5\sigma^2)t + \sigma t B}$; ...
Given that we want to find the Value at Risk for a portfolio of stocks only, there are two main methods to proceed. In the problem, we also assume that stocks follow a geometric Brownian motion. A full scale simulation: 1. simulate normal deviates B; 2. plug into $S_t = S_0 e^{(\mu-0.5\sigma^2)t + \sigma t B_t...
Kept waiting in the bank yesterday, with no paint to watch dry, I found myself staring at the mortgage rates. (These are all annual interest rates): - Variable: 2.475% - 1 year: 2.90% - 2 years: 3.05% - 3 years: 3.15% - 5 years: 3.30% - 7 years: 3.35% - 10 years: 3.65% - 15 years: 4.25% - 20 years: 4.70% ...
How to remove the risk element from a set of fixed rate mortgage offerings?
Using MySQL for financial data is not unreasonable. But for *tick data* are you ever going to do anything except a query on a date range? For analyzing tick data in R I generally keep it in a disk file, one tick file per day, and load the files in as I need them. Using .RData files instead of csv files is quicker. I...
I have an API that for an order routing platform that is in visual basic. The maximum frequency or orders to exchanges will be milliseconds, where the underlying systems are expected to be able to process a maximum of 1 order per millisecond. Generally I would like to write in C++ or Java when I have this level of s...
Its because the people still "think", it must be faster and hence favor C++. Real arguments are sparse. Some of the most ideological arguments: 1. 'Bound checks on every array element access.' But in relevant loops they can be removed in C# and are automatically removed in Java (Hot Spot VM) and CLR often. 2. 'G...
I overheard someone at work today talking about a commodity spread option pricing model and he was asking our quant if he should use price volatility instead of return volatility as the volatility input parameter. He was referring to volatility calculated on absolute price change as opposed to relative price change. ...
There appears to be several ways of calculating volatility: 1. Price volatility (of which there are several variants): - close to close - high low range - average of open, high, low and close 2. Log returns volatility My question(s) are: a). Why are there so many different ways of calculating vol...
I went through the most advanced books on statistics and still can't find an answer. There is a well known formula for combining volatility of two correlating variables, but what about adding the actual amounts, which are already known? Here is a simply put problem: We know that the anticipated loss from factor X...
How to calculate cumulative loss from two factors that have negative correlation?