fitCov: Fitting covariance models by REML estimation

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/covariance.R

Description

The function estimates the (hyper)parameters of the covariance models by the Restricted Maximum Likelihood (REML) method.

Usage

1
fitCov(models, Xs, data, controls = list(), cl = NULL, verbose = FALSE)

Arguments

models

object either of class krige, a list of covariance models, or of class covModel, that is, a single covariance model

Xs

matrix of sample points, the design

data

data frame of simulated sample means of statistics first column corrsponds to the first model in the list 'models' and so forth

controls

list of control parameters, see nloptr

cl

cluster object, NULL (default), of class "MPIcluster", "SOCKcluster", "cluster"

verbose

logical, TRUE for intermediate output

Details

The function fits a list of covariance models using the REML method. In order to avoid singularities of the so-called trend matrices make sure to use at least the minimum required number of sample points stored in 'Xs' which depends on the defined trend order, see setCovModel.

Value

An object of class reml which consists of a list of named lists ('model', 'convergence') each storing a fitted covariance model itself together with the optimization results from nloptr as an attribute named 'optres'. The default method for estimating the covariance parameters is mlsl which uses random starting points and thus could produce different results if it is run multiple times. If the results strongly vary, then the corresponding REML function might have many local minima which precludes the use of this default algorithm and another one, e.g. 'NLOPT_GN_DIRECT' (see nloptr.print.options), might lead to better results.

Author(s)

M. Baaske

See Also

setCovModel

Examples

1
2
3
4
5
6
7
data(normal)  

# fit 1st statistic and get REML results
fitCov(qsd$covT[1],
       Xs=as.matrix(qsd$qldata[1:2]),
       data=qsd$qldata["mean.T1"],verbose=TRUE)
  

mbaaske/qle documentation built on Feb. 3, 2018, 11:02 a.m.