profLlgm: Joint confidence regions

Description Usage Arguments Value Author(s) See Also Examples

View source: R/profLlgm.R

Description

Calculates profile likelihoods and approximate joint confidence regions for covariance parameters in linear geostatistical models.

Usage

1
2
profLlgm(fit, mc.cores = 1, ...)
informationLgm(fit,  ...)

Arguments

fit

Output from the lgm function

mc.cores

Passed to mclapply

...

For profLlgm, one or more vectors of parameter values at which the profile likelihood will be calculated, with names corresponding to elements of fit$param. For informationLgm, arguments passed to hessian

Value

one or more vectors

of parameter values

logL

A vector, matrix, or multi-dimensional array of profile likelihood values for every combination of parameter values supplied.

full

Data frame with profile likelihood values and estimates of model parameters

prob,breaks

vector of probabilities and chi-squared derived likelihood values associated with those probabilities

MLE,maxLogL

Maximum Likelihood Estimates of parameters and log likelihood evaluated at these values

basepars

combination of starting values for parameters re-estimated for each profile likelihood and values of parameters which are fixed.

col

vector of colours with one element fewer than the number of probabilities

ci,ciLong

when only one parameter is varying, a matrix of confidence intervals (in both wide and long format) is returned.

Author(s)

Patrick Brown

See Also

lgm, mcmapply, hessian

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# this example is time consuming
# the following 'if' statement ensures the CRAN
# computer doesn't run it
if(interactive() | Sys.info()['user'] =='patrick') {

library('geostatsp')
data('swissRain')

swissFit = lgm(data=swissRain, formula=rain~ CHE_alt,
		grid=10, covariates=swissAltitude,
		shape=1,  fixShape=TRUE, 
		boxcox=0.5, fixBoxcox=TRUE, 
		aniso=TRUE,reml=TRUE,
		param=c(anisoAngleDegrees=37,anisoRatio=7.5,
		range=50000))


x=profLlgm(swissFit,
		anisoAngleDegrees=seq(30, 43 , len=4)
)


plot(x[[1]],x[[2]], xlab=names(x)[1],
		ylab='log L',
		ylim=c(min(x[[2]]),x$maxLogL),
		type='n')
abline(h=x$breaks[-1],
		col=x$col,
		lwd=1.5)
axis(2,at=x$breaks,labels=x$prob,line=-1.2,
	tick=FALSE,
		las=1,padj=1.2,hadj=0)
abline(v=x$ciLong$par,
		lty=2,
		col=x$col[as.character(x$ciLong$prob)])
lines(x[[1]],x[[2]], col='black')



}

geostatsp documentation built on Oct. 5, 2021, 9:10 a.m.