Description Usage Arguments Value References See Also Examples
SSE()
computes the sum of squared errors.
1 |
obs |
A numeric vector or matrix, the observed data. Can be continuous values or dicrete. Can be aggregated, and if so you must supply |
pred |
A numeric vector or matrix with predictions, in the same order as |
na.rm |
(optional) Logical (default |
weighted |
(optional) Logical (dfault |
n |
(optional), number of integer vector, required if |
... |
Other parameters to be passed to the methods |
Sum of squared deviations between obs
and pred
, or weighted sum of squared deviations.
Busemeyer, J. R., & Diederich, A. (2010). Nonlinear parameter estimation. In Cognitive Modeling (pp. 43–84). Thousand Oaks, CAL: SAGE Publications.
Other goodness of fit functions:
APE()
,
Accuracy()
,
MAPE()
,
MDAPE()
,
MSE()
,
RMSE()
,
gof()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Example from Busemeyer & Diederich (2010), p. 55 - 56
# Observed relative frequencies of choices as proportions of choice 1, split up by 11 conditions
obs <- c(.9538, .9107, .9204, .9029, .8515, .9197,
.7970, .8228, .8191, .7277, .7276)
# Predictions for each of the 11 conditions
pred <- c(.9526, .9168, .8721, .8229, .7736, .7277,
.6871, .6523, .6232, .5993, .5798)
n <- 200 # all or n = rep(200, 11) # number of observations per condition
sse <- SSE(obs = obs, pred = pred)
# Sum of squared errors (SSE) in paper equals 0.1695
# all.equal(sse, 0.1695, 0.001) # TRUE
wsse <- SSE(obs = obs, pred = cbind(pred, 1-pred), weighted = TRUE, n = 200)
# Weighted sum of squared errors (WSSE) in paper equals 158.4059
# all.equal(wsse, 158.4059, 0.001) TRUE
# minute difference is due to rounding
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.