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

learn more… | top users | synonyms

1
vote
0answers
228 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 ...
1
vote
1answer
273 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 ...
1
vote
0answers
231 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 ...
1
vote
0answers
704 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 ...
1
vote
0answers
169 views

RCaller & RQuantlib error in java

I am receiving the following error: ...
1
vote
0answers
35 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. ...
1
vote
0answers
440 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 ...
1
vote
0answers
540 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 ...
1
vote
0answers
2k views

Backtest pair trade strategy in R

I am looking for some tips on how to run a simple backtest on a pairtrading strategy intraday using eg. 30minute bars. I have calculated the spread, ...
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
2answers
578 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 ...
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 ? ...
0
votes
1answer
472 views

Portfolio optimzation : efficient frontier with respect to risk aversion parameter with R

I am currently trying to write a little script in R to determine the optimal weights given a fixed risk aversion parameter. The problem I have is that by increasing the risk aversion parameter I think ...
0
votes
1answer
678 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 ...
0
votes
1answer
453 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 ...
0
votes
1answer
41 views

How to create time series with lagged in R [closed]

Would anyone else advise me, how to create time series with lagged in R. I would the result is the difference with lagged, there is a function Delt() but the result is the percentage change. Please ...
0
votes
1answer
154 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: ...
0
votes
1answer
115 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? ...
0
votes
0answers
27 views

Scraping options data and returning ticker symbols of companies meeting certain criteria [on hold]

This is my first post on this site and I am looking forward to becoming more involved as my skills in coding increase. My first questions involves scraping options (calls and puts) data from the web ...
0
votes
0answers
26 views

Evaluation of Bayesian GARCH

I am using the bayesGARCH package to estimate Bayesian GARCH models and I was wondering how to evaluate them in terms of precision of forecast or at least the quality of the model. I have encountered ...
0
votes
0answers
36 views

Package for multivariate Garch Vech model for R?

I`m new to programming and searching a package for R which inherents the estimation for a Vech Garch(1,1). This is a multivariate Garch model which forms the residuals and the covariance matrix from a ...
0
votes
0answers
13 views

Optimize a function in R [migrated]

I was looking since a long time for a programm code that optimize a parametric portfolio (a parametric portfolio is a portfolio whose weights depend on state variables). Recently, I received the ...
0
votes
0answers
9 views

How to set the mean matrix in fPortfolio package in R

I'm doing a mean-variance analysis of 5 ETF's and insted of using the sample mean i used a time series model to forecast it. I want to do a backtest of a tangency portfolio getting the weights with ...
0
votes
0answers
30 views

How to work with two instruments in quantstrat [on hold]

I'm new to quantstrat. I would like to know how I can work with two instruments at the same time? For example ...
0
votes
0answers
37 views

Spread Return and Mean Reversion Model

http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2399915 The above paper proposes an interesting method for modeling credit spreads. I have tried to implement it in R but keep obtaining unrealistic ...
0
votes
0answers
28 views

Calculating returns when number of securities in a timeseries varies over time?

I have a timeseries of security returns in which the number of securities in the timeseries varies over time. More specifically, I have a universe of events where securities(their returns) are added ...
0
votes
0answers
38 views

How to estimate Simple Returns and Monthly Returns from daily stock price observations with Missing data in R

I have a data frame which has over 4000 columns and 3000 rows. Columns are companies and rows have daily stock closing price. The data is such that it has missing values but due to nature of the data ...
0
votes
0answers
33 views

Is there any function in quantmod to get Earning Date from Yahoo or Google

I want to get the a stock's next earning date from quantmod. I tried my best to go through the quantmod documentation to find such function. Pleae help me. Thanks
0
votes
0answers
43 views

Where and how can I get FX intraday data for use it in R?

I need FX data (the most accurate possible) for use in R. Right now I have developed a script in Java to download the CSV file (from Oanda) and use this file to read it in R, but I think that is a ...
0
votes
0answers
49 views

VECM model with GARCH (1,1) error in R

I should create a VECM model with 8 lags and with Garch (1,1) error in R but i don't know how to do it and which package to use. The VECM should also have covariates in it. Then I should perform a ...
0
votes
0answers
24 views

Generating random numbers from the skew-t distribution

in another question I was trying to replicate density plots using random numbers coming from the skew-t distribution of Hansen (1994). Now I need to obtain a series of random numbers coming from this ...
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 ...
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(?) ...
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 ...
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 ...
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 ...
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 ...
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 ...
0
votes
1answer
50 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 ...
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 ...