API Docs for: 0.99.4
Show:

JXG.Math.Statistics Class

Module: JXG

Functions for mathematical statistics. Most functions are like in the statistics package R.

Methods

abs

(
  • arr
)
Array | Number

Determines the absolute value of every given value.

Parameters:

Returns:

add

(
  • arr1
  • arr2
)
Array | Number

Adds up two (sequences of) values. If one value is an array and the other one is a number the number is added to every element of the array. If two arrays are given and the lengths don't match the shortest length is taken.

Parameters:

Returns:

div

(
  • arr1
  • arr2
)
Array | Number

Divides two (sequences of) values. If two arrays are given and the lengths don't match the shortest length is taken.

Parameters:

Returns:

divide

() deprecated

max

(
  • arr
)
Number

Extracts the maximum value from the array.

Parameters:

Returns:

Number:

The highest number from the array. It returns NaN if not every element could be interpreted as a number and -Infinity if an empty array is given or no element could be interpreted as a number.

mean

(
  • arr
)
Number

Determines the mean value of the values given in an array.

Parameters:

Returns:

median

(
  • arr
)
Number

The median of a finite set of values is the value that divides the set into two equal sized subsets.

Parameters:

  • arr Array

    The set of values.

Returns:

min

(
  • arr
)
Number

Extracts the minimum value from the array.

Parameters:

Returns:

Number:

The lowest number from the array. It returns NaN if not every element could be interpreted as a number and Infinity if an empty array is given or no element could be interpreted as a number.

mod

(
  • arr1
  • arr2
  • [math=false]
)
Array | Number

Divides two (sequences of) values and returns the remainder. If two arrays are given and the lengths don't match the shortest length is taken.

Parameters:

  • arr1 Array | Number

    Dividend

  • arr2 Array | Number

    Divisor

  • [math=false] Boolean optional

    Mathematical mod or symmetric mod? Default is symmetric, the JavaScript % operator.

Returns:

multiply

(
  • arr1
  • arr2
)
Array | Number

Multiplies two (sequences of) values. If one value is an array and the other one is a number the number is multiplied to every element of the array. If two arrays are given and the lengths don't match the shortest length is taken.

Parameters:

Returns:

prod

(
  • arr
)
Number

Multiplies all elements of the given array.

Parameters:

  • arr Array

    An array of numbers.

Returns:

range

(
  • arr
)
Array

Determines the lowest and the highest value from the given array.

Parameters:

Returns:

Array:

The minimum value as the first and the maximum value as the second value.

sd

(
  • arr
)
Number

Determines the standard deviation which shows how much variation there is from the average value of a set of numbers.

Parameters:

Returns:

subtract

(
  • arr1
  • arr2
)
Array | Number

Subtracts two (sequences of) values. If two arrays are given and the lengths don't match the shortest length is taken.

Parameters:

Returns:

sum

(
  • arr
)
Number

Sums up all elements of the given array.

Parameters:

  • arr Array

    An array of numbers.

Returns:

TheilSenRegression

(
  • coords
)
Array

The Theil-Sen estimator can be used to determine a more robust linear regression of a set of sample points than least squares regression in undefined.

Parameters:

  • coords Array

    Array of {@link JXG.Coords}.

Returns:

Array:

The stdform of the regression line.

variance

(
  • arr
)
Number

Bias-corrected sample variance. A variance is a measure of how far a set of numbers are spread out from each other.

Parameters:

Returns:

weightedMean

(
  • arr
  • w
)
Number

Weighted mean value is basically the same as JXG.Math.Statistics#mean but here the values are weighted, i.e. multiplied with another value called weight. The weight values are given as a second array with the same length as the value array..

Parameters:

Returns:

Throws:

Error:

If the dimensions of the arrays don't match.