Learn R Programming

BAREB (version 0.1.2)

update_w_beta: update_w_beta

Description

This function updates the weights for each patient level cluster

Usage

update_w_beta(S, E, hyper_delta = 1)

Value

The updated weights for each patient level cluster

Arguments

S

The number of patient level clusters

E

A vector that records the current clustering membership.

hyper_delta

The hyper-parameter with default value being 1

See Also

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

Examples

Run this code
#Suppose we know the number of patient level cluster is 4
#Suppose the current clustering membership indicates 3 patients in cluster 1,
#2 patients in cluster 2, 3 patinets in cluster 3, 1 patient in cluster 4
#Use the default value, 1, for hyper-parameter
update_w_beta(S=4,E=c(1,1,1,2,2,3,3,3,4))


#To change the hyper-parameter to, for example 2
update_w_beta(S=4,E=c(1,1,1,2,2,3,3,3,4),hyper_delta = 2)

Run the code above in your browser using DataLab