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

learn more… | top users | synonyms

0
votes
0answers
30 views

Ledoit-Wulf portfolio strategy calculation

I am trying to implement the Lediot-Wulf portfolio strategy on a real-world stock dataset. ...
3
votes
1answer
54 views

Tools/R-code to create gain/loss-asymmetry plots

The gain/loss asymmetry is a well known stylized fact: It basically states that real financial time series take longer for going up than going down. To detect it a heavy statistical machinery is ...
0
votes
1answer
45 views

FORECASTING Model AR(1) in an Autoregressive Form The Pi´s Parameters

Ive been implementing a little exercise to obtain the first 2 forecasting points of an AR(1) process. And i want to have the forecasting ponts using the three forms: Im folowing this pdf ...
2
votes
1answer
100 views

Rebalancing portfolio weights

I have a matrix of returns and weights for every time period. ...
3
votes
1answer
113 views

Are all stocks and stock indexes just white noise

In the paper Super-Whiteness of Returns Spectra from Erhard Reschenhofer of University of Vienna it is commented the following "Until the late 70’s the spectral densities of stock returns and stock ...
2
votes
1answer
75 views

Fit linear model to higher moments of CAPM

How can one fit a linear model to the higher moments of CAPM in R? Fitting a linear model to the second moment (classical CAPM) would be ...
0
votes
0answers
37 views

Issues with +100 symbols in Quantstrat, Erratic Trades

I've tested my code against individual symbols and very small groups of symbols. I'm finding the more symbols I add the fewer trades I get. For instance, if I just include the first five symbols, all ...
0
votes
0answers
41 views

Forecast of ARMA-GARCH model in R

I managed to forecast a GARCH model yesterday and run a Monte Carlo simulation on R. Nevertheless, I can't do the same with an ARMA-GARCH. I tested 4 different method but without achieving an ...
-2
votes
0answers
16 views

Any package to run BEKK-GARCH-X models in R [duplicate]

I tried using a package called mgarchBEKK (or mgarch) to estimate a VECM-GARCH model with a BEKK approach. It seems like the package firstly estimates the VECM model, then uses the residuals (Epsilon ...
0
votes
2answers
50 views

How to get list of all symbols in fred database?

I am trying to query every single series in the fred database using r. I have checked out both the quantmod and fImport packages, and they work fine, though it seems that quantmod fits my use a bit ...
0
votes
0answers
23 views

Interpretation of Johansen cointegration test in R

I am using urca package of R for Johansen Cointegration test in 2 stocks datas( A and B. My question is very elementar, but have cause some problems for me. How I interpret the critical values, for ...
0
votes
1answer
51 views

how do I loop through all the stocks with quantmod and ttr?

I just started with quantmod package. If I want to select stocks based on their recent performance, then I need to loop through all the stocks in, say, NYSE. So I need: get all the stock symbols ...
0
votes
0answers
31 views

How to construct a cointegrating vector using more than 2 price series in R?

I use now this code from hier Why does the following data fail my cointegration test? with slightly modification of possibility to load something directly from Dropbox file storage . ...
2
votes
2answers
71 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 ...
0
votes
2answers
92 views

Fractals indicator (Bill Williams) R Quantstrat

Hi has anyone seen or know how to create an indicator for fractals in quantstrat? fractals explained http://forex-indicators.net/bill-williams/fractals example code (only interested in type 1 ...
0
votes
0answers
40 views

Can you tell me what this RBloomberg formula means?

I've been asked to re-create a spreadsheet that used RBloomberg using a different data source. But I'm having trouble figuring out exactly what one of the spreadsheet's formulas does. Can anyone tell ...
4
votes
2answers
184 views

good R package for vectorized option pricing

I am using for now the package fOptions but it doesn't allow for vectorized computation of black76 prices and delta. Which package can be used to do that? As noted ...
0
votes
1answer
57 views

Accuracy of GARCH& ARCH forecast

I'm learing ARCH&GARCH model. I have four questions that I don't know the answers 1st: ARCH & GARCH are often used to evaluate equities. Does it mean that ARCH and GARCH are fitter for high ...
2
votes
1answer
41 views

VaR calculation accuracy/comparison/effectiveness through different R packages

My question is what would be the better( in terms of estimation accuracy) method of VaR calculation among below two:, also any small code snippet will be great as a starting point for me. 1st method: ...
3
votes
1answer
89 views

Simulate (imaginary) asset prices using random numbers that follow a Frank Copula

I didn't understand how to simulate asset prices by using non normal random numbers. I am assuming that it would be incorrect to use the standard Geometric Brownian Motion, since it is based solely ...
0
votes
1answer
31 views

Diebold-Mariano test

I am trying to use the Diebold-Mariano test but it doesnt work for some reason. Here is my code: dm.test(maegarch14,maeegarch14,h=126) where ...
-3
votes
1answer
62 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
1answer
25 views

Residuals in the Ljung box test

does anybody know what type of residuals is used in the Ljung box test in R? raw or standardized? Because basically when I fit a GARCH model using garchFit, the summary() function gives me all the ...
1
vote
1answer
79 views

Forecasting using GARCH in R

I am using the predict and ugarchforecast functions in R. When I fit my models and try to forecast, I get either only increasing or decreasing values for sigma, does anyone know why? Thank you ...
1
vote
0answers
97 views

GARCH modelling and forecasting

I have a few questions regarding GARCH modelling and forecasting and it would be great if someone could help me. I am modelling the log return of oil spot prices using various GARCH models: GARCH, ...
0
votes
1answer
81 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 ...
4
votes
2answers
223 views

R package for portfolio

In the context of modern portfolio theory, one often wishes to minimise $\mathbf{w}^{\mathrm{{\scriptstyle T}}}\boldsymbol{\Sigma}\mathbf{w}$ subject to $\mathbf{w}^{T}\boldsymbol{\mu}=c_{1}$, ...
17
votes
5answers
1k 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 ...
3
votes
0answers
71 views

Computing Value at Risk for portfolio in R

I know how to compute VaR with long positions using PerformanceAnalytics. What about a portfolio consisting in two equities A and B, 100 USD long positions in each, and 2 stock options for the same ...
0
votes
0answers
29 views

comparison of speech signal processing and financial data

I have read that in speech signal processing analysis when voice is segmented in brief temporary segments the series segments transitions from being non stationary to stationary. My question is if ...
1
vote
2answers
136 views

Kalman filtering

Is it possible to the extract the latent factor f from the following equations using kalman smoothing? f is the unobserved state value while z is observed series. From the literature i could read ...
0
votes
1answer
83 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 ...
2
votes
1answer
122 views

rollapply with Arima model: testing for stability of coefficients

I am trying to fit an arima model on a rolling window using rollapply.My aim is to plot a graph of the evolution of the coefficient, plot the error and the standard deviation. well i encountered the ...
2
votes
1answer
94 views

out-of-sample variance using rolling window

I am currently working on the comparison of the constructed portfolios using out-of-sample variance criteria. I am going to use rolling window procedure for the comparison. First, I choose a window ...
1
vote
3answers
127 views

Building custom indices; getting data from web; stats analysis; Python or R?

I would like to build a couple of custom indices. I would like to be able to enter ticker(s) into an input and have ohlc, volume, qualitative ...data downloaded from yahoofinance, google finance, ...
2
votes
2answers
78 views

Calculate efficient frontier using fPortfolio with incomplete set of returns

I want to calculate the efficient frontier for a set of 140 assets using returns from the past 10 years. However, some of these assets came into existence only more recently, so for some assets I have ...
1
vote
2answers
124 views

How can I estimate the Ornstein-Uhlenbeck paramters of some mean reverting data that I have on R?

I have mean reverting data (Difference of 2 stock prices, that I want to do pairs trading on). I want to simulate my own mean reverting data as similar as possible to the real data that I have. The ...
0
votes
1answer
206 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 ...
1
vote
0answers
68 views

How can I do a dynamic GARCH model using extended Kalman filter in R?

Today I was reading an article quoted here, in this article is proposed an adaptive (dynamic) Garch model. How can I do it in R? The use of extended Kalman filter or particle filter is indifferent. I ...
3
votes
0answers
57 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
98 views

Fitting transition matrices in R by solving for coefficient

I'm using various matrices to impute a fitted transition matrix for credit ratings by solving for a variable [S]. Essentially the idea is to determine a base matrix and stress matrix to compare to a ...
2
votes
0answers
102 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
1answer
102 views

Quantiles, Value-at-Risk and log normal random walks…

Sorry, that's probably quite a bunch of silly questions, but I just got lost a bit and need to dot all the i's and cross some t's :). Let's say we have a series of returns (like this one we may get ...
2
votes
1answer
96 views

Why annualized return and cumultive return aren't equal over 1-year period with Performance Analytics package in R?

I use Performance Analytics package in R to compare annualized and cumulative return of a portfolio. My expectation is that both should be equal over a period of 1-year but results tell me I'm wrong. ...
0
votes
0answers
99 views

R TTR/RSI does not behave like a Bloomberg RSI

The implementation of TTR:RSI differs slightly from the RSI calculated in Bloomberg, see more details here. I use in TTR the SMA, which simply calculates the mean, that is a walking window of: ...
0
votes
0answers
81 views

Using the R package “ termstrc ”

I am attempting to use the function estim_nss from the termstrc package in R. However, I am experiencing the following error: ...
0
votes
3answers
168 views

Portfolio Optimization - Zero beta portfolio

I am trying to solve a optimization portfolio in R in which I do the following constraints: Set weight sum to within a boundary Set return to a certain value Set portfolio beta to 0 The purpose ...
2
votes
1answer
112 views

Volatility updating rule using r

I'm trying to program a volatility updating rule using iteration. I start with the well know Heston-Nandi model where the returns dynamics are : with is iid standard normal randome variable, where ...
2
votes
0answers
38 views

How do I specify Thirty360::European day counter in RQuantLib

I am taking liberty to ask the following question in quantLib forum though this question is about RQuantLib I am trying to use RQuantLib to calculate clean price of a fixed coupon bond using a ...
0
votes
1answer
114 views

Chart Correlation warnings

when I run chart.Correlation I get a series of warnings. I get the identical warnings with chart.Correlation(managers[,1:2],method="pearson") Here is a short sample: ...