covMix: Calculate the covariance matrix of the parameter estimates...

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

View source: R/covMix.R

Description

Produces an estimate of the covariance matrix of the parameter estimates for a fitted mixture of linear regressions, by inverting the observed Fisher information matrix.

Usage

1
2
covMix(object,useMC=c("ifNec","no"),...)
covMixMC(object,nsim=100,progRep=TRUE,seed=NULL,...)

Arguments

object

Object describing the fitted mixture of regressions, as returned by mixreg().

useMC

Text string specifying whether to call upon a Monte Carlo procedure if there are problems with the “analytic” procedure (i.e. if the calculated observed Fisher information is singular) or to simply give up and throw an error.

nsim

Positive integer scalar specifying how many simulated samples to generate for the purpose of calculating the Monte Carlo estimate of the covariance matrix.

progRep

Logical scalar; should nominal “progress reports” be issued during the simulation?

seed

Integer scalar. The seed for the random number generator used to produce random samples from which to calculate the Monte Carlo based estimate of the covariance matrix. If this argument is not supplied, then it is randomly sampled from 1:1e5.

...

Optional arguments semiPar and conditional to be passed on to rmixreg() by covMixMC().

Details

If different variances are allowed amongst the components (i.e. if object$eqVar is FALSE) then the parameters are taken in the order beta.1, sigsq.1, lambda.1, ..., beta.K, sigsq.K for a K component model — lambda.K is redundant and hence omitted. If equal variances are assumed, the parameters are taken in the order beta.1, lambda.1, ..., beta.K, sigsq.

In the foregoing beta refers to the linear coefficients, sigsq to the variance or variances, and lambda to the mixing probabilities.

Value

The estimated covariance matrix. If the Monte Carlo method was applied then this matrix has an attribute "seed". This attribute will be the value of the seed argument if this was supplied, otherwise it is the randomly generated replacement for this argument.

Author(s)

Rolf Turner r.turner@auckland.ac.nz

References

T. Rolf Turner (2000). Estimating the rate of spread of a viral infection of potato plants via mixtures of regressions. Applied Statistics 49 Part 3, pp. 371 – 384.

T. A. Louis (1982). Finding the observed information matrix when using the EM algorithm. Journal of the Royal Statistical Society, series B 44 pp. 226 – 233.

See Also

ncMcTest(), cband() mixreg(), plot.cband(), plot.mixresid(), qqMix(), residuals.mixreg()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Aphids.
    fita   <- mixreg(plntsInf~aphRel,ncomp=2,seed=42,data=aphids)
    cMafi  <- covMix(fita)
    ## Not run: 
        cMaMC  <- covMixMC(fita)
    
## End(Not run)
# Kilns.
   thStrt <- list(
                   list(beta=c(26.07,48808),sigsq=1.1573,lambda=0.33333333),
                   list(beta=c(23.48,32387),sigsq=1.8730,lambda=0.33333333),
                   list(beta=c(-0.0597,20760),sigsq=0.2478,lambda=0.33333333)
                 )
    fitk   <- mixreg(y ~ x,ncomp=3,data=kilnAoneOut,thetaStart=thStrt)
    ## Not run: 
        cMkfi  <- covMix(fitk)
        cMkMC  <- covMixMC(fitk)
        cMkMCs <- covMixMC(fitk,semiPar=TRUE)
    
## End(Not run)

mixreg documentation built on Oct. 14, 2021, 9:12 a.m.