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

learn more… | top users | synonyms

0
votes
2answers
102 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 ...
9
votes
3answers
246 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
13 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(?) ...
0
votes
0answers
17 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? ...
2
votes
0answers
58 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
191 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
166 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
66 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 ...
1
vote
1answer
56 views

garchOxFit in R-oxo file does not match

Could someone please help me with trying to get the Ox interface to work in R. I get the following errors as output: This version may be used for academic research and teaching only Link error: ...
0
votes
0answers
38 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 ...
1
vote
1answer
134 views

ARMA+GARCH prediction with package rugarch (R)

I am analyzing FTSE 100 series, from 2007-01-01 to 2010-12-31 (university exam homework). I have to use the data 'til 2010-11-30 as sample, and the remaining (23) observations as in-sample forecast ...
4
votes
1answer
80 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 ...
9
votes
4answers
534 views

Thesis using Momentum strategies in R, tips on good books, guidelines etc on how to do the programming?

I am quite new to R and will be doing an empirical analysis of momentum strategies in R using a dataset from the index OSEAX from 1980 to 2014. The momentum strategy will for the most part resemble ...
1
vote
0answers
86 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 ...
1
vote
1answer
226 views

Technical Analysis - OBV indicator calculation in R

Here is a few references about OBV calculations: http://ta.mql4.com/indicators/volumes/on_balance_volume ...
30
votes
7answers
4k 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 ...
7
votes
3answers
16k 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 ...
0
votes
0answers
28 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
90 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
4k 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
34 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
28 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 ...
1
vote
1answer
51 views

GARCH alpha equal to 0

I am estimating a GJR-GARCH(1,1) model with variance targeting in R. As data I am using returns on some stock indices. While calculating the GARCH models I obtain $\alpha=0$ for some indices. From ...
2
votes
2answers
51 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
51 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
540 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
51 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
109 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
96 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
473 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
16 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
30 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
41 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
45 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
83 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
351 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
49 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
46 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 ...
0
votes
0answers
31 views

CCC-Garch predict

So I'm trying to measure the VaR of 2 stock with a multivariate GARCH model, so im using the CCC model. I need to predict the standard-diviation and the mean but the ...
6
votes
2answers
196 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
525 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
949 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
46 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
266 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
195 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
308 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
16k 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
71 views

Imposing Restrictions on Cointegrating Vectors, R example

The code given below estimates a VEC model with 4 cointegrating vectors. It is a reproducible code, so just copy and paste into your R console (or script editor). ...
2
votes
0answers
61 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 ...
18
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 ...