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
Functions
Walks a map structure while applying the function fun
.
Pretty-prints a nested array-like structure (list or tuple) as a table.
Displays results of the function Chi2fit.Fit.chi2probe/4
Displays results of the function Chi2fit.Fit.chi2fit/4
Pretty prints subsequences.
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
Average and standard deviationm (error)
Link to this section Functions
@spec analyze( map :: %{}, fun :: ([number()], Keyword.t() -> Keyword.t()), options :: Keyword.t() ) :: Keyword.t()
Walks a map structure while applying the function fun
.
Pretty-prints a nested array-like structure (list or tuple) as a table.
@spec display(device :: IO.device(), Chi2fit.Fit.chi2probe() | avgsd()) :: none()
Displays results of the function Chi2fit.Fit.chi2probe/4
@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
@spec display_subsequences( device :: IO.device(), trends :: list(), intervals :: [NaiveDateTime.t()] ) :: none()
Pretty prints subsequences.
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]]
Unzips lists of 1-, 2-, 3-, 4-, 5-, 6-, 7-, and 8-tuples.