Re: [R-sig-Geo] gridded time series analysis

2010-11-26 Thread Martin
this is what I did to perform a regression between two bricks (each brick represent a time series): r - raster(brick1) for (i in 1:ncell(r)) { r[i] = lm(as.ts(cellValues(brick1, i)) ~ as.ts(cellValues(brick2, i)))$coefficients[2] } The result will be a slope raster, but it really takes a lot

Re: [R-sig-Geo] gridded time series analysis

2010-11-26 Thread steven mosher
that's cool, I'm also interested in a similar problem but just with one brick ending up with a slope raster as the output. It may be possible with stackApply(). have a look. or maybe robert will chime in On Fri, Nov 26, 2010 at 1:35 PM, Martin martin_bra...@gmx.net wrote: this is what I did

Re: [R-sig-Geo] gridded time series analysis

2010-11-26 Thread Jacob van Etten
mosherste...@gmail.com Subject: Re: [R-sig-Geo] gridded time series analysis To: Martin martin_bra...@gmx.net Cc: r-sig-geo@stat.math.ethz.ch Date: Friday, 26 November, 2010, 23:33 that's cool, I'm also interested in a similar problem but just with one brick ending up with a slope raster

Re: [R-sig-Geo] gridded time series analysis

2010-11-26 Thread Robert J. Hijmans
bricks have 12 layers) br3 - stack(brick1, brick2) lmS - function(x) lm(x[1:12] ~ x[13:24)$coefficients[2] r - calc(br3, lmS) Jacob. --- On Fri, 26/11/10, steven mosher mosherste...@gmail.com wrote: From: steven mosher mosherste...@gmail.com Subject: Re: [R-sig-Geo] gridded time series

Re: [R-sig-Geo] gridded time series analysis

2010-11-26 Thread Robert J. Hijmans
) lmS - function(x) lm(x[1:12] ~ x[13:24)$coefficients[2] r - calc(br3, lmS) Jacob. --- On Fri, 26/11/10, steven mosher mosherste...@gmail.com wrote: From: steven mosher mosherste...@gmail.com Subject: Re: [R-sig-Geo] gridded time series analysis To: Martin martin_bra...@gmx.net Cc: r-sig-geo

[R-sig-Geo] gridded time series analysis

2010-11-25 Thread Advait Godbole
Dear Members, I have two variables on a 507 x 356 grid and each grid cell has a time series of length 120. Is it possible to perform a time series analysis on the entire grid all at the same time, with the ultimate goal of doing linear regressions for each grid point for the 2 variables? Are