M0 <- asreml(y ~ 1,rcov=~ar1(rowfac):ar1(colfac),random=~plant,data=data,trace=F) # Dataset should be with columns nested within rows # Compute euclidian distance between each data point (ie each row)ĭist <- as.matrix(dist(cbind(data$row,data$col))) # Add spatially correlated and spatially uncorrelated errorĪutocorrerror <- <- rnorm(nrow(data),0,siguncorres)ĭata$y <- intercept+autocorrerror+uncorrerror Model <- RMexp(scale=-1/log(rho), var=sigcorres^2) # Initialize AR1 simulation model using the spatial correlation parameter rho and the variance for spatially correlated effects # Create dataset with 20 row and 20 columns #install.packages(packageurl, repos=NULL, type="source") # To install the version of the package 'proxy' compatible with R.3.2.2 # for a more deteiled presentation, see: # Goal of this document: Compare AR1, exponential and Matern models (with between spatially correlated error variance and spatially uncorrelated (nugget) error variance using ASReml-R/spaMM
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |