Hello,
I have been struggling with this for a while, tried a few things, but no
clean solution so far. Here is an example from the documentation for
geom_line:
==
# Summarise number of movie ratings by year of movie
mry - do.call(rbind, by(movies,
Let me start with the code:
library(quantmod)
library(rugarch)
getSymbols(SPY, from=1900-01-01)
rets=na.trim(diff(log(Cl(SPY
tt = tail(rets[/2004-10-29], 1000)
spec = ugarchspec(variance.model=list(garchOrder=c(1,1)),
mean.model=list(armaOrder=c(2,5)), distribution.model=sged)
for(ii in 1:10)
Given a dataset x, the ecdf is ecdf(x). Then I can use ecdf(x)(y) to find
the percentile of y. Given the ecdf is there a way to determine what is the
value of y that is the boundary of let's say 95 percentile? In other words,
is there a function I can call on the ecdf like:
fomeFunc( ecdf( x ),
Try getSymbols(RCOM.NS, from=1900-01-01) instead.
It looks like google has removed the ability to download csv (not much business
providing it;)). In any case, Yahoo historical prices go way back than googles.
For instance, getSymbols(^DJI, from=1900-01-01) ; head(get(DJI)) shows
the first
library(xts)
library(TTR)
ndx = getYahooData(^NDX)
aa = ndx$Close
bb = aggregate(aa, as.yearweek, tail, 1)
The last operation takes forever, and then the bb dates are messed up. The
following produces the desired result:
time(aa) = as.Date(time(aa))
bb = aggregate(aa, as.yearweek, tail, 1)
1) quantmod, zoo, xts, TTR in no particular order, the first requires the
others, so I can't really separate them.
2) There are plenty of packages for my needs (using R as a hobbyist), but my
biggest concern is that they lack active support. A package for complex testing
of trading strategies
Hello,
This turned out to be surprisingly hard for me:
Let's say I have
mm = matrix(as.character(seq(1,30, 1)), nrow=3); mm
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 4 7 10 13 16 19 22 25 28
[2,] 2 5 8 11 14 17 20 23 26 29
[3,] 3 6 9 12 15 18 21 24 27
A few packages have support for basic download from Yahoo Finance. If that's
what you are trying to achieve - you may want to try quantmod (getSymbols
function) or tseries (get.hist.quote function). If you want to do something not
supported yet - first take a look at their source code.
Here is what worked for me:
1) Create a single xts object using one column and the index
2) Merge with the other columns
tt = read.csv(c:/ttt/totalpc.csv, skip=1)
xx = xts(tt$Call, order.by=as.Date(tt$Trade_date, format=%m/%d/%Y))
yy = merge(xx, tt$Put, tt$Total, tt$P.C.Ratio)
Hi Nancy,
testset.txt is using ; as a field separator instead of the default ,, thus,
you need to pass this information to R:
tt = read.csv(testset.txt, sep=;)
Hope this helps,
Ivan
From: nancyada...@hotmail.com
To: r-help@r-project.org
Date: Wed, 16 Dec 2009 02:34:25 +0200
Nonclinical Biostatistics
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Greg Snow
Sent: Monday, December 14, 2009 12:45 PM
To: ivan popivanov; r-help@r-project.org
Subject: Re: [R]A random number from any distribution?â
Hello,
I have some data, and I want to generate random numbers following the
distribution of this data (in other words, to generate a synthetic data sets
having the stats of a give data set). Reading an old thread I found the
following text:
If you can compute the quantile function of
Hello,
I have some data, and I want to generate random numbers following the
distribution of this data (in other words, to generate a synthetic data set
sharing the same stats as a given data set). Reading an old thread I found the
following text:
If you can compute the quantile function
Hi Hamid,
Not sure why would you need missing data, but you can definitely generate it:).
A few random thoughts:
First, you can generate all possible timestamps from the beginning to the end
of the interval (skipping weekends and skipping the stamps when the markets are
closed). Then
.
Thanks.
ivan popivanov wrote:
Hi Hamid,
Not sure why would you need missing data, but you can definitely generate
it:).
A few random thoughts:
First, you can generate all possible timestamps from the beginning to the
end of the interval (skipping
15 matches
Mail list logo