refit: Refit pulsar model

View source: R/refit.R

refitR Documentation

Refit pulsar model

Description

Run the supplied graphical model function on the whole dataset and refit with the selected lambda(s)

Usage

refit(obj, criterion)

Arguments

obj

a fitted pulsar or batch.pulsar object

criterion

a character vector of criteria for refitting on full data. An optimal index must be defined for each criterion or a message will displayed. If missing (no argument is supplied), try to refit for all pre-specified criteria.

Details

The refit call is evaluated in the environment specified by the pulsar or batch.pulsar object, so if any variables were used for arguments to the original call, unless they are purposefully updated, should not be altered. For example, if the variable for the original data is reassigned, the output of refit will not be on the original dataset.

Value

a pulsar.refit S3 object with members:

  • est: the raw output from the graphical model function, fun, applied to the full dataset.

  • refit: a named list of adjacency matrices, for each optimal criterion in obj or specified in the criterion argument.

  • fun: the original function used to estimate the graphical model along the lambda path.

See Also

pulsar batch.pulsar

Examples


## Generate the data with huge:
## Not run: 
library(huge)
set.seed(10010)
p <- 40 ; n <- 1200
dat   <- huge.generator(n, p, "hub", verbose=FALSE, v=.1, u=.3)
lams  <- getLamPath(getMaxCov(dat$data), .01, len=20)

## Run pulsar with huge
hugeargs <- list(lambda=lams, verbose=FALSE)
out.p <- pulsar(dat$data, fun=huge::huge, fargs=hugeargs,
                rep.num=20, criterion='stars')

fit  <- refit(out.p)

## End(Not run)

pulsar documentation built on Sept. 25, 2023, 1:08 a.m.