Learn R Programming

geostatsp (version 0.4.4)

likfit: Likelihood Based Parameter Estimation for Gaussian Random Fields

Description

Maximum likelihood (ML) or restricted maximum likelihood (REML) parameter estimation for (transformed) Gaussian random fields.

Usage

likfit(geodata, ...)
## S3 method for class 'SpatialPointsDataFrame':
likfit(geodata, formula, dist.rel.scale=100,...)

Arguments

geodata
An object of class SpatialPointsDataFrame or of a class suitable for likfit in the geoR package.
formula
A two sided formula, with the left side giving the response variable and the right side the fixed effects variables
dist.rel.scale
the optimizer will work with a range parameter as a fraction of the diagonal distance of the bounding box, with the default being 1/20 of the diagonal distance. dist.rel.scale is the denominator of this fraction.
...
additional arguments passed to likfit in the geoR package.

Value

  • As likfit with additionally
  • beta.tablea table of parameter estimates, standard errors, z scores, and p values

See Also

likfit

Examples

Run this code
n=100
mydat = SpatialPointsDataFrame(cbind(runif(n), runif(n)), 
	data=data.frame(cov1 = rnorm(n), cov2 = rpois(n, 0.5))
	)

# simulate a random field
mydat$U = GaussRF(mydat, model="whittle", param=c(mean=0, variance=1, nugget=0, 
				scale=0.4, alpha=2))

# add fixed effects
mydat$Y = -3 + 2*mydat$cov1 + 0.5*mydat$cov2 + rnorm(length(mydat), 0, 0.1)

myres = likfit(mydat, Y ~ cov1 + cov2, 
	cov.model="matern", kappa=1, fix.kappa=TRUE,
	ini.cov.pars = c(1, 0.2)
	)

myres$beta.table

Run the code above in your browser using DataLab