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

learn more… | top users | synonyms

2
votes
1answer
109 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
104 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
87 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
183 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
116 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
128 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: ...
0
votes
1answer
47 views

Risk free rate for Performance Analytics

In [R] one can pass either a vector or scalar as the risk free rate. What is better? If I pass a vector to (for example) chart.riskreturnscatter then the sharpe ratio lines disappear. ...
2
votes
1answer
180 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} ...
1
vote
1answer
237 views

short-sale constraint with nonpositive-definite matrix in portfolio optimization

I need help about portfolio optimization in R. I have inverted matrix and I want to use it as an input in portfolio optimization. It was non-positive definite before I have handled it. In portfolio ...
3
votes
5answers
554 views

Is there any way to easily estimate and forecast seasonal ARIMA-GARCH model in any software?

I use R to estimate a seasonal ARIMA(8,0,0)(5,0,1)[7] model for the seasonal differences of logs of daily electricity prices: ...
1
vote
0answers
86 views

Ibrokers: reqMktData extremely slow when adding tickers

I am trying to snap prices in R for the latest price for a list of stocks (around 150). When I snap them for 2 stocks, it's almost instantaneous: ...
1
vote
1answer
69 views

Geometric Return & Performance Results for Quarterly Rebalancing

I have a Portfolio that is rebalanced every 3-months. The portfolio is made up of assets that have daily log-returns. I am a bit confused when charting the results using ...
2
votes
1answer
150 views

ARIMA model, cannot get rid of low order ACF spike

I've gone through all the steps to fit a good ARIMA model - I plotted the data, I looked at the ADF tests, I looked at the ACF plot with no AR and MA terms just a constants. I came up with an ...
2
votes
2answers
206 views

How to find the best fitting GARCH model for a portfolio composed of 3 ETFs in R?

I am doing a project for my class Financial Time Series in which I am trying to forecast my portfolio log returns using a GARCH fit. I am having a bit of trouble determining the best way to fit this ...
1
vote
0answers
115 views

Stationarity tests in the frequency domain for regression

Strict stationarity is the strongest form of stationarity. It means that the joint statistical distribution of any collection of the time series variates never depends on time. So, the mean, variance ...
2
votes
0answers
88 views

how to apply a simple copula model

I'm playing around with copulas and wanted to generate some sample based on copula techniques in R. For this purpose I applied the following algorithm: Generate three sample vectors coming from ...
2
votes
1answer
150 views

Does Nelson-Siegel require adjustments to yield curve input data?

I am attempting to gain a better understanding of the limitations of the Nelson-Siegel model as described in Estimating the Yield Curve Using the Nelson-Siegel Model. As I have been playing around ...
0
votes
0answers
654 views

Calculating the efficient frontier from expected returns and SD

I'm trying to calculate the efficient frontier (and the optimal portfolio at the Sharpe ratio) given two vectors for a portfolio: (1) expected returns and (2) historical standard deviations. I would ...
0
votes
0answers
29 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: ...
1
vote
3answers
326 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 ...
2
votes
0answers
120 views

negative transition probabilities in the heston model

I've been trying to implement a bivariate tree for pricing american options with the heston model in R using the paper of Beliaeva and Nawalkha ...
2
votes
2answers
235 views

Is there a way to adjust R PerformanceAnalytics function VaR with EWMA or GARCH method?

Is there a way to upgrade R PerformanceAnalytics function VaR with more risk sensitive approaches like EWMA or GARCH? Or is there another R package which can handle the issue?
0
votes
0answers
131 views

Asian option numerical pricing method generates a negative time value

I use R to write a function which simulates price path and calculates the value of an arithmetic Asian option. I found sometimes the value of the option can be lower than its intrinsic value, i.e., ...
6
votes
2answers
903 views

How do Return.portfolio and Return.rebalancing work in Performance Analytics in R?

I have a question about the function Return.portfolio/Return.rebalancing from the Performance Analytics package in R. I take ...
5
votes
3answers
339 views

multiperiod optimization using R

I'm interested in multistage optimization problems. Are there any good R packages around to solve such problems over time? I'm not at all an expert in it, so maybe someone knows a good paper / lecture ...
1
vote
0answers
183 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 ...
2
votes
1answer
222 views

Stress Testing Methods

I'm working on the following task: Given quarterly data: a time series representing the 1-year realized (10 years of data) rates of default on a portfolio of mortgages a slew of ...
1
vote
1answer
2k views

Integrating R with Bloomberg

In the past, I have used the package RBloomberg to directly pull bloomberg data into R. I've also seen it go by the names Rbbg or R[Name Redacted]. It seems to me, however, that this package no longer ...
4
votes
1answer
1k views

Popular R packages for Quantitative Finance

Which R packages (in this list or not) do you use in quant finance, why not an alternative, do you use it in production and if so, how? There is a list of most of the R packages related to Finance by ...
5
votes
1answer
476 views

Kelly Capital Growth Investment Strategy (Example in R)

In the paper Response to Paul A Samuelson letters and papers onthe Kelly Capital Growth Investment Strategy pages 5 and 6 Dr William T Ziemba, gives a praticle example on Kelly Growth. I’m trying to ...
1
vote
1answer
185 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
244 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 ...
1
vote
0answers
185 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
71 views

rugarch and rolling estimation

I use Rugarch for a long time in order to calibrate GARCH models on FX rates time series and perform simulations. I am trying to understand the ugarchroll method. However even if I can find plenty of ...
0
votes
0answers
474 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 ...
3
votes
1answer
226 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. ...
3
votes
1answer
3k 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 ...
3
votes
1answer
2k views

GARCH(1,1) good fit found, how to predict one day volatility ahead?

I used SPY data to fit GARCH(1,1) in my model. My data starts from Jan, 2000 until Dec, 2013. I compared the volatility using runSD on the 21 rolling window and GARCH(1,1). It looks a pretty good fit ...
4
votes
2answers
269 views

quantiative risk measure how they are implemented in R and their use

So far I have just theoretical knowledge of risk measure and never used them in application. Therefore I have some basic question how risk measures are used in reality and how they are implemented in ...
0
votes
1answer
417 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 ...
2
votes
0answers
159 views

What R-packages for SOCP problems are there?

Currently, I am looking deeper into the topic of second-order cone programming. Could you suggest packages that solve SOCP-problems in R? With your answer, please provide a short description of ...
0
votes
1answer
343 views

IB with R which package?

I want to implement my models in R and trade according to them with my IB account. Now I am wondering, how I should solve this problem? Do I need to program with C an access ...
3
votes
2answers
483 views

Calculating and interpreting cumulative returns is R

I have buy and sell signals,and accordingly, I artificially generate a signal series,for which,I assign 1 to every buy and -1 to every sell: ...
5
votes
5answers
1k views

Library for interactive financial charts

For my recent project I am looking to build a software capable of visualizing financial charts in a dynamically and interactive matter. The workflow is as follows: I gather data from my data ...
2
votes
1answer
342 views

Interpretation of cross-correlation matrix when one sample distribution is not normal

I am looking at the variance of (log) price changes in securities vs. the amount of social media discussion about them. I'm not interested in building a model. I'm just looking to see if there is a ...
0
votes
1answer
315 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 ...
2
votes
1answer
2k views

ADF test in R yielding perfect cointegration. How is this possible?

I am using the famous conintegrated pairs tutorial to just different stocks for cointegration. The adf.test yeilds perfect cointegration, which I feel must be incorrect. Here is why: When I run ...
4
votes
1answer
1k views

What is the best solution to use QuantLib within Excel?

Excel is likely the most widespread instrument across all not-only-quants desks; in addition, we have to keep in mind that Bloomberg and Reuters allow to easily import real time data in Excel, and ...
5
votes
1answer
356 views

Definition of gearings, spreads and curve in RQuantLib's Floating Rate Bond function

Consider the RQuantLib package function FloatingRateBond(). This takes as inputs gearings ...