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

learn more… | top users | synonyms

0
votes
0answers
22 views

Java Implied Volatility Solving

After using RQuantLib and RCaller from Java I am desiring a bit more speed on my implied volatility calculations (for anyone who has used this knows it is quite slow). I need to price a large number ...
0
votes
0answers
22 views

How to augment lpsolve R optimization solution to run on a hadoop cluster? [on hold]

I posted this question initially on stackexchange.com...posting it here as that was suggested to me on stackexchange website I am using R lpsolve package to optimize my transportation model. My code ...
3
votes
1answer
141 views

quantiative risk measure how they are implemented in R and their use

So far I have just theoretical knowledge of risk measure and never used them in application. Therefore I have some basic question how risk measures are used in reality and how they are implemented in ...
0
votes
1answer
60 views

I want to keep a column in getSymbols or get.hist.quote with the Date as as.Date format [closed]

I use getSymbols to download historical information over an environment with 200 tickers but I cannot seem to keep the date information from becoming an index. I ...
2
votes
0answers
69 views

What R-packages for SOCP problems are there?

Currently, I am looking deeper into the topic of second-order cone programming. Could you suggest packages that solve SOCP-problems in R? With your answer, please provide a short description of ...
0
votes
0answers
159 views

IB with R which package?

I want to implement my models in R and trade according to them with my IB account. Now I am wondering, how I should solve this problem? Do I need to program with C an access ...
3
votes
1answer
156 views

Calculating and interpreting cumulative returns is R

I have buy and sell signals,and accordingly, I artificially generate a signal series,for which,I assign 1 to every buy and -1 to every sell: ...
2
votes
3answers
490 views

Library for interactive financial charts

For my recent project I am looking to build a software capable of visualizing financial charts in a dynamically and interactive matter. The workflow is as follows: I gather data from my data ...
2
votes
1answer
249 views

Interpretation of cross-correlation matrix when one sample distribution is not normal

I am looking at the variance of (log) price changes in securities vs. the amount of social media discussion about them. I'm not interested in building a model. I'm just looking to see if there is a ...
0
votes
1answer
159 views

How to plot custom hourly data into R with quantmod?

I'm trying to get into R because for some personal project, I need R and quantmod to create OHCL charts for me. I'm stuck at the candleChart creation step, and I'm not sure I understand why. Using a ...
2
votes
1answer
526 views

ADF test in R yielding perfect cointegration. How is this possible?

I am using the famous conintegrated pairs tutorial to just different stocks for cointegration. The adf.test yeilds perfect cointegration, which I feel must be incorrect. Here is why: When I run ...
3
votes
0answers
435 views

What is the best solution to use QuantLib within Excel?

Excel is likely the most widespread instrument across all not-only-quants desks; in addition, we have to keep in mind that Bloomberg and Reuters allow to easily import real time data in Excel, and ...
4
votes
1answer
182 views

Definition of gearings, spreads and curve in RQuantLib's Floating Rate Bond function

Consider the RQuantLib package function FloatingRateBond(). This takes as inputs gearings ...
2
votes
0answers
364 views

FIGARCH estimation in R

I am trying to estimate a FIGARCH(1,1) model in R for Value-at-Risk purposes. As I understand it, the rugarch package does not support FIGARCH or FIEGARCH. To that end, I used the garchOxFit function ...
7
votes
3answers
1k views

R: Fast and efficient way of running a multivariate regression across a (really) large panel (First pass of Fama MacBeth)

I am attempting to run a rolling multivariate regression (14 explanatory variables) across a panel of 5000 stocks: For each of the 5000 stocks, I run 284 regressions (by rolling over my sample ...
0
votes
2answers
210 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 ...
3
votes
0answers
226 views

Definition of risk factors for market risk scenario testing

I am doing a research for stress testing in market risk. The usual process I found out for scenario testing is: Define risk factors upon the portfolio Define the desired scenarios Vary the risk ...
4
votes
1answer
568 views

Cointegrating relationships - Johansen in R

I read the posts, How to interpret results of Johansen Test? and How to interpret the eigenmatrix from a Johansen cointegration test? But still I am quite confused by the output. I have a project with ...
7
votes
0answers
646 views

Tools/R code for predicting Dragon-Kings

The theory of the so called Dragon-Kings, esp. by Didier Sornette (ETH Zürich), basically states that financial crises and crashes are predictable (contrary to the theory of black swans). The ...
2
votes
1answer
451 views

Counterintuitive time varying Beta with Kalman filter

If you're used to play with R, you'll enjoy the following reproducible code: ...
1
vote
0answers
72 views

RCaller & RQuantlib error in java

I am receiving the following error: ...
2
votes
2answers
282 views

Loading HF stock data into excel

Are there any free, open source VBA addins or R packages that can be linked using the yahoo finance/Google finance/other data sources api to continuously download intraday data into excel or R? ...
10
votes
1answer
264 views

Is creating constrained random portfolios a hard problem?

Creating random portfolios with weights $x_i$ can be thought of as sampling from the surface of a simplex given by $$Ex = f$$ and $$Ax \le b$$ Where $E$ and $A$ are constraint matrices for equality ...
2
votes
0answers
127 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. ...
1
vote
0answers
32 views

How to set up Heston and Rouwenhorst regression? [duplicate]

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
0answers
102 views

How to simulate a Geometric Binomial Process with state/tie dependent increments?

I want to simulate a geometric binomial process with state/time dependent increments. So the model is given by \begin{align}R_t=\frac{X_t}{X_{t-1}}\end{align} \begin{align}P(R_t=u)=p(X_{t-1},t) ...
2
votes
2answers
492 views

RQuantLib, Hoadley and Bloomberg YAS: fixed rate bond pricing differences?

I'm trying to price a fixed rate bond one year from now on. The bond is the PEUGOT 7 ⅜ 03/06/18, whose ISIN code is FR0011439975. I'm using such a specific example because in this way everyone can ...
2
votes
2answers
720 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 ...
6
votes
1answer
972 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 ...
8
votes
1answer
201 views

rugarch: Joint estimation leads to different results

I want to fit an ARMA-GARCH model to my data using rugarch package in R. First of all, I look at the acf and pacf: ...
1
vote
0answers
239 views

Interpolate option volatility in delta space in R

I have a bunch of deltas and option implied vols at those deltas. I would like to interpolate them in R. Interpolating them in delta space seems difficult, since normally you would like the ATM calls ...
3
votes
0answers
124 views

RQuantLib: any difference between FixedRateBond() and FixedRateBondPriceByYield() with flat term structure?

Please, consider the following functions from RQuantLib package: FixedRateBond() ...
2
votes
0answers
231 views

Philips-Ouliaris test for cointegration

I'm trying to implement cointegration tests using the R urca package. I've figured out the Johansen test (ca.jo), but I'm having trouble with the Philips-Ouliaris test (ca.po). I have two questions: ...
4
votes
1answer
307 views

analyze strategy performance with given matrix of weights/time and weekly returns in R

I have a matrix of 259 weekly returns, 50 assets and a portfolio composition for each of the 259 weeks. I would like to test the performance of the portfolio during 52 weeks, rebalancing every 12 ...
2
votes
0answers
185 views

Error term/Innovation process in ARCH/GARCH processes?

I am wondering about the distribution of the error term/innovation process in a ARCH/GARCH process and its implementation, I am not sure about some points. The basic assumption is ...
1
vote
0answers
496 views

portfolio optimization with a loop

I am attempting to minimize the variance of a 3 stock portfolio using optimization within a loop. What I have done is calculated the stock returns and cov matrix from dates 1980-01-01 to 1989-12-31 ...
2
votes
2answers
2k views

Cointegration tests

I'm trying to figure out how to perform cointegration tests in R between 2 time series. I'm using po.test from the package ...
2
votes
0answers
91 views

What does negative gamma mean in APGARCH model?

I got a gamma of -0.1321677. ...
3
votes
2answers
482 views

Fitting distributions to financial data using volatility model to estimate VaR

I want to fit a distribution to my financial data using a volatility model to estimate the VaR. So in case of a normal distribution, this would be very easy, I assume the returns to follow a normal ...
5
votes
2answers
2k views

Using variance ratios to test for mean reversion

Can you use the variance ratio test to determine whether or not a time series is mean reverting? I'm using the Lo.Mac function in the ...
2
votes
1answer
260 views

Stepwise Cointegration

This is more of a general question at this point, but if my thought process makes sense I will follow up with an R implementation. I have read a number of papers on cointegration analysis for pairs ...
2
votes
0answers
313 views

Markov-Switching E-GARCH with R

I am looking for a R library for modeling a Markov-Switching E-GARCH process. In other questions at StackExchange related to GARCH models, the package rugarch is often mentionned. Do you recommend it ...
1
vote
0answers
339 views

R ARMA-GARCH rugarch package doesn't always converge

I'm trying to compute the standard ARMA(1,1)-GARCH(1,1) as shown in this answer for an entire index,just to store in a database to quickly lookup values for back ...
10
votes
1answer
285 views

A non parametric study of VaR with kernel density

I'm working in order to compare the calculation of the VaR between the methodology of copulas and kernel density, all this by using the software r. The process that I follow is: Obtain a sample ...
3
votes
2answers
5k 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 ...
8
votes
3answers
1k views

Hidden Markov Model & Its Application

I have started reading about HMM it gives an intuitive idea about what HMM is all about. I am looking out for example where its applied to Equity model using R / Excel. The material which I read so ...
3
votes
2answers
507 views

Using the termstrc package in R

I am attempting to use the function estim_nss from the termstrc package in R to find the spot curve from constant maturity rates published by the Fed. I am using this package because I will need to ...
0
votes
2answers
5k views

Kalman Filter Equity Example

I am looking out for some material where I can study about Kalman Filter applied to Equity using Excel or R?
8
votes
2answers
289 views

GBM 3d plot with R

I want to plot the density of the GBM in a 3d plot. So I have on one axis the stock price, on the other the time and on the z axis the density. At the end I want to produce this graph. The formula I ...
3
votes
3answers
549 views

Generate tick data from candlestick

Is there software (or Python / R / ... scripts) to generate (pseudo) tick data from candlestick data. I have candlestick data (CSV format) from monthly timeframe (MN) to minute timeframe (M1) but ...