[R-sig-Geo] questions for predicting spatial GEV in spatial extreme package

Helen Chen hc10024 at gmail.com
Thu Jul 30 05:46:57 CEST 2015


Hi,

I would like to predict spatial GEV from spatial extreme package for my
data.

The following is the code I run:

library(SpatialExtremes)

rainfall=read.csv("rainfall.csv")
coordinate=read.csv("coordinates.csv")
rain=as.matrix(rainfall)
coord=as.matrix(coordinate)

## Define the trend surfaces
loc.form <- scale.form <- z ~ x * y
shape.form <- z ~ 1

## Center and scale the covariates
covariates <- scale(coord[,1:2])
M0 <- fitspatgev(rain, covariates, loc.form, scale.form, shape.form)

I got error message as:

> M0 <- fitspatgev(rain, covariates, loc.form, scale.form, shape.form)
Error in scale.model$dsgn.mat %*% scaleCoeff : non-conformable arguments
In addition: Warning messages:
1: In model.matrix.default(mt, mf, contrasts) :
  the response appeared on the right-hand side and was dropped
2: In model.matrix.default(mt, mf, contrasts) :
  problem with term 2 in model.matrix: no columns are assigned
3: In model.matrix.default(mt, mf, contrasts) :
  the response appeared on the right-hand side and was dropped
4: In model.matrix.default(mt, mf, contrasts) :
  problem with term 2 in model.matrix: no columns are assigned


Could anyone help me to figure it out? Many thanks in advance.

Helen

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list