update_w: update_w

Description Usage Arguments Details Value See Also Examples

View source: R/updates.R

Description

This function updates the weights for site level clusters

Usage

1
update_w(K, R, S, hyper_delta = 1)

Arguments

K

The number of site level cluster for each patient level cluster. Should be a vector of length S

R

The current site level clustering membership. Should be a matrix with S rows.

S

The number of patient level clusters.

hyper_delta

The hyper-parameter with default value being 1

Details

It returns a matrix with 10 columns. For example, first patient cluster has 2 site level clusters. The first row's first 2 elements give the weights for site level clusters in patient cluster 1. Last 8 elements are NA's

Value

The updated weights for site level clusters. Should be a matrix with S rows.

See Also

update_RJ for a complete example for all functions in this package.

Examples

1
2
3
4
5
6
7
#Suppose we know the number of patient level cluster is 2,
#one has 2 site level clusters and one has 3.
#Use the default value, 1, for hyper-parameter
update_w(K=c(2,3),R=matrix(c(1,2,2,1,1,2,3,2),nrow=2,byrow=TRUE), S=2)

#To change the hyper-parameter to, for example 2
update_w(K=c(2,3),R=matrix(c(1,2,2,1,1,2,3,2),nrow=2,byrow=TRUE), S=2, hyper_delta = 2)

BAREB documentation built on March 26, 2020, 7:36 p.m.

Related to update_w in BAREB...