Displaying 20 results from an estimated 400 matches similar to: "baseline fitters"
2012 Mar 03
1
Sliding Window in R (solved)
Dear all,
you can find below my solution for sliding a window. Please find below the code for the two alternatives and the benchmarks.
install.packages('caTools')
require(caTools)
do_sliding_for_a_window_duty_cycle <- function(DataToAnalyse, windowSize) {
data<-DataToAnalyse
out <- numeric()
elements<- numeric()
if (length(data[,1]) >= windowSize){
for
2005 Jun 17
0
Release of new version of caMassClass package and new package caT ools
Hi,
A new version of "caMassClass" package was released today. The package
contain pipeline for processing and classification of protein mass spectra
data.
The main change is off-spinning from the library collection of generic
functions into a new package "caTools". This package, which might be useful
to broader group, is much smaller than "caMassClass" and has fewer
2005 Jun 17
0
Release of new version of caMassClass package and new package caT ools
Hi,
A new version of "caMassClass" package was released today. The package
contain pipeline for processing and classification of protein mass spectra
data.
The main change is off-spinning from the library collection of generic
functions into a new package "caTools". This package, which might be useful
to broader group, is much smaller than "caMassClass" and has fewer
2002 Sep 16
1
Running Median and Mean
R gurus,
On Aug 20, 2002, I asked in R-help about calculating a running 5-day median on
a large matrix. Thanks to Martin Maechler <maechler@stat.math.ethz.ch> and Ray
Brownrigg <Ray.Brownrigg@mcs.vuw.ac.nz> for responding.
I ended up writing C code (and an R interface) to do it, which is about 1000x
faster than the naive method! (72s became .09s on a 223 x 520 matrix). I
added a
2005 Sep 30
3
.C help
Hi,
I am hoping some one can help me. I am learning to use C and would like to learn how to call c code in R. I have look at
Writing R Extensions
and I tried to copy the example on page 38
void convolve(double *a, int *na, double *b, int *nb, double *ab)
{
int i, j, nab = *na + *nb - 1;
for(i = 0; i < nab; i++)
ab[i] = 0.0;
for(i = 0; i < *na; i++)
for(j = 0; j <
2009 Aug 11
1
runmax function only for positive numbers?
Hi All,
I did a google search and could not find the answer. Thus I post this
message. I found runmax only work for positive numbers.
x = rep(-1,10)
runmax(x,3)
x = rep(0, 10)
runmax(x,3)
for 32-bit R, i got very small numbers: 2.121996e-314
for 64-bit R, i got NaN.
Is it a bug in runmax? or should this be included in the documentation that
runmax only for positive numbers?
however,
2011 Jan 29
1
runsd {caTools} crashes R 64bit on winxp64bit with a very large vector
Hello
I have a 3.5 million elements numeric vector x. I'm trying to calculate the
rolling std dev of the previous 144 elements.
rsd144<-runsd(x, 144, center=0, endrule="NA")
this crashes R (ie on the console disappears and the Rgui.exe process is not
there anymore)
with smaller vectors, the crash does not occur.
regards,
[[alternative HTML version deleted]]
2006 Mar 16
1
running median and smoothing splines for robust surface f itting
loess() should be able to do robust 2D smoothing.
There's no natural ordering in 2D, so defining running medians can be
tricky. I seem to recall Prof. Koenker talked about some robust 2D
smoothing method at useR! 2004, but can't remember if it's available in some
packages.
Andy
From: Vladislav Petyuk
>
> Hi,
> Are there any multidimenstional versions of runmed() and
>
2012 Apr 27
6
Min , Max
Hellow everyone,
This code bellow will calculate average daily wind speed(measurements are
taken every three hours).Any ideas how to take the Min and Max instead of
average.
library(Matrix)
setwd("C:\\Users\\aalyaari\\Desktop\\img")
listfile<-dir()
long <- file("C:\\Users\\aalyaari\\Desktop\\New folder (5)\\inra.bin", "rb")
A=readBin(long, integer(),
2008 Feb 13
4
rolling sum (like in Rmetrics package)
Hello, I'm new to R and would like to know how to create a vector of "rolling
sums". (I have seen the Rmetrics package and the rollMean function and I
would like to do the same thing except Sum instead of Mean.) I imagine
someone has done this, I just can't find it anywhere.
Example:
x <- somevector #where x is 'n' entries long
#what I would like to do is:
x1
2011 Sep 23
0
(Requested) caTools::runmean Patch
Dear Mr. Tuszynski,
I would like to request what I believe would be a beneficial update / patch
to the runmean() function in the caTools package.
Consider the following
R>> x = 1:100
R>> is.integer(x)
[1] TRUE
R>> library(caTools)
R>> head(runmean(x, 5, alg="exact"))
[1] 8.487983e-314 1.060998e-313 1.273197e-313 1.697597e-313 2.121996e-313
2.546395e-313
2011 Apr 04
1
moving mean and moving variance functions
Hello
Lets say as an example I have a dataframe with the following attributes:
rownum(1:405), colnum(1:287), year(2000:2009), daily(rownum x colnum x year)
and foragePotential (0:1, by 0.01). The data is actually stored in a netcdf
file and I'm trying to provide a conceptual version of the data.
Ok. I need to calculate a moving mean and a moving variance for each cell on
the following
2006 Jan 23
2
Master's project to coerce linux nvidia drivers to run generalised linear models
Hi,
I am working with a friend on a master's project. Our laboratory does a
lot of statistical analysis using the R stats package and we also have a
lot of under-utilised nvidia cards sitting in the back of our networked
linux machines. Our idea is to coerce the linux nvidia driver to run
some of our statistical analysis for us. Our first thought was to
specifically code up a version of
2011 Sep 02
2
Avoiding for Loop for moving average
Hello,
I need to calculate a moving average and an exponentially weighted moving average over a fairly large data set (500K rows).
Doing this in a for loop works nicely, but is slow.
ewma <- data$col[1]
N <- dim(data)[1]
for(i in 2:N){
data$ewma <- alpha * data$ewma[i-1] + (1-alpha) * data$value[i]
}
Since the moving average "accumulates" as we move through the data,
2011 Nov 21
1
coverage plot
Hi,
I'm very beginner for R but I think it is a time to start as it is very useful.
I have a coverage read file (illusmp454merCbed) for whole genome ~ 450 Mbp. This is head of this file.
Scaffold sca_position coverage
Scaffold1 1 0
Scaffold1 2 0
Scaffold1 3 0
Scaffold1 4 0
Scaffold1 5 0
Scaffold1 6 0
Scaffold1 7 1
Scaffold1 8 3
Scaffold1 9 3
I would like to plot everage coverage for every 1
2012 Mar 03
4
Sliding a Window in R
Dear all,
I am having a vector of around 300.000 elements and I Want to slide fast a window from the first element until the last-Windowsize
what I have so far is the following for statement:
for (i in 1:(length(data[,1]) - windowSize)) {
out[i] <- mean(data[i:(i + windowSize - 1), ])
elements[i]<-length(i:(i + windowSize - 1))
}
but this of course takes ages to
2005 Apr 02
1
Survey of "moving window" statistical functions - still looking f or fast mad function
Hi,
First, let me thank Jaroslaw for making this survey. I find it quite
illuminating.
Now the questions:
* the #1 solution below (based on cumsum) is numerically unstable.
Specifically if you do the runmean on a positive vector you can easily
get negative numbers due to rounding errors. Does anyone see a
modification which is free of this deficiency?
* is it possible to optimize the
2006 Jul 26
3
Moving Average
Dear R-Users,
How can I compute simple moving averages from a time series in R?
Note that I do not want to estimate a MA model, just compute the MA's
given a lenght (as excel does).
Thanks
________________________________________
Ricardo Gonçalves Silva, M. Sc.
Apoio aos Processos de Modelagem Matemática
Econometria & Inadimplência
Serasa S.A.
(11) - 6847-8889
ricardosilva@serasa.com.br
2010 Jan 21
3
Na.omit on matrix, does the matrix have to have a limited size
Hello everyone, I am using the na.omit() function on a 785 x 79 matrix. When
I restrict the matrix to 10 columns for example it returns me the right
result with the na rows deleted: 756 x 10 matrix. But, if I enter the whole
matrix it returns me a 64 x 79 matrix, ununderstandable, I have no idea
why...Does anyone know what it could be? thanks
--
View this message in context:
2004 Oct 08
1
Survey of "moving window" statistical functions - still looking f or fast mad function
Hi,
Lately I run into a problem that my code R code is spending hours performing
simple moving window statistical operations. As a result I did searched
archives for alternative (faster) ways of performing: mean, max, median and
mad operation over moving window (size 81) on a vector with about 30K
points. And performed some timing for several ways that were suggested, and
few ways I come up