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

learn more… | top users | synonyms

1
vote
2answers
132 views

Asset allocation problem using Hidden Markov Model

I am recently getting more interested in Hidden Markov Models (HMM) and its application on financial assets to understand their behavior. But what captured my attention the most is the use of asset ...
3
votes
1answer
193 views

rugarch: GARCH external regressors

I'm currently playing around with the great rugarch package in R. However, I tried to test the external regressor functionality. I implemented a GARCH(1,1) process and compared it with a GARCH(0,1) ...
1
vote
0answers
25 views

ARIMA prediction for currencies

I was browsing TradingEconomics.com and I came across their forecast models which immediately captivated my interest. They describe them as "projected using an autoregressive integrated moving average ...
5
votes
1answer
185 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} ...
2
votes
1answer
104 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
0answers
30 views

How to estimate an Engle's asymmetric DCC model in R?

I have a $N x d$ matrix of standardized residuals, and I want to estimate the parameters $\alpha$, $\beta$ and $\gamma$ of the asymmetric version (Cappiello, Engle, Sheppard, 2006) of the usual ...
2
votes
1answer
146 views

Simulate correlated Geometric Brownian Motion in the R programming language

In response to this question: How to simulate correlated Geometric brownian motion for n assets? One of the responses provides an implementation in MATLAB: http://www.goddardconsulting.ca/matlab-...
1
vote
0answers
33 views

Robust standard errors in GARCH modelling (rugarch)

I am currently conducting some GARCH modelling and I am wondering about the robust standard errors, which I can obtain from ugarchfit() in ...
1
vote
1answer
80 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 ...
2
votes
1answer
82 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 ...
0
votes
0answers
28 views

Modelling nominal interest rates

What is the best model for nominal interest rates? ARMA, VAR, VEC, FAVAR, etc? I am a R user, so please advise me the most convenient R package to use as well. I intend to model US nominal interest ...
0
votes
1answer
36 views

How to fit a skew normal/t copula to data

I want to use either the skew normal copula or the skew t copula with a time-varying correlation matrix. But so far I haven't found any way to implement this either in R or Matlab. Would anyone be ...
3
votes
1answer
366 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
77 views

Importance Sampling for Least Square Monte Carlo

I am currently trying to implement and model an Importance Sampling estimator for Longstaff and Schwartz algorithm for pricing American put options. It is used such that more paths are in-the-money ...
1
vote
1answer
86 views

Brownian motion simulation - scaling issue

I'm trying to simulate some BM for 500 observations. I got correlated increments as I needed and they are not exactly N(0,1), so I standardize them (x-mean(x))/sd(x). But then the resulting Brownian ...
2
votes
1answer
360 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 http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:...
2
votes
1answer
110 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 ...
0
votes
0answers
15 views

HN-GARCH Option Pricing Function produces negative values (fOptions HNGOption)

I have implemented the fOptions package's hngarchFit() function to fit a Heston-Nandi GARCH model to a set of option prices, followed by the HNGOption() function to price them. Unfortunately, the ...
7
votes
2answers
464 views

R Backtesters: Quantstrat vs SIT

I am learning R, and want to start using a backtester. I have spent about a day reading all I can about R backtesters, and it seems there are 2 main contenders: quantstrat, which uses the packages ...
1
vote
2answers
116 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 market....
0
votes
0answers
39 views

What is the formula for rolling mean absolute error and Error-Adjusted Momentum in R?

I was searching for some strategies to backtest and I came across this website about Error-Adjusted Momentum(ER-MOM). Can you tell we what formula he uses to calculate ER-MOM? According to the author ...
1
vote
0answers
31 views

logistic regression multivariable fractional ploynomials stata vs. R

I a going through Hosmer, Lemenshow and Sturdivant's (HLS) Applied Logistic Regression (2013) and trying to interpret the difference between what STATA is doing and what R is doing. Concerning the fit ...
3
votes
1answer
100 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 ...
3
votes
1answer
200 views

Could someone teach me how to construct the portfolios by compute (like using R, Excel or Eviews)

Recently, I am doing my dissertation that covers asset pricing theory. The empirical test of Fama 3 factors model is an important part of this dissertation. Please let me review the fama model. Fama ...
22
votes
9answers
7k views

What tools exist for order book analysis and visualization?

What tools exist for order book analysis and visualization? In particular, if one wanted to examine a limit order book and understand how it changes throughout the day where would you turn for ...
0
votes
0answers
32 views

Rblpapi-Getting different numbers than Bloomberg

I used the following code to pull day to day total returns (net dividends) from Bloomberg Terminal for a list of securities I have. When I compare my data using the GF function in Bloomberg, I am ...
4
votes
1answer
128 views

GARCH volatility modeling, squared returns, and convergence

After reading some more of Volatility Trading, I decided to try to make a simple volatility model using daily log returns of an ETF I follow. It turns out "simple" is sort of relative. Unfortunately, ...
2
votes
1answer
135 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
0answers
34 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. This is sample data: ...
1
vote
1answer
120 views

Understanding Yang-Zhang Volatility Estimator

I am using TTR in R and I am trying to understand the Yang Zhang volatility estimator. The following equations seem to imply a single value: $$ \sigma = \sqrt{{\sigma_o^2}+k\sigma_c^2+(1-k)\sigma_{rs}...
4
votes
0answers
77 views

Block bootstrap to synthesize asset prices

I have a few basic questions on block bootstrapping on a financial time series ('TS'). Assuming my trade universe consists of 10 stocks, I would like to create a set of synthetic prices for all 10 ...
1
vote
0answers
42 views

Problems in computing VaR with GARCH-GPD-copula approach

I use a time-varying Gaussian copula (with GARCH-filtered standardized residuals modeled semiparametrically with Gaussian kernel interior and GPD tails, i.e. generalized pareto distributed) to ...
0
votes
0answers
20 views

How to measure practically the performance of Venture Capital backed tech firms following an IPO?

I am currently writing a thesis about whether the fact that a tech firm backed by venture capital companies achieves higher returns following an IPO (Horizon of 3 years). I have about 800 tech ...
3
votes
0answers
42 views

False warning messages in R, is it possible?

I'm modeling GARCH-filtered standardized residuals via semiparametric distribution with Gaussian kernel and GPD (generalized pareto distribution) tails with thresholds at 5% and 95%. For some series I'...
3
votes
2answers
147 views

Open source software for stock screening and scanning using technical analysis?

I am looking for open source software which can download stock data (yahoo/google finance etc) and used for screening/scanning stocks using technical analysis, for example: return stock list if ...
1
vote
0answers
38 views

Forecasting conditional returns in DCC-GARCH-copula approach in R

anyone who could help me interpreting and modifying this code? I have a dataset and want to reserve the last 100 returns for out-of-sample analysis. After specifying and fitting the garch-spd-copula, ...
0
votes
1answer
51 views

GARCH Model Constant in Regression

When regressing a variable on a constant of 1, the coefficient of this constant is the mean. However, when I specified that the residuals follow a GARCH(1,1) model, the coefficient of the constant ...
1
vote
0answers
46 views

(Reproducible example) Conditional returns in GARCH-EVT-Copula context (with R)

I'm estimating a time-varying correlation matrix for the normal copula using the rmgarch package from R. I've found this code in the rmgarch.tests folder. I use the ...
0
votes
1answer
123 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 ...
1
vote
0answers
64 views

How to backtest strategy in portfolio of stocks using SIT R?

I am creating and testing strategies in R code and using systemic investor toolbox(SIT) package as the backtesting tool. I copied a SIT backtesting code from a website and made small changes to make ...
3
votes
0answers
63 views

what is the minimum capital necessary for quantitative/automated/algorithm trading? [closed]

I mean from my home for myself I have a degree in statistics so I know time series, predictions, R ... I would like to design statistical model for trading with R I don't ask for trading strategies, ...
1
vote
1answer
98 views

Calculating the global minimum variance portfolio in R?

I am attempting to use the globalMin.portfolio command to calculate the global minimum variance portfolio in RStudio. My code is as follows (note that several libraries have been included which may ...
4
votes
2answers
117 views

Using R with princomp to create hedge baskets

I am experimenting to try to find better ways to hedge some of our equity portfolios. It's easy enough to use R to get a PCA breakdown of exposure for a portfolio but I can't figure out how to then ...
1
vote
0answers
48 views

How to write time-varying functions in R? Applied example

Let's say I want to use a Gaussian copula $$C_{R_t}(\eta_1, ..., \eta_n) = N_{R_t}(N^{-1}(\eta_1), ...,N^{-1}(\eta_n))$$ with a time-varying correlation matrix $R_t$. Through DCC we model the ...
0
votes
0answers
22 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.
1
vote
0answers
99 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. http://www....
2
votes
2answers
124 views

How many years of historical data is require for Portfolio Optimization?

I would like to know about below questions. How many years of historical data is require for Portfolio Optimization in R programming. Thanks Atul
1
vote
2answers
40 views

type mismatch in Rquantlib Bond.cpp

I've been tracing back through bond.cpp and find the following in FloatingBond() : double dayCounter = Rcpp::as<double>(datemisc["dayCounter"]); $\mathrm{...
1
vote
1answer
64 views

Issues in estimating VaR with GARCH

I am currently trying to figure out how to estimate the value at risk using the rugarch package in R. I've come to a result, but it seems a bit excessive. Here's my code: ...
6
votes
1answer
192 views

Obtaining risk-neutral probability from option prices

Suppose I have the following data (for the current stock and option prices of the Bank of America) Strike Last IV Probability 4 8 5.43 0.5813566 0.0000000 7 11 2.45 0.2868052 ...