Re: [R] align() function missing in R ?
Thank you for your responses, I should have given an example of the functionality I am looking for, here are three typical scenarios that I deal with a lot in my work: - a regular timeseries with lots of missing values that I want to convert to the corresponding regular time series with mssing values replaced by NAs, e.g.: x = timeSeries(c(0.5,0.2,0.3,0.4,0.3,0.2,0.3), pos = c(1,2,5,8,9,12,14)); x.align = align(x, pos = 1:14, method = NA); - a regular timeseries at a coarse scale which I want to linearly interpolate to a finer time scale: x = ts(1:10, frequency = 4); x.align = align(x, frequency = 8, method = interp) - an irregular timeseries which I want to linearly interpolate to a regular time grid: x = timeSeries(c(0.5,0.2,0.3,0.4,0.3,0.2,0.3), pos = c(1,2.5,3.2,4.1,5.7,6.5,7.3)); x.align = align(x, pos = 1:7, method = interp); I am wondering how to easily code such a function using only window, ts.union and ts.intersect. Thanks again, Markus At 03:52 AM 6/29/2007, Prof Brian Ripley wrote: On Fri, 29 Jun 2007, Martin Maechler wrote: Hi Markus, You can't assume that a typical R users knows much about S+. R has been beyond S+ for a long time {{ :-) :-) please Insightful staff, don't start to jump at me !}} Even I, as a very long time S and Splus user (of the past: 1987--~1997), have never, I think, used align(). Can you give *reproducible examples* of what align() does for you? Then, kind R users will typically show you simple ways to achieve the same. Also: R is Free Software (i.e. open source and more), so we'd be happy to accept offers of an align() function that behaved compatibly (``or better'') than the S-plus one. Note however that you'd typically not be allowed to copy the S-plus implementation. align() relates to the S4 time series classes introduced in S-PLUS 5 (or so, after 1997). There are no comparable classes in base R, but there are in some of the addon packages - fCalendar has already been mentioned and there are others (see the CRAN Econometric task view). window, ts.union and ts.intersect have done all the alignment on regular time series (class ts) I have ever needed. Martin ML == Markus Loecher [EMAIL PROTECTED] on Thu, 28 Jun 2007 11:10:51 -0400 writes: ML Dear list members, I switched from Splus to R a few ML years ago and so far found no functionality missing. ML However, I am struggling to find the equivalent align() ML function for time series. I did find some reduced ML functionality such as alignDailySeries in ML package:fCalendar but the full capability of aligning ML two timeseries seems to be missing. Could this be true ML ? I am sure there must be a need for this useful ML function. Any help would be greatly appreciated. ML Thanks ! ML Markus __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] align() function missing in R ?
Dear list members, I switched from Splus to R a few years ago and so far found no functionality missing. However, I am struggling to find the equivalent align() function for time series. I did find some reduced functionality such as alignDailySeries in package:fCalendar but the full capability of aligning two timeseries seems to be missing. Could this be true ? I am sure there must be a need for this useful function. Any help would be greatly appreciated. Thanks ! Markus __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Matlab end operator
Dear list members, I use both R and Matlab and find that each has its own strengths. Matlab definitely has the edge when it comes to the interactivity of its graphs. In addition I find the little operator end extremely useful in indexing arrays. (as in x(1:end,) ) The notation is MUCH more cumbersome in R using nrow() and ncol() recursively (as in x[1:nrow(x), ] ). Is there a package that might contain an implementation of the end operator ? Thanks ! Markus __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] changing distributions
Dear fellow R users, I am struggling with the task of quantifying the statistical significance of changes in a discrete distribution over time. If I was to measure e.g. the age distribution of people entering a building on a daily basis, I would naturally observe fluctuations in that distribution. Clearly, small variations would be interpreted as sampling noise whereas major shifts would indicate sth. more substantial. How would I quantify this ? Would a ChiSquare test be an appropriate test for testing overall stationarity ? Or a two-way ANOVA decomposition ? Also, what if wanted to test specific days for significant deviation from my Null model instead of overall ? I am familiar with univariate time series change point detection algorithms but am not clear on how to translate these tools to the constrained/multivariate distribution setting. Thanking you! Markus __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] R as a server on Linux
Hi, I am trying to avid the somewhat costly startup overhead of launching a separate R executable for each client request on Linux. My current architecture is such that My Java client explicitly calls R in batch mode and passes it certain parameters. The initital startup takes almost 10 seconds because R has to load a bunch of libraries as well as a moderately large, previously created workspace. I am thinking that it would be so much more eficient to instead have R act as a server and fork off a thread for each client query. Is that possible at all ? Thanks! Markus __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] lme for time series prediction
Could anyone give me a simple example how to use lme() for t time series prediction/modeling ? I understand the concept of longitudinal data and have read the book by Pinheiro but still have a difficult time for the (simpler) case of no grouped data. I am dealing with the case of predicting a scalar from another multivariate time series. Thanks ! Mark __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.