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

learn more… | top users | synonyms

4
votes
1answer
70 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, ...
-1
votes
0answers
26 views

Rblpapi complication [on hold]

So I have tried to install the package Rblpapi. It seems it is being installed correctly: ...
1
vote
1answer
73 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
36 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
32 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
19 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 ...
-1
votes
0answers
57 views

How to import prices from Yahoo Finance [closed]

I am trying to read data from .csv file to import price from yahoofinance.com I am using below code. ...
3
votes
0answers
41 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
108 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
26 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, ...
1
vote
0answers
31 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 ...
1
vote
0answers
35 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
61 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) ...
0
votes
1answer
49 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 ...
3
votes
0answers
60 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, ...
3
votes
1answer
62 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
74 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 ...
3
votes
1answer
139 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 ...
4
votes
2answers
112 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
45 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 ...
1
vote
0answers
32 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: ...
2
votes
1answer
67 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
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.
0
votes
0answers
82 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....
1
vote
2answers
111 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
1answer
63 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: ...
1
vote
0answers
64 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. ...
0
votes
0answers
29 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 ...
2
votes
2answers
56 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 "...
1
vote
1answer
72 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 ...
5
votes
1answer
111 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: ...
2
votes
0answers
38 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 ...
0
votes
1answer
70 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 ...
0
votes
1answer
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 ...
2
votes
0answers
86 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-...
2
votes
0answers
61 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, ...
0
votes
0answers
13 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 ...
1
vote
0answers
32 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 ...
0
votes
0answers
48 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 ...
6
votes
1answer
182 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 ...
1
vote
2answers
39 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
137 views

How to implement momentum strategy using R

I am trying to see if momentum strategy has a profitability in a bond market. I have a bond dataset which is a panel data and it is monthly. It looks something like the table below. For each month ...
3
votes
0answers
47 views

Interpreting different factor models w.r.t. correlation matrix and min variance portfolio weights

Background In Eric Zivot's analysis of factor models he uses three models The sample (.sample) Single index model (.si) Barra factor industry model (.ind) PCA model (.pca) You can download his ...
2
votes
1answer
89 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
30 views

Calculating returns when number of securities in a timeseries varies over time?

I have a timeseries of security returns in which the number of securities in the timeseries varies over time. More specifically, I have a universe of events where securities(their returns) are added ...
0
votes
0answers
45 views

How to estimate Simple Returns and Monthly Returns from daily stock price observations with Missing data in R

I have a data frame which has over 4000 columns and 3000 rows. Columns are companies and rows have daily stock closing price. The data is such that it has missing values but due to nature of the data ...
0
votes
0answers
40 views

Is there any function in quantmod to get Earning Date from Yahoo or Google

I want to get the a stock's next earning date from quantmod. I tried my best to go through the quantmod documentation to find such function. Pleae help me. Thanks
0
votes
0answers
52 views

Where and how can I get FX intraday data for use it in R?

I need FX data (the most accurate possible) for use in R. Right now I have developed a script in Java to download the CSV file (from Oanda) and use this file to read it in R, but I think that is a ...
1
vote
1answer
39 views

Disappear Standard Error in OxEdit/G@rch6 package

Hellow everyone, I'm new here. Please instruct me to do something. My problem is when I run FIGARCH(0,d,1), OxEdit still show me a matrix with variable names, coefficient, s.e, t-stat... like this ...
1
vote
1answer
65 views

Error when trying to estimate a Markov-switching Var model in R

I'm trying to estimate a Markov-switching VAR in R using the command msvar. These are the first 10 entries of my two time series. I have 798. When I try to run this I get an Error message ...