Learn R Programming

fdars (version 0.3.3)

pred.R2: R-Squared (Coefficient of Determination)

Description

Compute the R-squared value between predicted and actual values.

Usage

pred.R2(y_true, y_pred)

Value

The R-squared value.

Arguments

y_true

Actual values.

y_pred

Predicted values.

Examples

Run this code
y_true <- c(1, 2, 3, 4, 5)
y_pred <- c(1.1, 2.2, 2.9, 4.1, 4.8)
pred.R2(y_true, y_pred)

Run the code above in your browser using DataLab