search for: detrend

Displaying 20 results from an estimated 51 matches for "detrend".

2007 Mar 12
1
How to avoid a for-loop?
Hi all, as I am trying to move slowly from just "working" to "good" code, I'd like to ask if there's a smarter way than using a for-loop in tasks like the example below. I need to obtain the extrema of the cumulated sum of a detrended time series. The following code is currently used, please have a look at the comments for my questions and remarks: system.time({ X <- rnorm(10000) X.length <- length(X) X.cum.sum <- cumsum(X) X.cum.mean <- cummean(X) # initializing the "output&qu...
2009 Jan 21
1
Multifractal detrended fluctuation analysis
Dear R-users, Has anyone written a function for multifractal detrended fluctuation analysis? The "fractal" package does mono-fractal DFA, but not multifractal as far as I can tell. The MF-DFA approach is presented in: J. W. Kantelhardt, S. Zschiegner, E. Koscielny-Bunde, S. Havlin, A. Bunde, and H. E. Stanley, "Multifractal Detrended Fluctuat...
2009 May 14
1
corrupted smoothing kernel ?
...unused argument(s) (c(3, 3)) > kernel("fejer", 100, r=6) Error in kernel("fejer", 100, r = 6) : unused argument(s) (100, r = 6) > kernel("daniell", c(11,7,3) ) Error in kernel("daniell", c(11, 7, 3)) : unused argument(s) (c(11, 7, 3)) My goal is to detrend a time series affected by non-linear trend. I do not have clear ideas about the difference betweeen "detrending" and "smoothing". I would appreciate some suggestions and/or literature references by people experienced about detrending and smoothing. I was told the there are two...
2009 Jul 08
0
typo in ts detrending implementation in spec.pgram?
Hello! I wonder if there is a typo in detrending code of spec.pgram in spectrum.R from stats package. One can see in the code https://svn.r-project.org/R/trunk/src/library/stats/R/spectrum.R . I am afraid there is a typo and the code should look like if (detrend) { t <- 1L:N - (N + 1)/2 sumt2 <- N * (N^2 - 1)/12 for (i in...
2012 Sep 11
0
Detrended Fluctuation Analysis (fractal pkg) troubleshooting
I'm working with the DFA (detrended fluctuation analysis) function in the package fractal on postural sway data, and for the life of me can't get the results to turn out as they should given what my data looks like. The data resemble a random walk, but the Hurst exponent estimates that I'm getting at ~0.9 instead of ~1.4...
2012 Feb 29
2
How are the coefficients for the ur.ers, type DF-GLS calculated?
...efficients for ur.ers(y, type = c("DF-GLS", "P-test"), model = c("constant", "trend"), lag.max = 0) The max lag is set at zero, so the regression should simply be Diff(zt) = a*z(t-1) where a is the value i'm trying to find and z(t)'s are the detrended values. but through performing my own regression on the two time series I get different values. This could only mean 1) Its not just a simple regression or 2) I'm detrending my data incorrectly. However, i've followed the instructions I've seen in research papers and it doesn't...
2007 Feb 07
0
Detrended Fluctuation Analysis
Good afternoon, my name is Gorka Merino and i am a scientist working in the Marine Science Institune in Barcelone. I'm interested in the application of "Detrended Fluctuation Analysis" (DFA) with the R packages. I've tried to obtain some information related to DFA from the 'Help' options but failed. Could somebody inform me about the use of these techniques in R language? Thank you very much. Gorka Merino Gorka Merino Institut de Ci?n...
2008 Apr 18
2
Correspondence and detrended correspondence analysis
...the answer to this or has a real good reference about it (I am using Legendre & Legendre, Numerical Ecology, 1998).... My data is a data.frame with locations as rows and vegetation assemblages / species as columns. I've done a PCA, a correspondance analysis (CA) using ca in ca package and a detrended correspondance analysis (DCA) using decorana from vegan package. As far as i understand what i've done .... the relationships between vegetation categories and locations should be similar in all 3 analysis, although the 'arch' in locations / sites seen in the CA plot should be flatten...
2011 Jan 24
0
Detrended fluctuation analysis
Hi All I was using the DFA() in the fractal package to examine a set of time series data. And I was not sure what the H estimate meant from the summary table. is it the alpha of the power law equation?
2020 Oct 19
1
spec.pgram returns different spectra when fast=TRUE and the number of samples is odd
...samples is odd,spec.pgramreturns a different result withfast = TRUE, the example below contains the two varieties with a reference spectrum calculated manually. the number of returned spectra is also larger (50 compared to 49) whenfast = TRUE x <- rnorm( 99 ) plot(spec.pgram(x, taper = 0 , detrend = FALSE , plot = FALSE , fast = FALSE )$spec, ty = 'l' ) lines(spec.pgram(x, taper = 0 , detrend = FALSE ,plot = FALSE , fast = TRUE )$spec, col = 'red' ) lines(((abs(fft(x))^ 2 )[ 2 : 50 ])/ 99 , col = 'blue' , lty = 2 ) Best regards [[altern...
2004 Jan 22
1
spectrum
Dear R users I have two questions about estimating the spectral power of a time series: 1) I came across a funny thing with the following code: data(co2) par(mfrow=c(2,1)) co2.sp1<-spectrum(co2,detrend=T,demean=T,span=3) co2.sp2<-spectrum(co2[1:468],detrend=T,demean=T,span=3) The first plot displays the frequencies ranging from 0 to 6 whearas the second plot displays the same curve but with frequencies between 0 and .5 although it is based on the same data (length(co2)=468). Why does the sele...
2005 Jan 04
2
(no subject)
Hi I'd like to know if the R can do the DCCA? Because I can't find the package about the DCCA in R. If it can not, please introduce a free software to me, which you think can easily do the work , thanks! jeff
2007 Nov 25
1
spec.pgram() - circularity of kernel
...option? At the extremes, values seem to result from kernel application to collections of high and low frequencies. Related to this, shouldn't the frequency range shorten according to the size of kernel used? My doubt came from reading Diggle(1990) p105. e.g. data(lh) x<-spec.pgram(ldeaths, detrend=T, taper=0)$freq y<-spec.pgram(ldeaths, kernel("modified.daniell", c(6,6)), detrend=T, taper=0)$freq x==y Thanks in advance, Nuno Prista
2008 Aug 05
4
LIDAR Problem in R (THANKS for HELP)
...is makes a histogram plot(density(subground$Z)) #this makes a plot density boxplot(subground$Z)#this makes a boxplot spplot(subground["Z"], col.regions=bpy.colors(), at = seq(850,1170,10)) library(maptools) library(gstat) plot(variogram(Z~1, subground)) #Ordinary Kriging (without detrend) # if there is a trend we must use a detrend fuction Z~X+Y x11(); plot(variogram(log(Z)~X+Y, subground, cutoff=1800, width=80)) #Universal Kriging (with detrend) x11(); plot(variogram(log(Z)~X+Y, subground, cutoff=1800, width=80, map=T)) x11(); plot(variogram(log(Z)~X+Y, subground, cutoff=1800,...
2019 Feb 14
0
Proposed speedup of spec.pgram from spectrum.R
...efore, calculating the lower left portion (ie when j < i) is not required. We change two nested loops to index from i:ncol(x) instead of 1L:ncol(x) : newspec.pgram <- function (x, spans = NULL, kernel = NULL, taper = 0.1, pad = 0, fast = TRUE, demean = FALSE, detrend = TRUE, plot = TRUE, na.action = na.fail, ...) { ## Estimate spectral density from (smoothed) periodogram. series <- deparse(substitute(x)) x <- na.action(as.ts(x)) xfreq <- frequency(x) x <- as.matrix(x) N <- N0 <- nrow(x) nser <- ncol...
2003 Jan 29
2
Curve Fitting Question - Newbie
Hello, I have what should be an easy question. I'm a new r user and making the transition from menus to the command line so as to do batch processing of tons of data. One of my data streams needs to be detrended. It's a vector of numbers that follows a negative exponential decay. I need to fit a curve to it and use the residuals as an object. The data looks something like this: foo.dat <- (0.83 * exp(-0.017 * 1:1000) + 0.5) + rnorm(1000,0,0.05) plot(foo.dat, type = "l") That is an exam...
2011 Dec 20
2
any DCCA function in R?
Dear members, I am performing multivariate analysis on marine benthic populations using R. At first glance I found ca and VEGANO packages to be the suitable for the task, but neither has incorporated Detrended Canonical Correspondence Analysis (DCCA), which is just the method I want to apply on my data. I've looked for alternative packages containing the method, but my suspicion is that there is not DCCA availability for R users. Does anyone have better news for me? Javier Murillo PHD Candid...
2008 Jun 04
2
estimate phase shift between two signals
...#39;, cex=0.5) lines(lowess(x, y1, f=0.25), col='red') points(x, y2, col='blue', cex=0.5) lines(lowess(x, y2, f=0.25), col='blue') # generate time series object comb.ts <- ts(matrix(c(y1, y2), ncol=2)) # multivariate spectral decomposition spec <- spectrum(comb.ts, detrend=FALSE) # but how to interpret the phase estimate? mean(spec$phase) the mean 'phase' as returned from spectrum() does not seem to match the value used to generate the data... Am I mis-interpreting the use or output from spectrum() here? If so, is there a general procedure for estimating...
2018 Feb 08
2
Information
...eur binaire="non-numeric argument for a binary operator" timeserie: ??????? Mean 1??? 3874.000 2??? 3869.000 3??? 3885.000 .???? . .???? . .???? . trend: ???????? [,1] ?? [1,]?????? NA ?? [2,]?????? NA ?? [3,]?????? NA ???? .??????? . ???? .??????? . ???? .??????? . 2-m = t(matrix(data = detrend, nrow = 30)) seasonal = colMeans(m, na.rm = T) Error in colMeans(m, na.rm = T) : 'x' doit ?tre num?rique=" 'x' must be numeric" [[alternative HTML version deleted]]
2008 Apr 30
3
Cross Spectrum Analysis
...t; "spec" "coh" "phase" "kernel" "df" [7] "bandwidth" "n.used" "orig.n" "series" "snames" "method" [13] "taper" "pad" "detrend" "demean" $class [1] "spec" Thank you so much. Yours Faithfully, -- Maura E.M [[alternative HTML version deleted]]