MarkLogic 12 EA 1 Product Documentation
math:linear-model-rsquared

math:linear-model-rsquared(
   $linear-model as math:linear-model
) as xs:double

Summary

Returns the R^2 value of the linear model.

Parameters
linear-model A linear model.

Example

  let $array :=
    for $i in (1 to 10)
    let $j := 2*$i + 1
    return json:to-array(($j,$i))
  let $lm := math:linear-model($array)
  return math:linear-model-rsquared($lm)

  => 1
Powered by MarkLogic Server | Terms of Use | Privacy Policy