View Source Chi2fit.Utilities (Chi-SquaredFit v2.0.2)

Provides various utilities:

  • Bootstrapping
  • Creating Cumulative Distribution Functions / Histograms from sample data
  • Autocorrelation coefficients

Link to this section Summary

Types

Average and standard deviationm (error)

Functions

Walks a map structure while applying the function fun.

Pretty-prints a nested array-like structure (list or tuple) as a table.

Outputs and formats the errors that result from a call to Chi2fit.Fit.chi2/4

Reads data from a file specified by filename and returns a stream with the data parsed as floats.

Examples

iex> subsequences []
[]

iex> subsequences [:a, :b]
[[:a], [:a, :b]]

iex> Stream.cycle([1,2,3]) |> subsequences |> Enum.take(4)
[[1], [1, 2], [1, 2, 3], [1, 2, 3, 1]]

Unzips lists of 1-, 2-, 3-, 4-, 5-, 6-, 7-, and 8-tuples.

Link to this section Types

@type avgsd() :: {avg :: float(), sd :: float()}

Average and standard deviationm (error)

Link to this section Functions

Link to this function

analyze(map, fun, options)

View Source
@spec analyze(
  map :: %{},
  fun :: ([number()], Keyword.t() -> Keyword.t()),
  options :: Keyword.t()
) ::
  Keyword.t()

Walks a map structure while applying the function fun.

@spec as_table(rows :: [any()], header :: tuple()) :: list()

Pretty-prints a nested array-like structure (list or tuple) as a table.

Link to this function

display(device \\ :stdio, results)

View Source
@spec display(device :: IO.device(), Chi2fit.Fit.chi2probe() | avgsd()) :: none()

Displays results of the function Chi2fit.Fit.chi2probe/4

Link to this function

display(device \\ :stdio, hdata, model, arg, options)

View Source
@spec display(
  device :: IO.device(),
  hdata :: Chi2fit.Statistics.ecdf(),
  model :: Chi2fit.Distribution.Utilities.model(),
  Chi2fit.Fit.chi2fit(),
  options :: Keyword.t()
) :: none()

Displays results of the function Chi2fit.Fit.chi2fit/4

Link to this function

display_subsequences(device \\ :stdio, trends, intervals)

View Source
@spec display_subsequences(
  device :: IO.device(),
  trends :: list(),
  intervals :: [NaiveDateTime.t()]
) ::
  none()

Pretty prints subsequences.

Link to this function

puts_errors(device \\ :stdio, errors)

View Source
@spec puts_errors(device :: IO.device(), errors :: tuple()) :: none()

Outputs and formats the errors that result from a call to Chi2fit.Fit.chi2/4

Errors are tuples of length 2 and larger: {[min1,max1], [min2,max2], ...}.

@spec read_data(filename :: String.t()) :: Enumerable.t()

Reads data from a file specified by filename and returns a stream with the data parsed as floats.

It expects a single data point on a separate line and removes entries that:

  • are not floats, and
  • smaller than zero (0)
@spec subsequences(Enumerable.t()) :: Enumerable.t()

examples

Examples

iex> subsequences []
[]

iex> subsequences [:a, :b]
[[:a], [:a, :b]]

iex> Stream.cycle([1,2,3]) |> subsequences |> Enum.take(4)
[[1], [1, 2], [1, 2, 3], [1, 2, 3, 1]]
@spec unzip(list :: [tuple()]) :: tuple()

Unzips lists of 1-, 2-, 3-, 4-, 5-, 6-, 7-, and 8-tuples.