# Tagged Questions

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

26 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 ...
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 ...
30 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 ...
32 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 ...
85 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 ...
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 ...
38 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 ...
30 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 ...
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 ...
127 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, ...
114 views

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: ...
80 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 ...
22 views

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.
98 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....
123 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
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: ...
72 views

### Optimize a trading strategy created in excel with R

I have created quite a complex back test in excel spanning 15 years with 17 parameters. I would like to optimize the parameters which would give me maximum return given a maximum draw-down percentage. ...
33 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 ...
57 views

### Automate selection of BIC-minimizing ARIMA(1,0,X) model

I want to estimate an ARIMA(1,0,X) model. The MA(X) in the model is selected to minimize BIC. I have the following code employing the function auto.arima from "...
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 ...
122 views

### Bloomberg & R: Accessing multiple securities with getBars() in R

I am attempting to access 1 minute trade data for 50 securities using Bloomberg API (rblpapi). Following is the code I got from the CRAN: ...
40 views

### Using Market Prices of Bonds to Model the Discount Curve with a Polynomial (Math + R)

I have a small program I'm building to interpolate the discount curve from a portfolio of benchmark bonds. If anyone has any guesses as to whether it's my process, or my code that's messed up I would ...
120 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 ...
45 views

### How to create time series with lagged in R [closed]

Would anyone else advise me, how to create time series with lagged in R. I would the result is the difference with lagged, there is a function Delt() but the result is the percentage change. Please ...
136 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-...
66 views

### Johansen cointegration test interpretation in R

I want to test my time series for cointegration using the Johansen test in R. I got the following result and so I know now that at least 5 out of 9 of my time series are cointegrated. My question is, ...
15 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 ...
34 views

### Cross-sectional Regression: Using calculated coefficient of first regression for a second regression as dependent variable

Hello stackexchange community! I am new to R and econometrics and and stuck in a step of the fama-macbeth (1973) regression, in which risk premia of stocks are estimated with a two-step regression ...
51 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 ...
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 ...
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{...