View source: R/metricsInternal.R
defineInternalMetric | R Documentation |
Define an internal metric for lcModels
defineInternalMetric(
name,
fun,
warnIfExists = getOption("latrend.warnMetricOverride", TRUE)
)
name |
The name of the metric. |
fun |
The function to compute the metric, accepting a lcModel object as input. |
warnIfExists |
Whether to output a warning when the metric is already defined. |
Other metric functions:
defineExternalMetric()
,
externalMetric()
,
getExternalMetricDefinition()
,
getExternalMetricNames()
,
getInternalMetricDefinition()
,
getInternalMetricNames()
,
metric()
defineInternalMetric("BIC", fun = BIC)
mae <- function(object) {
mean(abs(residuals(object)))
}
defineInternalMetric("MAE", fun = mae)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.