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

learn more… | top users | synonyms

10
votes
3answers
351 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 ...
1
vote
0answers
104 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 ...
0
votes
0answers
139 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 ...
3
votes
1answer
266 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 ...
0
votes
1answer
158 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: ...
2
votes
1answer
247 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
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 ...
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 ...
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
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 ...
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 ...
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 ...
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 ...
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 ...
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
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 ...
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 & ...
7
votes
0answers
158 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
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 ...
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
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) ...
2
votes
2answers
158 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 ...
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 ...
1
vote
0answers
144 views

Automated Import of 10-Q and 10-K Statements in XBRL Format from SEC.gov

I want to read financial statements in XBRL Format from the SEC site automatically. For instance the 10-Q File from Apple: ...
1
vote
1answer
147 views

Original Fundamental Accounting Data (Not Ratios)

Where do I get original fundamental accounting data from income statement, balance sheet and cash flow statement, like Sales/Revenue, Gross Income, EBIT, Operating Income, Cash & Short Term ...
11
votes
4answers
696 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 ...
2
votes
0answers
97 views

R quantstrat backtest with dollar based position sizing

I am attempting to tweak a quantstrat based backtest but have run into an issue. The maxPos limits are share based, and I would rather use a fixed dollar amount instead. So I've tried generating a ...
5
votes
2answers
651 views

Change periodicity on Rblpapi

So Dirk Eddelbuettel, Whit Armstrong, and John Laing released Rblpapi to CRAN recently, and it is awesome. I'm having some difficulty understanding how the overrides work though, hopefully someone can ...
1
vote
0answers
49 views

ROC — Output from Calculating Stock Returns Producing Lower Numbers Than Actual

I tried this on stack exchange, but think it is a better question here. I am beginning user and I need help with an error / bad output I am getting when calculating returns (using ROC) on stock ...
3
votes
1answer
69 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 ...
1
vote
1answer
161 views

What is the logic behind this backtesting code in R

I am new to R and I have found this simple backtesting code and can you explain me what is happening here. ...
6
votes
1answer
345 views

Calculate turnover for portfolio

I am trying to calculate the turnover for a portfolio strategy. First I generate some random data and assign it dates: ...
2
votes
0answers
77 views

Ledoit-Wolf portfolio weights calculation

I am trying to implement the Ledoit-Wolf minimum variance portfolio strategy on a real-world stock dataset. ...
4
votes
1answer
89 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 ...
2
votes
1answer
101 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 ...
4
votes
1answer
218 views

Rebalancing portfolio weights

I have a matrix of returns and weights for every time period. ...
4
votes
1answer
148 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 ...
4
votes
1answer
106 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 ...
1
vote
0answers
66 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 ...
2
votes
0answers
160 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 ...
1
vote
2answers
261 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 ...
1
vote
1answer
127 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 ...
2
votes
1answer
937 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 ...
2
votes
1answer
84 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 . ...
3
votes
3answers
566 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
2answers
340 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 ...
2
votes
0answers
104 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 ...