block-omega-sigma: Create or remove $OMEGA/$SIGMA BLOCKs

Description Usage Arguments Value See Also Examples

Description

[Stable]

Manipulate $OMEGA (and $SIGMA) BLOCKs to introduce or remove correlations.

Usage

1
2
3
block(iomega, eta_numbers = NA, diag_init = 0.01)

unblock(iomega, eta_numbers)

Arguments

iomega

A tibble output from init_omega() or init_sigma().

eta_numbers

Numeric vector. ETA numbers to put into a block or unblock for block() and unblock(), respectively. Must be contiguous.

diag_init

Numeric. Default value for off diagonal elements.

Value

An nm object with modified ctl_contents field.

See Also

init_theta(), init_omega(), init_sigma()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# create example object m1 from package demo files
exdir <- system.file("extdata", "examples", "theopp", package = "NMproject")
m1 <- new_nm(run_id = "m1", 
             based_on = file.path(exdir, "Models", "ADVAN2.mod"),
             data_path = file.path(exdir, "SourceData", "THEOPP.csv"))

io <- m1 %>% init_omega()
io <- io %>% block(c(2, 3))
m1 <- m1 %>% init_omega(io)
m1 %>% dollar("OMEGA") ## to display $OMEGA


# create example object m1 from package demo files
exdir <- system.file("extdata", "examples", "theopp", package = "NMproject")
m1 <- new_nm(run_id = "m1", 
             based_on = file.path(exdir, "Models", "ADVAN2.mod"),
             data_path = file.path(exdir, "SourceData", "THEOPP.csv"))

## first create a block
io <- m1 %>% init_omega()
io <- io %>% block(c(2, 3))
m1 <- m1 %>% init_omega(io)
m1 %>% dollar("OMEGA") ## to display $OMEGA

## now unblock
io <- io %>% unblock(c(2, 3))
m1 <- m1 %>% init_omega(io)
m1 %>% dollar("OMEGA") ## to display $OMEGA

NMproject documentation built on Oct. 18, 2021, 1:08 a.m.