The function initiates by determining the prediction method specified by the user. If the "cox"
method is chosen, the function computes the score matrix using the predict.Coxmos
function.
This score matrix serves as a foundation for subsequent predictions. It's imperative to note that
for prediction types "expected" and "survival", a specific time point must be provided to ensure
accurate predictions. The function then leverages the predict
function from the Cox model to
compute the desired prediction metric.
Alternatively, if the "W.star" method is selected, the function computes the prediction values
based on the W* matrix and the Cox model's coefficients. This involves normalization of the input
data, ensuring it aligns with the training data's distribution. The normalization process considers
mean and standard deviation values from the model, ensuring consistency in predictions. The
resultant prediction values are then computed as a linear combination of the normalized data and
the derived coefficients.
It's worth noting that the function is meticulously designed to handle potential inconsistencies
or missing components in the model, ensuring robustness in predictions and minimizing potential
errors during execution.