estimate_payoffs {qvirus}R Documentation

Estimate Payoff Parameters for HIV Phenotype Interactions

Description

This function estimates the payoff parameters for HIV phenotype interactions based on the provided classification object and predictions from a viral load model. It calculates the mean differences in viral loads and CD4 counts, as well as the average payoffs for each classification.

Usage

estimate_payoffs(class_obj, predictions_df)

Arguments

class_obj

An object of class InteractionClassification containing the data on viral load differences and CD4 counts.

predictions_df

A data frame containing predictions of viral loads, with a column named predictions. This data frame should align with the classifications in class_obj.

Value

A payoffs object containing the estimated payoff parameters

Examples

## Not run: 
library(dplyr)
library(earth)
library(baguette)
library(rules)
library(kknn)
library(viralmodels)
# Load required data
data(vl_3)
data(cd_3)

# Create interaction object and classification
interaction_obj <- create_interactions(cd_3[,-1], vl_3[,-1])
class_obj <- InteractionClassification(interaction_obj$vlogs_diff, interaction_obj$cds_diff)

# Prepare predictions
traindata <- interaction_obj[c(2, 5)] |> as_tibble()
target <- "vlogs_diff"
predictions_df <- viralpreds(target, 2, 1, 2, 123, traindata)

# Estimate payoffs
payoffs_results <- estimate_payoffs(class_obj, predictions_df)

## End(Not run)

[Package qvirus version 0.0.3 Index]