Tag Info

Hot answers tagged

4

Ah, this is becoming a common question, just in R now. Please look at this [question] (GARCH model and prediction), it has R code to do the prediction. In brief, you keep predicting one day ahead. $\sigma_{t+k}^2 =w+\alpha u_{t+k-1}^2+\beta \sigma_{t+k-1}^2$. You already know $ w,\space \alpha \space and \space \beta $ the starting values are the last ...


3

To determine the optimal number of states in a HMM is indeed an intricate one. Please have a look at the following paper: The Number of Regimes Across Asset Returns: Identification and Economic Value by M. Gatumel and F. Ielpo (2011) From the abstract: A shared belief in the financial industry is that markets are driven by two types of regimes. Bull ...


3

Have a look at fPortfolioBacktest. An example can be found here: https://r-forge.r-project.org/scm/viewvc.php/pkg/fPortfolioBacktest/man/portfolioBacktesting.Rd?view=markup&revision=4086&root=rmetrics Edit: you may want to try backtestPlot(smoothedPortfolios) to visualise the strategy performance.


3

An easy way to perform what you need is do it this way: if your data are daily then : > prices <- data$cl > log_returns <- diff(log(prices), lag=1) would provide you with daily log returns, if you change the $lag=1$ to $lag=5$ then you will get weekly moving log returns.


2

If you wander about the theoretical result of fitting parameters, the book GARCH Models, Structure, Statistical Inference and Financial Applications of FRANCQ and ZAKOIAN provides a step-by-step explanation. I think that it is not a big problem to implement these steps to R.


2

A free to use Excel Add-on providing QuantLib-backed derivatives pricing analytics directly in Excel is available at http://www.deriscope.com Disclosure: answerer is author of the package.


2

You cannot add a date column to an object returned by getSymbols or get.hist.quote. These function return matrices. Matrices can only store data of the same type, in this case the matrices contain double values (real numbers). You can add a column of class Date to the objects if you transform them into a data frame: For getSymbols: library(quantmod) ...


2

I'm going to separate your question in two. The key thing you're asking is that how does Return.rebalancing treat your different frequencied and number of asset return and weight objects. Data munging: It subsets the first ncol(weight) columns of R (as ncol(edhec) > ncol(weights) ncol R is now 11. Checks if the first date in R is less than the first date ...


2

The NS model should be fit directly to bond prices. If you have the prices of all the Treasuries, you should use those directly. See this paper for how the Fed does it http://www.federalreserve.gov/pubs/feds/2006/200628/200628pap.pdf The "Daily Treasury Yield Curve Rates" are already fitted par yields (they're fitted using a cubic spline model to on-the-run ...


1

There is no such thing as "free" option data. This is free -->http://www.nasdaq.com/symbol/aapl/option-chain You could crawl that. But to get the actual ticks or intraday data, you will unfortunately have to pay. I strongly suggest you find a college business program that has option data ticks and reach out to them. Best of luck, JL


1

I found out that the upper time series is the result of a call > tail(Return.rebalancing(edhec,weights)) portfolio.returns 2009-03-31 0.005082048 2009-04-30 0.022982981 2009-05-31 0.037432398 2009-06-30 0.011107189 2009-07-31 0.025580507 2009-08-31 0.017983519 (by optical comparison. ;-) ) A glance ...


1

Are you aware of the findata.org site and its directory? The code is also in a bazaar repository as well as GitHub repo.


1

I like Quantlib http://quantlib.org/index.shtml http://cran.r-project.org/web/packages/RQuantLib/index.html The QuantLib project is aimed at providing a comprehensive software framework for quantitative finance. QuantLib is a free/open-source library for modeling, trading, and risk management in real-life. QuantLib is written in C++ with a clean object ...


1

The mean could be the long run variance which is sig2 = fit.Constant/(1-fit.GARCH{1}-fit.ARCH{1}); I hope this explains. If not, note I ran this model through Matlab, I get different values. you can paste your m1 and m2 values and some other intermediate results so I can see why Matlab differs. EDIT: The question refers to forecasting the returns. ...


1

For the first, people regularly compute VaR or CVaR over time and plot the results. For two and three, the documentation for the ETL function says that you can either calculate it using a Gaussian approach or Cornish-Fisher expansion. These are both analytical methods. The Gaussian approach uses only the mean and variance (effectively assuming that the ...


1

This is the equity line i got after i repeated your code. how is this good ? may be you have run with only one set of numbers. any ways here are a few things you can do to come closer to reality : take the close prices as lognormal distribution instead of a normal distribution. you are adding up the returns later on. this is only right if you have ...


1

in RQuantLib you need to set the evaluation date using setEvaluationDate() This is the date used by all QuantLib valuation functions in your case 10 May 2014.


1

There is no guarantee that the optimization method always converges! In an introduction the author of the package recommends using the "hybrid" solver, which starts out with the "solnp" and goes through the other solvers, if it doesn't converge. According to him, this should at least guarantee convergence in 90 % of the cases. ...



Only top voted, non community-wiki answers of a minimum length are eligible