Skip to contents

Loss method for "plmm" class

Usage

plmm_loss(y, yhat)

Arguments

y

Observed outcomes (response) vector

yhat

Predicted outcomes (response) vector

Value

A numeric vector of the squared-error loss values for the given observed and predicted outcomes

Examples

admix_design <- create_design(X = admix$X, y = admix$y)
fit <- plmm(design = admix_design, K = relatedness_mat(admix$X))
yhat <- predict(object = fit, newX = admix$X, type = 'lp', lambda = 0.05)
head(plmm_loss(yhat = yhat, y = admix$y))
#>            [,1]
#> [1,] 0.81638401
#> [2,] 0.09983799
#> [3,] 0.50281622
#> [4,] 0.14234359
#> [5,] 2.03696796
#> [6,] 2.72044268