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

learn more… | top users | synonyms

2
votes
0answers
55 views

negative transition probabilities in the heston model

I've been trying to implement a bivariate tree for pricing american options with the heston model in R using the paper of Beliaeva and Nawalkha ...
2
votes
3answers
649 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 ...
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 ...
1
vote
1answer
77 views

Stress Testing Methods

I'm working on the following task: Given quarterly data: a time series representing the 1-year realized (10 years of data) rates of default on a portfolio of mortgages a slew of ...
4
votes
3answers
133 views

multiperiod optimization using R

I'm interested in multistage optimization problems. Are there any good R packages around to solve such problems over time? I'm not at all an expert in it, so maybe someone knows a good paper / lecture ...
1
vote
1answer
42 views

Is there a way to adjust R PerformanceAnalytics function VaR with EWMA or GARCH method?

Is there a way to upgrade R PerformanceAnalytics function VaR with more risk sensitive approaches like EWMA or GARCH? Or is there another R package which can handle the issue?
3
votes
3answers
803 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 ...
0
votes
0answers
33 views

Asian option numerical pricing method generates a negative time value

I use R to write a function which simulates price path and calculates the value of an arithmetic Asian option. I found sometimes the value of the option can be lower than its intrinsic value, i.e., ...
6
votes
2answers
235 views

How do Return.portfolio and Return.rebalancing work in Performance Analytics in R?

I have a question about the function Return.portfolio/Return.rebalancing from the Performance Analytics package in R. I take ...
1
vote
0answers
94 views

one-step-ahead Stochastic Volatility for 5-minute VWAP prices

I'm trying to run an SV model against prices of Euro/USD. For those not familiar with SV, its a volatility model in which each point gets its own volatility parameter $h_t$ with 3 main parameters that ...
2
votes
1answer
472 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 ...
0
votes
1answer
81 views

Integrating R with Bloomberg

In the past, I have used the package RBloomberg to directly pull bloomberg data into R. I've also seen it go by the names Rbbg or R[Name Redacted]. It seems to me, however, that this package no longer ...
4
votes
1answer
174 views

Popular R packages for Quantitative Finance

Which R packages (in this list or not) do you use in quant finance, why not an alternative, do you use it in production and if so, how? There is a list of most of the R packages related to Finance by ...
3
votes
2answers
243 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: ...
3
votes
3answers
373 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? ...
4
votes
1answer
690 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 ...
3
votes
0answers
185 views

Kelly Capital Growth Investment Strategy (Example in R)

In the paper Response to Paul A Samuelson letters and papers onthe Kelly Capital Growth Investment Strategy pages 5 and 6 Dr William T Ziemba, gives a praticle example on Kelly Growth. I’m trying to ...
8
votes
4answers
2k 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 ...
1
vote
1answer
89 views

Plot Evolution of portfolio weights over time in R [closed]

Is there any function for plotting the evolution of portfolio weights over time in r?. I have a matrix of portfolio weights from an equal weighting strategy at rebalancing times and want to plot ...
4
votes
3answers
7k 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 ...
1
vote
0answers
80 views

The option values are different from two r package - foptions,rquantlib

The results are very different.I know the code from quantlib and the result of quantlib seem right(close to market price). Is there anyone know why the value from fOptions is so large or fOptions used ...
1
vote
0answers
118 views

trading strategy outperforms passive strategy in absolute terms, but in returns vice versa. how could this be?

Background: I want to compare two trading strategies in term of profitability. The red one is an active trading strategy, which involves many entry and exit to a specific market. The blue one is a ...
3
votes
1answer
251 views

GARCH(1,1) good fit found, how to predict one day volatility ahead?

I used SPY data to fit GARCH(1,1) in my model. My data starts from Jan, 2000 until Dec, 2013. I compared the volatility using runSD on the 21 rolling window and GARCH(1,1). It looks a pretty good fit ...
1
vote
0answers
35 views

rugarch and rolling estimation

I use Rugarch for a long time in order to calibrate GARCH models on FX rates time series and perform simulations. I am trying to understand the ugarchroll method. However even if I can find plenty of ...
0
votes
0answers
113 views

Calculating the VaR from a GARCH(1,1) with Student-t innovations

I'm self-studying several questions on Ruey S. Tsay's teaching page. I'm experiencing some difficulty getting the correct answer for final exam 2013 Problem B Question 3. Given a Student-t GARCH ...
3
votes
1answer
115 views

Hidden Markov Models methods for selecting optimal number of states

Package RHmm (R) I have a vector which I fit into a hmm model in an attempt to select an optimal number of states for a hidden markov model. ...
1
vote
1answer
476 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 ...
0
votes
0answers
148 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 ...
3
votes
1answer
204 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 ...
16
votes
6answers
4k 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 ...
3
votes
1answer
1k views

Valuing Total Return Swaps

In my quest for simulated data, I am trying to generate prices for Total Return Swaps by calculating the NPVs of the fixed and floating leg. My problem: Given the fixed leg, how do I set the spread on ...
9
votes
1answer
304 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 ...
0
votes
1answer
119 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 ...
3
votes
1answer
333 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
94 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 ...
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 ...
0
votes
0answers
204 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 ...
5
votes
3answers
8k views

Calculating log returns using R

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 ...
2
votes
1answer
286 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 ...
36
votes
11answers
13k 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 ...
0
votes
1answer
235 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
969 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 ...
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 ...
5
votes
1answer
240 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 ...
3
votes
0answers
507 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 ...
10
votes
1answer
315 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 ...
18
votes
3answers
1k 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 ...
0
votes
2answers
309 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
264 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
946 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 ...