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

learn more… | top users | synonyms

10
votes
3answers
350 views

Is there a website that lists replication code of financial papers?

There are lot of questions on this website related to the replication of the empirical part of financial papers. I noticed that some (honest) authors provide on their personal website some ...
0
votes
0answers
46 views

VAR(1) - GARCH(1,1) model estimation in R

Can someone please help in explaining the steps involved to estimate the parameters of VAR(1)-GARCH(1,1) model of Mcaleer 2003 in r. It is a multivariate GARCH model where the mean equation is ...
1
vote
2answers
104 views

Stochastic process theory question

*S follows a process $dS= mSdt + oSdz$ where m and o are constant. What is the probability followed by $ Y=(Se)^{(r-t)} $. If S follows a process $ dS= k (b-S) dt + oSdz $ where k, b, o are ...
0
votes
0answers
39 views

Rblpapi millisecond resolution

I'm using Rblapi to get tick data, using the nice getTicks function. Much to my dismay the index is rounded to the second, while milliseconds time stamp could be provided. Tried returnsAs xts, fts(?) ...
2
votes
0answers
73 views

Liquidity Adjusted Asset Pricing Model

I have a data set with 4000 companies and I have calculated a liquidity measure of each of the company in the dataset as Where, Turnover is the monthly average ratio of daily volume to shares ...
1
vote
1answer
256 views

Portfolio Management in R

I’ve been looking around for a R-package that will allow me to track my stock portfolio - basically I would like to enter stocks that I own, track the trades I make, calculate my open position & ...
6
votes
1answer
265 views

R Backtesters: Quantstrat vs SIT

I am learning R, and want to start using a backtester. I have spent about a day reading all I can about R backtesters, and it seems there are 2 main contenders: quantstrat, which uses the packages ...
0
votes
1answer
91 views

Log daily returns of multiple securities for multiple time period in R

I have dataset containing daily closing prices of 5413 companies from 2000 to 2014. I want to calculate daily log returns for the stocks as according to dates as log(Price today/Price yesterday). I ...
0
votes
0answers
49 views

Need to know What is not available in RQuantlib

If we explore CRAN RQuantlib package it says The 'RQuantLib' package makes parts of 'QuantLib' accessible from R. When I tried the package I have found vanilla/some exotic options, fixed income ...
4
votes
1answer
93 views

Calculate mean variance portfolio

I am trying to calculate the mean variance portfolio using the plug-in approach. First I generate some artificial data: x <- replicate(10,rnorm(1000)) Then I ...
1
vote
0answers
90 views

Generating financial data

I am trying to generate monthly stock data using a one-factor model: $$R_{a,t} = \alpha + BR_{b,t}+\epsilon_{t}$$ The description says: $R_{a,t}$ is the excess asset returns vector, $\alpha$ is the ...
33
votes
7answers
6k views

Is R being replaced by Python at quant desks?

I know the title sounds a little extreme but I wonder whether R is phased out by a lot of quant desks at sell side banks as well as hedge funds in favor of Python. I get the impression that with ...
0
votes
0answers
35 views

How to form Decile Portfolios based on Liquidity measure with missing data in R

I have a dataframe with over 4000 companies data (as column) and have calculted their daily Quoted spread measure ( measures liquidity for each stock) for 15 years. And then from the daily have ...
2
votes
2answers
136 views

Augmented Dickey-Fuller Test/ Unit Root test on multiple time series dataframe in R

I have a dataset/dataframe in which I have calculated the daily log returns of five thousand companies and these companies are as column as well. I want carry out ADF test on this dataframe. I have ...
5
votes
1answer
5k 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
72 views

Forecasting conditional variance using fGARCH

I am forecasting the conditional standard deviation using ARMA(1,0)-GJRGARCH(1,1) in R using the fGarch package. Here is a sample code: ...
0
votes
0answers
31 views

In what situations would cross validations scores be inaccurate?

I'm trying to fit a SVM model on times series stock return data, predicting a buy, hold, or sell signal of the stock. I'm using 10-fold cross validation (using the R package ...
2
votes
2answers
58 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
0answers
101 views

Skewed Generalized Error Distribution's (SGED) pdf

I want to use the SGED distribution of Theodossiou for GARCH estimation, however, I am struggling to understand which is the correct pdf function of the distribution. Let me just say that the ...
2
votes
3answers
671 views

Daily option data

I am wondering where I can pull daily (hourly, by-the-minute, etc. even better) option data for a particular underlying. I would prefer a database I could scrape through and API, but would not mind ...
0
votes
0answers
138 views

Forecasting conditional mean in ARMA-GARCH model (R/Matlab)

I am trying to forecast the conditional mean from a ARMA(1,0)-GARCH(1,1) model. The mean equation in my model is: $x_t = \mu + \delta x_{t-1} + h_t \epsilon_t$ where x is the variable (a return ...
2
votes
1answer
244 views

Portfolio Analytics Optimization

I have a large dataset, 10,000 investments I am trying to create an optimized portfolio for. The portfolio has 3 restrictions. Long Only, Only 50 assets can be selected and every invested asset has ...
0
votes
1answer
156 views

Transforming daily simple returns into weekly

I am trying to transform daily simple returns into weekly returns. I am using the following R code: ...
6
votes
2answers
585 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 ...
0
votes
0answers
22 views

Download DGS3MO from FRED with getSymbols - error

I follow the course "Mathematical topics in finance" from MIT courseware. I opened R and rendered Dr. Kempthorne's Case Study 3: Time Series from September 30, 2013 I am able to render the code and ...
0
votes
0answers
35 views

Solving inequality constraint

I am trying to solve the following inequality constraint: Given time-series data for N stocks, I am trying to construct a portfolio weight vector to minimize the variance of the returns. the ...
1
vote
0answers
54 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 ...
2
votes
1answer
57 views

Estimating Carma(2,1) parameters (using yuima package)

I am very new to R, and particularly to the yuima package, so I was hoping someone would be able to help me. I have some data (daily prices) that I wish to fit to ...
3
votes
2answers
102 views

Sobol numbers in monte Carlo simulation

I wanted to figure how how much faster the Sobol quasi random numbers convergence to the B&S call price compared with pseudo random numbers. To generate the Sobol numbers I used the randtoolbox in ...
3
votes
3answers
565 views

Any package to run VAR-GARCH or VECM-GARCH models in R?

I need to estimate a multivariate VECM-GARCH (or simply VAR-GARCH) in R. Browsing on the internet, I did not find anything yet. Do you know if such kind of packages exists? Please, note that a BEKK ...
1
vote
1answer
91 views

Anomaly or feature from Quantmod in R regarding getFX - currency data

I am using R to analyse stock data, using the quantmod package to get all sorts of data, but here specifically FX data using the function ...
1
vote
1answer
62 views

MSRV estimation in R

What are the R packages that let you estimate Multi Scale Realized Volatility (MSRV)? So far I've only found highfrequency (which comes with Realized Kernel as well), but from what I understand it ...
6
votes
2answers
240 views

Is it too important that my residuals be normal? I am Using an ARMA/GARCH model

I am trying to fit an ARMA/GARCH model to a time series. I found that the best candidate is an ARMA(1,0) + GARCH(1,1) with gaussian white noise It has coefficients with p-values near cero and the ...
0
votes
2answers
579 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 ...
4
votes
0answers
1k 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 ...
2
votes
0answers
61 views

Behaviour of out of sample efficient frontier

I am comparing the efficient frontier of a set of portfolios that are in and out of sample. The first period is from 1991-01-03 until 1992-10-03 and the second one from 1992-10-03 until 1994-03-03. I ...
3
votes
1answer
300 views

Stochastic Volatility CIR estimation

Would anyone have a code (pref. Matlab or R) for any type of estimation (QML, GMM) not using option prices of a stochastic volatility model driven by a CIR process described below? \begin{equation} ...
2
votes
1answer
269 views

How to create a basket of currency pairs with the lowest correlation in R?

My strategy is designed to buy and sell all assets of a universe and rebalance periodically. It goes either long or short. To limit risk exposure to a single currency I would like the assets in the ...
6
votes
2answers
340 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. ...
42
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 ...
2
votes
0answers
75 views

Gaussian Time-varing copula in R

I want to estimate the parameters of time-varing Normal Copula using R. A bivariate Normal copula is defined as following: The dynamic equation of dependance parameter ρ is : So I need the ...
19
votes
8answers
6k 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 ...
20
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 ...
1
vote
1answer
246 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 ...
2
votes
2answers
157 views

What are the advantages of financial modelling in R? [closed]

Recently I've found out that quantitative department in my company uses mostly R software for modeling in general. What is the advantage of modeling financial data in R instead of Excel, or some ...
2
votes
0answers
40 views

Rollapply: what does by.column do? [closed]

I have read the description of by.column for rollapply in the manual but i couldn't understand how to use it. see below: x=matrix(1:60,nrow=10) ...
1
vote
0answers
40 views

RQuantLib FixedRateBondPriceByYield() Non-tradable error

How do I use FixedRateBondPriceByYield() function on maturity date that is earlier than today? I get "non tradable error" when applying on date older than today. ...
0
votes
0answers
28 views

Luis Torgo - Case Study, Function creates high leverage

I am doing Luis Torgo Case study - Predicting Stock Market Returns and I have a problem when I use the function trading.simulator in the package DMwR ...
0
votes
1answer
67 views

Binary Option valuation problem in R using RQuantLib; also result validation aspect

When I am trying to value Binary Option using RQuantLib I am not getting all the greeks for exctype "american" wheras "european" exctype is fine. What is the problem here ? ...
2
votes
2answers
104 views

What do you do with low r-squared when calculating high-frequency beta

I am calculating a high-frequency beta. For example I have 90 days of data of the S&P and GOOGLE and I have 10-minute percent returns for each instrument. Each day has 34 10-minute percent returns ...