Goodness of Fit - Coefficient of Variation {ehaGoF} | R Documentation |
Coefficient of Variation.
Description
Calculates and returns goodness of fit - coefficient of variation (CV).
Usage
gofCV(Obs, Prd, dgt=3)
Arguments
Obs |
Observed or measured values or target vector. |
Prd |
Predicted or fitted values by the model. Values produced by approximation or regression. |
dgt |
Number of digits in decimal places. Default is 3. |
Value
CoeficientOfVariation |
Goodness of fit - coefficient of variation (CV). |
Author(s)
Prof. Dr. Ecevit Eyduran, TA. Alper Gulbe
References
Comparison of Different Data Mining Algorithms for Prediction of Body Weight From Several Morphological Measurements in Dogs - S Celik, O Yilmaz
Examples
# dummy inputs, independent variable
# integers from 0 to 19
inputs <- 0:19
# dummy targets/observed values, dependent variable
# a product of 2*times inputs minus 5 with some normal noise
targets <- -5 + inputs*1.2 + rnorm(20)
# linear regression model
model<-lm(targets~inputs)
# model's predicted values against targets
predicted<-model$fitted.values
# using library ehaGoF for goodness of fit.
library(ehaGoF)
# Goodness of fit - coefficient of variation (CV)
gofCV(targets, predicted)
[Package ehaGoF version 0.1.1 Index]