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

learn more… | top users | synonyms

5
votes
1answer
152 views

DCC GARCH - Specificating of ARCH and GARCH parameter Matrices STATA

The command in STATA to calculate the DCC model of two variables is: mgarch dcc ( x1 x2=, noconstant) , arch(1) garch(1) distribution(t) $$ \begin{bmatrix} ...
3
votes
1answer
293 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 ...
3
votes
1answer
72 views

Return.portfolio error from PerformanceAnalytics package

When using the PerformanceAnalytics package of R, I am getting an error from the Return.portfolio function whenever I ask it to rebalance_on any frequency. If the rebalance parameter is removed, the ...
2
votes
1answer
83 views

Starting values for constrOptim() in R

I want to perform a constraint optimization for Maximum Likelihood Estimation in R to forecast volatility of returns. The probleme is that my initial values aren't in the permitted region. Is there ...
2
votes
1answer
91 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? ...
1
vote
1answer
62 views

Generating random yields

I would like to test different methods for fitting a yield curve, like the Nelson-Siegel, cubic splines etc. I would like to generate random yield to maturity data, that somehow reflects the common ...
1
vote
1answer
77 views

Is it possible to download stock-data countrywise with quantmod package for R?

Is it possible to download stock-data countrywise with quantmod package for R ? Hi, I'm wondering if it's possible to download equities countrywise. Let's say i want all data from the Finnish ...
1
vote
1answer
314 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 ...
1
vote
1answer
84 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
1answer
40 views

Vasicek yield curve

Term structure is determined by a two-factor affine model (Vasicek). Using the monthly swap market data, we fit the model to match exactly the one-year and ten-year points along the swap curve ...
1
vote
0answers
170 views

RCaller & RQuantlib error in java

I am receiving the following error: ...
1
vote
0answers
443 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
541 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
0answers
8 views

Converting a factor vector in R

If I have a factor vector with 3 levels, "", "No" and "Yes" how can I convert this to a binary factor vector with "na" if no answer , 1 for "Yes" and 0 for "No" ?
0
votes
0answers
10 views

R:log return calculation for panel data structure

I have a long form panel for hourly prices of stocks. I want to do log return calculation for this panel data structure. Below is my code: ...
0
votes
0answers
19 views

How to Download Benchmark Weights in R on daily basis?

I would like to download benchmark weights on a daily basis in R for NSE Stock Exchange. Do we have any package in R for the same. If yes, then please help out with example code.
0
votes
0answers
59 views

Update Daily price from yahoo in R

I am trying to update daily prices from yahoo via below R code, but code is not working properly and i am not getting any error as such. One can see the reference code at following link. ...
0
votes
0answers
28 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
47 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

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
43 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
29 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
39 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
36 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
48 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
51 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
26 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
51 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
42 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
51 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
38 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
77 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
162 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
23 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
0answers
29 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 ...