Skip to contents

[Experimental]

Computes the Similarity-Weighted Activity score used in GenRA read-across predictions. The SWA is calculated as the weighted average of analogue activities, where weights are the similarity scores.

Usage

genra_swa(activities, similarities)

Arguments

activities

Integer vector of activity values (0 = inactive, 1 = active). NA values are allowed and will be excluded from the calculation.

similarities

Numeric vector of similarity scores (0-1), must be same length as activities.

Value

Numeric SWA score between 0 and 1, or NA if no valid data.

Details

The formula is: $$SWA = \frac{\sum_{i} (similarity_i \times activity_i)}{\sum_{i} similarity_i}$$

Only analogues with non-NA activity values are included in the calculation.

See also

genra_predict() for the main prediction workflow.

Examples

if (FALSE) { # \dontrun{
# Simple example with known activities
activities <- c(1, 1, 0, 1, 0)
similarities <- c(0.95, 0.88, 0.82, 0.75, 0.70)
genra_swa(activities, similarities)
} # }