An open source programming language and software environment for statistical computing and graphics.

learn more… | top users | synonyms

17
votes
2answers
8k views

How to derive the implied probability distribution from B-S volatilities?

The general problem I have is visualization of the implied distribution of returns of a currency pair. I usually use QQplots for historical returns, so for example versus the normal distribution: ...
22
votes
9answers
7k views

What tools exist for order book analysis and visualization?

What tools exist for order book analysis and visualization? In particular, if one wanted to examine a limit order book and understand how it changes throughout the day where would you turn for ...
21
votes
3answers
2k views

Tools in R for estimating time-varying copulas?

Are there libraries in R for estimating time-varying joint distributions via copulas? Hedibert Lopes has an excellent paper on the topic here. I know there is an existing packaged called copula but ...
9
votes
4answers
20k views

How to fit ARMA+GARCH Model In R?

I am currently working on ARMA+GARCH model using R. I am looking out for example which explain step by step explanation for fitting this model in R. I have time series which is stationary and I am ...
7
votes
1answer
18k views

How to interpret results of Johansen Test?

I have two time-series a & b. The objective is to find out whether two series are cointegrated or not. I am using Johansen Test in R to find this out. I am using urca package of R. Here is the ...
6
votes
1answer
6k views

GARCH model and prediction

I have a question about the prediction of volatility and returns of a time series. Basically it is a question about prediction in the ...
43
votes
12answers
17k views

Switching from C++ to R - limitations/applications

I've only recently begun exploring and learning R (especially since Dirk recommended RStudio and a lot of people in here speak highly of R). I'm rather C(++) oriented, so it got me thinking - what are ...
6
votes
2answers
2k views

Quantmod: what's the difference between ROC(Cl(SPY)) and ClCl(SPY)

I feel like I'm missing something fundamental here, but I can't shake the feeling that these two series should be equivalent. /edit: there is also dailyReturn(Cl(SPY)). I've seen all 3 of these ...
9
votes
1answer
6k views

Forecasting using rugarch package

I want to do one step ahead in-sample forecasts. My data can be found here. This is just a data frame with the date as the rownames. I specify my model and do the fit and show the plots with ...
9
votes
1answer
965 views

Why does the following data fail my cointegration test?

I have some closing price data for two Australian banks which track each other very closely. http://dl.dropbox.com/u/12337149/stat/CBA.csv http://dl.dropbox.com/u/12337149/stat/WBC.csv Code from ...
2
votes
1answer
472 views

short-sale constraint with nonpositive-definite matrix in portfolio optimization

I need help about portfolio optimization in R. I have inverted matrix and I want to use it as an input in portfolio optimization. It was non-positive definite before I have handled it. In portfolio ...
6
votes
1answer
192 views

Obtaining risk-neutral probability from option prices

Suppose I have the following data (for the current stock and option prices of the Bank of America) Strike Last IV Probability 4 8 5.43 0.5813566 0.0000000 7 11 2.45 0.2868052 ...
3
votes
2answers
1k views

backtesting options strategies in R

I would like to backtest an options strategy in R. I require the ability to delta hedge and rebalance to options in the portfolio at different frequencies (daily, monthly,etc.) What packages are the ...
2
votes
1answer
133 views

VEC GARCH (1,1) for 4 time series

I have to estimate a VEC GARCH(1,1) model in R. I already tried rmgarch, fGarch, ccgarch, mgarch, tsDyn. Has somebody estimated a model like that? ...
1
vote
1answer
370 views

Is there a good backtesting package in R?

My model exports a vector that have for each day b-buy s-sell or h- hold it's look like this: sig [1] b b s s b b b s s b s b s s b s b s s s s b b s s b b b b b b s b b b b b b b I want to ...
0
votes
1answer
124 views

Constant decreasing volatility, GARCH forecasting

I am trying to forecast the volatility using GARCH modelling in R. I fit an ARMA(1,1)-GARCH(1,1) model, but my sigma predictions are constantly decreasing. Anybody know why? ...
4
votes
2answers
154 views

ruGarch - Interpret test results

I'm working on a R project, trying to calibrate a GARCH (so far, (1,1) ) model to the yields of the STOXX50 index over the last 2 years. I've tried the garch function of the tseries package, but it ...
3
votes
1answer
97 views

Density plot of the skew-t distribution

I am using the sgt package in R to recreate the plot from Hansen's paper ( available here http://www.ssc.wisc.edu/~bhansen/papers/ier_94.pdf on page 8) using random ...
2
votes
0answers
340 views

Any one know how to implement the Heston and Rouwenhorst country-sector effects regression in R?

Heston and Rouwenhorst (1994) devised an empirical estimation strategy to decompose stock returns into three components: a pure industry effect, a pure country effect, and a world-factor return. ...
2
votes
2answers
63 views

Problem with obtaining densities

For my research I need to obtain a series of densities, however, I am encountering some problems. The first problem is perhaps very simple, but the answer eludes me. Let's say I have an observation ...
1
vote
2answers
600 views

garchOxFit in R

Could someone please help me with trying to get the Ox interface to work in R. I followed the steps outlined in this paper (http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1752095), but I get the ...
1
vote
1answer
116 views

Understanding Yang-Zhang Volatility Estimator

I am using TTR in R and I am trying to understand the Yang Zhang volatility estimator. The following equations seem to imply a single value: $$ \sigma = \sqrt{{\sigma_o^2}+k\sigma_c^2+(1-k)\sigma_{rs}...
1
vote
0answers
74 views

Portfolio Optimization with equal weight for assets selected

I have a data frame of bets, with 1 being a win and 0 being a loss. These bets are correlated so I cannot just pick the highest winning percentage. Goal is to get 2 optimizations, 1 for max sharpe ...