View source: R/validate_cie_model.R
| validate_cie_model | R Documentation |
Validate CIE sky models fitted with fit_cie_model() (or ootb_sky_cie())
using k-fold cross-validation on relative radiance.
validate_cie_model(model, k = 10)
model |
list. Output of |
k |
numeric vector of length one. Number of folds. |
Validation uses k-fold cross-validation with k = 10 by default
\insertCiteKohavi1995rcaiman. For each fold, predictions are
compared against observed relative radiance and a simple linear regression
of predicted vs. observed is fitted, following
\insertCitePineiro2008;textualrcaiman. Outliers are detected with a
median–MAD rule (see rem_outliers()) using a threshold of 3
and removed before fitting the regression.
A list with:
An object of class lm (see stats::lm()) for predicted vs. observed.
Numeric vector of predicted relative radiance used in lm.
Numeric vector of observed relative radiance used in lm.
Coefficient of determination (R^2).
Root mean squared error (RMSE).
Median absolute error (MAE).
Logical vector marking outliers (MAD > 3) in the original sky-point set.
Numeric value. Mean squared deviation as in \insertCiteGauch2003;textualrcaiman.
## Not run:
caim <- read_caim()
z <- zenith_image(ncol(caim), lens())
a <- azimuth_image(z)
path <- system.file("external/sky_points.csv", package = "rcaiman")
sky_points <- read.csv(path)[c("Y", "X")]
names(sky_points) <- c("row", "col")
rr <- extract_rr(caim$Blue, z, a, sky_points)
set.seed(7)
model <- fit_cie_model(rr, sun_angles = c(z = 49.5, a = 27.4),
general_sky_type = "Clear", method = "CG")
val <- validate_cie_model(model, k = 10)
val$r_squared
val$rmse
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.