Displaying 20 results from an estimated 400 matches similar to: "Calculating the Sharpe ratio"
2007 Apr 19
2
Filtering
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt.
Name: nicht verf?gbar
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20070420/d7792b17/attachment.pl
2018 May 31
2
How to alpha entire plot?
I have two chromatograms I want plotted on the same axes.
I would like the plots to be transparent, so the first chart is
not obscured.
I have tried adjustcolor(..., alpha.f=0.3), the problem is that
my chromatogram is so dense with datapoints that they
overlap and the entire graph just ends up a solid color. The
second histogram still obscures the first.
Consider this example:
col1 <-
2007 Dec 13
2
How to use R to estimate a model which has two sets of lagged time series independent variables
Hi,
I would like to use R to estimate the following model:
X(t) = a + b1*X(t-1) + b2*X(t-2) + c1*Y(t) + c2*Y(t-1) + c3*Y(t-2)
Is there any R function that performs this type of estimation? I know
that if I only have one time series (i.e. lagged value of X) on the
right hand side then there are R functions to do the estimation. I am
thinking a work around by preparing X(t-1), X(t-2),Y(t),Y(t-1)
2010 Mar 16
1
Simple for-loop runs out of memory
I have the following simple for-loop, which makes R crash every time. The
length of the vectors is about 1200 rows, 1 column.
n = max(length(GSPC),length(FTSE))
for(i in 1:1000)
{
if (row.names(GSPC)[i]==row.names(FTSE)[i]){
} else {
if (row.names(GSPC)[i]>row.names(FTSE)[i]){
GSPC<-rbind(GSPC[1:(i-1),],GSPC[(i-1):length(GSPC),])
row.names(GSPC)[i]=row.names(FTSE)[i]
} else {
2005 Sep 29
2
priceIts
Dear All,
There is an example for the priceIts function (the its package) which
does not work for me as expected.
> ?priceIts
> x1 <- priceIts(instrument = c("^ftse"), start = "1998-01-01",
+ quote = "Close")
Error in validObject(.Object) : invalid class "its" object: Missing
values in dates
> x2 <-
2008 Mar 31
1
download.file error
Dear all,
I am looking for a way to work out if a file on the internet exists before attempting to download it using the function download.file(). For example,
using a url that does not exist
url <- "http://finance.yahoo.com/ftse.csv"
destfile <- tempfile()
download.file(url = url, destfile = destfile)
# gives the following response ...
trying URL
2005 Dec 13
1
fSeries
I'm trying to use garchFit from fSeries, with Student or Skewed Student conditionnal distribution. Let's say that eps (vector) is my series of daily log-returns:
data(EuStockMarkets)
eps = diff(log(EuStockMarkets[,"CAC"]))
library(fSeries)
g = garchFit(series = eps, formula.var = ~garch(2,2), cond.dist = "dstd")
s = g at fit$series
All the coefficients are ok
2007 May 02
2
Sharpe-Ratio
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt.
Name: nicht verf?gbar
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20070503/6be2705c/attachment.pl
2007 Apr 24
2
Log-Returns
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt.
Name: nicht verf?gbar
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20070424/c6ce561b/attachment.pl
2010 Sep 04
1
tail.matrix returns matrix, while tail.mts return vector
Hi
I have a few problems with tail/head when applied to multiple time
series. I'm not sure as whether I did not understand the function or
whether it correspond to an unexpected behavior.
When head(a,n) is applied on data.frame or matrix, it returns a
data-frame or matrix with first n obs of *each* variable. When applied
to a mts object, it returns first n obs of *first* variable only,
2008 Oct 22
1
R 2.8.0 qqnorm produces error with object of class zoo?
Dear list-reader,
by running the following script:
library(zoo)
sessionInfo()
search()
packageDescription("zoo")
data(EuStockMarkets)
dax <- as.zoo(EuStockMarkets[1:10, "DAX"])
daxr <- diff(log(dax))
identical(as.vector(qnorm(daxr)), qnorm(coredata(daxr)))
qqnorm(coredata(daxr))
qqnorm(daxr)
qqnorm() produces an error:
> qqnorm(daxr)
Fehler in if (xi == xj) 0L
2012 Sep 05
2
cex.lab ignored in plot.zoo for multiple plots
Hello everyone,
a problem with the plot.zoo function. In the parameters of the function,
cex.lab is ignored. I tried to reduce the size of the yaxis labels by at
least 50%.
------------------
Example:
sample <- as.zoo(EuStockMarkets)
par(las=1)
plot.zoo(sample, plot.type="multiple", main="Time Series", xlab="Date",
yaxt="n", cex.lab=0.5,
2012 Sep 09
5
qplot with many files (each one curve)
Hi,
i would like to plot a few hundred .csv files.
Each file contains one curve with x,y values to plot.
I have been searching for "gnu r read many files qplot"
and similar words. I found for loops that use assign to generate
one variable containing a dataframe.
When i uesed the classic "plot' command i could add
the curves with something like
for... {
2008 Feb 08
2
Applying lm to data with combn
http://www.nabble.com/file/p15359204/test.data.csv
http://www.nabble.com/file/p15359204/test.data.csv test.data.csv
Hi,
I have used apply to have certian combinations, but when I try to use these
combinations I get the error
[Error in eval(expr, envir, enclos) : object "X.GDAXI" not found]. being a
novice I donot understand that after applying combination to the data I cant
access
2006 Nov 07
1
Comparison between GARCH and ARMA
Dear all R user,
Please forgive me if my problem is too simple.
Actually my problem is basically Statistical rather
directly R related. Suppose I have return series ret
with mean zero. And I want to fit a Garch(1,1)
on this.
my is r[t] = h[i]*z[t]
h[t] = w + alpha*r[t-1]^2 + beta*h[t-1]
I want to estimate the three parameters here;
the R syntax is as follows:
#
2006 Aug 28
1
Help on function adf.test
Hello everybody,
I've got a matrix called EUROPEDATA and I want to calculate the adf test statistic (part of the tseries package) on a rolling basis for window my.win on each column; i.e. each column of EUROPEDATA represents a particular variable; for the first column I calculate the adf test statistic for window my.win = 60 for example, roll forward one observation, calculate the adf
2018 Jun 01
0
How to alpha entire plot?
Interesting problem.
I would discretize the x-values and interleave them. Lines from one dataset still overlap, so you see high- density and low-density regions, but lines from the other dataset are drawn into the interval. Like so:
interleave <- function(x, MIN, MAX, N, nChannel = 2, channel) {
isp <- seq(MIN, MAX, length.out = N + 1) # interleave support points
offset <-
2003 Jun 19
1
Import time series data with uneven dates
I am trying to import a file of daily index closing prices in business time
which excludes weekends and holidays so deltat is not constant. My file
looks like the following:
date close
2003.0055 47.05
2003.0082 45.71
2003.0164 43.45
2003.0192 42.96
2003.0219 44.56
2003.0247 42.99
2003.0274 42.28
2003.0356 41.74
etc.
>From what I saw in the EuStockMarkets file, it appears
2011 Mar 13
1
problem with looping formula through table
Dear useRs,
I am stuck with a piece of code and hope you could give me some pointers.
My aim is to calculate the lm-regression coefficients of individual stocks against an index. I am interested in both the coefficient and the pval. While I could do this manually for a select hand full, I hope to scale this up say for 30+ stocks (DAX-30, FTSE-100 etc.) to eventually have a matrix of coefficients
2006 Oct 06
1
sparklines in lattice
Dear R-help,
Has anyone implemented sparklines in the strips of a lattice plot? What I have in mind is, say, highlighting that part of a time series that one is examining in more detail in a set of lattice plots.
Regads,.
Mark Difford.
PS: (Andreas Loffler has implemented a simple but functional version for
TeX/LaTeX:
http://www.tug.org/tex-archive/help/Catalogue/entries/sparklines.html)