Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Statistical Inference in RCOX Models with Graphical Gaussian Models and Colour Classes, Exams of Latin language

Information about the 'grc' r package, which is used for statistical inference in rcox models. The package includes functions for adding and dropping colour classes, comparing colour classes, fitting rcox models, accessing rcox model objects, and joining and splitting colour classes. The document also includes examples of how to use these functions.

Typology: Exams

Pre 2010

Uploaded on 08/30/2009

koofers-user-ywl
koofers-user-ywl 🇺🇸

10 documents

1 / 15

Toggle sidebar

Related documents


Partial preview of the text

Download Statistical Inference in RCOX Models with Graphical Gaussian Models and Colour Classes and more Exams Latin language in PDF only on Docsity! Package ‘gRc’ April 17, 2009 Version 0.2.2 Title Inference in Graphical Gaussian Models with Edge and Vertex Symmetries Author Søren Højsgaard <sorenh@agrsci.dk>, Steffen L. Lauritzen <steffen@stats.ox.ac.uk> Maintainer Søren Højsgaard <sorenh@agrsci.dk> Description Estimation, model selection and other aspects of statistical inference in Graphical Gaussian models with edge and vertex symmetries (Graphical Gaussian models with colours) License GPL Encoding latin1 Depends MASS,gRbase,graph Suggests Rgraphviz Repository CRAN Date/Publication 2008-07-14 11:56:01 R topics documented: add1drop1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 comparecc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 getSlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 gRc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 join1split1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 rcox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 stepwise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 tr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 update.rcox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Index 15 1 2 add1drop1 add1drop1 Add or drop colour classes to RCOX models Description Make a test for adding/dropping all colour classes in scope for an RCOX model. Usage ## S3 method for class 'rcox': add1(object, scope, details = 0, trace = 0, ...) ## S3 method for class 'rcox': drop1(object, scope, details = 0, trace = 0, stat = "wald", ...) Arguments object An RCOX model, an object of class ’rcox’ scope A set of edge colour classes to be considered for addition or deletion, see ’de- tails’. details Control the amount of output created. trace For debugging purposes stat Either "wald" for a Wald statistic or "dev" for a deviance statistic. ... Additional arguments, currently unused. Value A list with entries: tab A data frame with the test results cc A list of colour classes Note Note that the keyword ’stat’ is not available for add1 because this function expands the current model and hence the Wald statistic is not available. Author(s) Søren Højsgaard, sorenh@agrsci.dk See Also comparecc, stepadd1, stepdrop1 fit 5 Arguments m An RCOX model object (an object of class ’rcox’) Kstart An initial value for the concentration matrix. method The specific estimation method. Can be either "scoring", (a modified Fisher scoring algorithm), "ipm" (iterative partial maximization), "matching" (score matching) or "user" (currently not used) control A list controlling the fitting algorithms. See the ’details’ section. details The amount of details printed on the screen. 0 means no details at all. trace Controls various diagnostics print outs. A debugging feature not intended for the user. returnModel If TRUE the model object m is returned with fitting info added to it. If FALSE only the fitting info is returned. ... Additional arguments; currently not used. Details The fitted parameters etc. can be extracted using ’fitInfo(m)’. The control argument is a list with named entries. Most important are the entries ’maxouter’ and ’maxinner’ (which both defaults to 25) for controlling the estimation algorithms. For other compo- nents please refer to the code. Value An RCOX model object. Author(s) Søren Højsgaard, sorenh@agrsci.dk See Also rcox, update.rcox Examples data(math) gm = ~al:an:st vcc = list(~me+st, ~ve+an, ~al) ecc = list(~me:ve+me:al, ~ve:al+al:st) m1 <- rcox(gm=gm, vcc=vcc, ecc=ecc, data=math, fit=FALSE) fit(m1, method="matching") fit(m1, method="scoring") fit(m1, method="ipm") ## MISSING 6 getSlot getSlot Accessing RCOX model objects Description Accessing RCOX model objects Usage ## Accessor functions getSlot(object,slot) fitInfo(object,slot) intRep(object,slot) dataRep(object,slot) getecc(object) getvcc(object) getedges(object, complement=FALSE) Arguments object An RCOX model object. slot A name of a slot. complement If FALSE, the edges of the model is returned. If TRUE, the edges not in the model is returned Author(s) Søren Højsgaard, sorenh@agrsci.dk See Also rcox Examples data(math) gm = ~al:an:st vcc = list(~me+st, ~ve+an, ~al) ecc = list(~me:ve+me:al, ~ve:al+al:st) m1 <- rcox(gm=gm, vcc=vcc, ecc=ecc, data=math) getecc(m1) getSlot(m1,"type") fitInfo(m1) fitInfo(m1,"K") gRc 7 gRc The package ‘gRc’: summary information Description This package is for statistical inference in RCOX models. That is, graphical Gaussian models where specific entries of the inverse covariance matrix or partial correlation matrix have been restricted to being equal. Entries which are restricted to being identical are displayed with identical colours in the independence graph. Hence the name of the package gRc: The "c" stands for colours. Details The function for specifying RCOX models is rcox, and we refer to the help page for that function for examples. Authors Søren Højsgaard, sorenh@agrsci.dk See Also rcox join1split1 Joining and splitting of colour classes in RCOX models Description Test for joining of two colour classes (of a specific type) by testing if their corresponding parameters are not significantly different. Split a colour class and test how much this changes the fit of the model. Usage join1(object, scope=NULL, type = "ecc", details = 1,stat = "wald") split1(object, scope=NULL, type = "ecc", details = 1) Arguments object An RCOX model, an object of class RCOX scope A specification of colour classes which should be considered for joining/splitting. If NULL, then all colour classes are considered. type Either "ecc" for edge colour classes or "vcc" for vertex colour classes. stat Either "wald" for a Wald statistic or "dev" for deviance statistic. details Control the amount of output 10 stepwise Author(s) Søren Højsgaard, sorenh@agrsci.dk Examples data(math) gm = ~al:an:st vcc = list(~me+st, ~ve+an, ~al) ecc = list(~me:ve+me:al, ~ve:al+al:st) m1 <- rcox(gm=gm, vcc=vcc, ecc=ecc, data=math, method='matching') m2 <- rcox(gm=gm, vcc=vcc, ecc=ecc, data=math, method='scoring') m3 <- rcox(gm=gm, vcc=vcc, ecc=ecc, data=math, method='ipm') m1 m2 m3 summary(m1) summary(m2) summary(m3) coef(m1) coef(m2) coef(m3) vcov(m1) vcov(m2) vcov(m3) stepwise Stepwise model selection in RCOX models Description These allow for stepwise model selection in RCOX models by. Model expansion (i.e. forward selection) is obtained by adding edge colour classes and by splitting edge/vertex colour classes. Model reduction (i.e. backward selection) is obtained by dropping edge colour classes and by joining edge/vertex colour classes. Usage stepadd1 (object, criterion = "aic", steps = 1000, k = 2, alpha = 0.05, details=1, trace=0) stepdrop1 (object, criterion = "aic", steps = 1000, k = 2, alpha = 0.05, stat = "wald", details=1, trace=0) stepjoin1 (object, scope, type = "ecc", criterion = "aic", steps = 1000, k = 2, alpha = 0.05, stat = "wald", details = 1, trace=0) stepsplit1(object, type = "ecc", criterion = "aic", steps = 1000, k = 2, alpha = 0.05, stat = "wald", details = 1, trace=0) tr 11 Arguments object An RCOX model, an object of class RCOX scope A set (list) of items (edge colour classes or vertex colour classes) to be consid- ered. If missing, then all items are considered. criterion Either "aic" (the default), "bic" or "test" (for significance test) type Either "ecc" for edge colour classes or "vcc" for vertex colour classes. k The multiple of the number of degrees of freedom used for the penalty when criterion is "aic". Ignored when criterion is "bic" or "test". Only k = 2 gives the genuine AIC. steps The maximum number of steps to be considered. The default is 1000 (essentially as many as required). It is typically used to stop the process early stat Either "wald" for a Wald statistic or "dev" for a deviance statistic. alpha Critical value if ’criterion’ is "test". If criterion is "aic" or "bic", the critical value is 0. details Control the amount of output created. trace For debugging purposes Value Either NULL or a new RCOX model. Note Note that the keyword ’stat’ is not available for stepadd1 and stepsplit1 because these functions expand the current model and hence the Wald statistic is not available. Author(s) Søren Højsgaard, sorenh@agrsci.dk See Also split1 join1 add1.rcox drop1.rcox comparecc tr Calculate trace of various matrix products Description Calculate trace of various matrix products. 12 tr Usage trA(A) trAW(A,W) trAWB(A,W,B) trAWBW(A,W,B) trAWBV(A,W,B,V) Arguments A,B Square matrices represented as matrices or lists (see examples below). W,V Square matrices Value A number Author(s) Søren Højsgaard, sorenh@agrsci.dk Examples d <- 5 W <- matrix(rnorm(d*d),nr=d,nc=d); V <- W <- W+t(W) ## Turn list into matrix ## tomat <- function(x){ ans <- do.call("rbind", x) storage.mode(ans)<-"double" return(ans) } A1 <- tomat(list(c(1,2),c(1,3))) A2 <- tomat(list(1,3,5)) ## Just for checking the calculations ## symMat <- function(A,d){ ans <- matrix(0,nr=d,nc=d) for (i in 1:length(A)){ e <- A[[i]] if (length(e)==1){ ans[e,e] <- 1 } else { ans[e[1],e[2]] <- ans[e[2],e[1]] <- 1 } } return(ans)
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved