3

I'd like to smooth an NDVI image by regression analysis; response of time series NDVI image to Julian date to represent the seasonal changes in NDVI as a function of Julian day. The time series NDVI image has 26 bands (8-day images during April to October) and 12618/4144 col/row. I have chosen 30 point samples in each land cover (30 x 5 LC=150) from all band of time series NDVI image using stratified random sampling method. I need to discuss my further steps with you all.

Do I need to run the regression for each sample point (150 samples) and calculate regression equation extracted from step, 1 in each point sample (one by one) again to reproduce predicted NDVI image?

Is there any method to simplify these processes to save time?

3
  • I would say one regression per land cover, not per point, otherwise you will not be able to generalize
    – radouxju
    Commented Apr 28, 2014 at 6:51
  • 1
    If you want to fit a global regression you will certainly need a much larger sample. You cannot possible be representing the spatial variability with 150 samples, even with a stratified random design. A 1% subsample ((12618*4144)*0.01)=522890 would be a good target n. It is critical to look at both exploratory analysis and model fit when approaching these types of problems. In your exploratory analysis you should check the sample distribution against your population. And, no you should not be producing 150 regression equations! Perhaps it is time to talk to a stats person. Commented Apr 28, 2014 at 15:45
  • Joffrey Is it work between to raster, for example, I have a Landsat scene, in this scene I calculate de NDVI and for the same scene i have de biomass. Can I use de NVDI to predict the biomass and create a R² and RMSE images?
    – Synet
    Commented Mar 13, 2018 at 16:08

1 Answer 1

4

Using the raster package in R you could apply a pixel-wise regression estimate of NDVI ~ time. Here is an example for a linear model, locally-weighted polynomial regression and regression coefficients.

library(raster)

# Create some example data
r <- raster(nrow=100, ncol=100)
  r[] <- runif(ncell(r),-1,1)
    rt <- stack(r)      
      for(i in 2:26) {
        r <- rt[[1]] 
          r[] <- runif(ncell(r),-1,1)     
            rt <- addLayer(rt, r)  
      }

# Create a time vector to act as x
time <- sort(sample(1:365,nlayers(rt))) 
        
# linear (lm) regression estimate(s) of ndvi ~ time
t.lm.predict <- function(x) {if (is.na(x[1])) {NA} else {predict(lm(x ~ time))}} 
f.pred <- calc(rt, t.lm.predict)
  plot(f.pred)

# locally-weighted polynomial regression of ndvi ~ time
t.lowess <- function(x,...) { if (is.na(x[1])) { NA } else { lowess(x,y,...)$y } } 
f.pred <- calc(rt, t.lowess)
  plot(f.pred)
      
# slope and intercept of ndvi ~ time
t.lm.coef <- function(x) {
  if (is.na(x[1])) { NA } else { lm(x ~ time)$coefficients }
  }
f.coef <- calc(rt, t.lm.coef)
3
  • Thank you for your feedback. But I don't have any experience in R. If you tell me the steps I can take in ARCGIS, it would be appreciated. Commented Apr 28, 2014 at 15:24
  • You need to be able to vectorized your problem which is not possible in ArcGIS without stepping out to Python/NumPy. Commented Apr 28, 2014 at 15:29
  • I modified my answer to provide a polynomial regression example. I don't know what to tell you, out-of-the-box ArcGIS is just not the platform for this analysis. You could do this in Python or IDL but you would have to write your own code and likely, implement the polynomial regression as well. There is a timeseries regression in GRASS/QGIS. As you can see, implementation in R is quite straight forward. I would recommend getting some help with R to run this. I have already provided the code, all you have to do is read your data, apply the funciton and write the results. Commented Apr 28, 2014 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.