Analyses

AlgebraOfGraphics.linearConstant
linear(x, y; wts = similar(x, 0), interval = length(wts) > 0 ? nothing : :confidence)

Compute a linear fit of y ~ 1 + x. Weighted data is supported via the keyword wts. Use interval to specify what type of interval the shaded band should represent. Valid values of interval are :confidence delimiting the uncertainty of the predicted relationship, and :prediction delimiting estimated bounds for new data points.

source
AlgebraOfGraphics.smoothConstant
smooth(x, y, span=0.75, degreee=2)

Fit a loess model. span is the degree of smoothing, typically in [0,1]. Smaller values result in smaller local context in fitting. degree is the polynomial degree used in the loess model.

source
AlgebraOfGraphics.densityConstant
density(data...; trim = false, boundary, npoints, kernel, bandwidth)

Fit a kernel density estimation of data. Only 1D and 2D are supported so far. The optional keyword arguments are

  • boundary: the lower and upper limits of the kde as a tuple. Due to the fourier transforms used internally, there should be sufficient spacing to prevent wrap-around at the boundaries.
  • npoints: the number of interpolation points to use. The function uses fast Fourier transforms (FFTs) internally, so for optimal efficiency this should be a power of 2 (default = 2048).
  • kernel: the distributional family from Distributions.jl to use as the kernel (default = Normal). To add your own kernel, extend the internal kernel_dist function.
  • bandwidth: the bandwidth of the kernel. Default is to use Silverman's rule.
source
AlgebraOfGraphics.histogramConstant
histogram(data...; bins = automatic, wts = automatic, normalization = :none)

Plot a histogram of values. bins can be an Int to create that number of equal-width bins over the range of values. Alternatively, it can be a sorted iterable of bin edges. The histogram can be normalized by setting normalization. Possible values are:

  • :pdf: Normalize by sum of weights and bin sizes. Resulting histogram has norm 1 and represents a PDF.
  • :density: Normalize by bin sizes only. Resulting histogram represents count density of input and does not have norm 1.
  • :probability: Normalize by sum of weights only. Resulting histogram represents the fraction of probability mass for each bin and does not have norm 1.
  • :none: Do not normalize.

Weighted data is supported via the keyword wts.

source
AlgebraOfGraphics.reducerConstant
reducer(args...; agg=Mean())

Reduce the last argument conditioned on the preceding ones using the online statistic or binary function agg.

source
Note

Analyses are currently not exported. In the future they may be exported or be in their own module.