loglikByCopulasLags: Log-likelihoods by copula family and spatial lag class

Description Usage Arguments Value Author(s) See Also Examples

View source: R/spCopula.R

Description

This function calculates the log-likelihood for a set of provided copula families per lag class. The copulas' parameters are either fitted by a provided distance dependent function, or through the function fitCopula per lag and copula family.

Usage

1
2
3
4
5
6
loglikByCopulasLags(bins, data, families = c(normalCopula(),
                                             tCopula(),
                                             claytonCopula(),
                                             frankCopula(),
                                             gumbelCopula()),
                    calcCor, lagSub=1:length(bins$meanDists))

Arguments

bins

Typically, the output of the calcBins function providing columns meanDists to tune the copula's parameter and lagData to evaluate the log-likelihood.

data

the spatial data set used to derive the bins from for data retrieval.

families

A vector of representatives of the bivariate copula families that should be investigated.

calcCor

The tuning function for the copulas' parameters. Typically, the output of the fitCorFun function. Its either based on Kendall's tau, Spearman's rho or the identity. This function needs to return one of "kendall", "spearman" or "id" when passed "NULL". This parameter might be "missing" for static convex spatial copulas.

lagSub

A set of indices indicating which of the bins to use.

Value

A list containing a matrix (loglik) of spatial lags (rows) and copula family names (columns) holding the calculated log-likelihood value and a list of the corresponding copula fits.

Author(s)

Benedikt Graeler

See Also

See also calcBins, fitCorFun or spCopula.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# load spatial data
library("sp")
data("meuse")
coordinates(meuse) <- ~x+y

# drop margins
meuse$marZinc <- plnorm(meuse$zinc, mean(log(meuse$zinc)), sd(log(meuse$zinc)))

# load parts of the workspace from demo(spCopula)
data("spCopDemo") 

calcKTauPol <- fitCorFun(bins, degree=3)

loglikTau <- loglikByCopulasLags(bins, meuse, calcCor=calcKTauPol)
loglikTau$loglik

BenGraeler/spcopula documentation built on Nov. 20, 2020, 4:07 p.m.