OnlineSampleStatistics
Documentation for OnlineSampleStatistics.
OnlineSampleStatistics.UnivariateStatisticOnlineSampleStatistics.UnivariateStatisticBase.copyBase.empty!Base.mergeBase.merge!Base.merge!Base.readBase.readBase.showBase.summaryBase.summaryBase.writeBase.writeBase.zeroOnlineSampleStatistics.build_from_rawmomentsOnlineSampleStatistics.find_stat_group_idsOnlineSampleStatistics.find_stat_hdusOnlineSampleStatistics.get_momentsOnlineSampleStatistics.get_momentsOnlineSampleStatistics.get_rawmomentsOnlineSampleStatistics.get_rawmomentsOnlineSampleStatistics.isa_stat_hduOnlineSampleStatistics.nonnegativeOnlineSampleStatistics.orderOnlineSampleStatisticsAstroFITSExt._generate_unique_stat_group_idStatistics.meanStatistics.stdStatistics.stdStatistics.varStatsAPI.fit!StatsAPI.fit!StatsAPI.nobsStatsAPI.weightsStatsAPI.weights
OnlineSampleStatistics.UnivariateStatistic — Method
UnivariateStatistic(T::Type, K::Int)Construct an empty UnivariateStatistic with element type T, moment order K, and default weight type Int.
UnivariateStatistic(T::Type, K::Int, I::Type)Construct an empty UnivariateStatistic with element type T, moment order K, and weight type I.
UnivariateStatistic(K::Int, x)Construct from one sample x with moment order K and default unit weight.
UnivariateStatistic(K::Int, x, w)Construct from one sample x with one weight w and moment order K.
UnivariateStatistic(T::Type, K::Int, I::Type, x, w)Construct from one sample x and one weight w with explicit value type T, moment order K, and weight type I.
UnivariateStatistic(T::Type, K::Int, x)Construct from one sample x (converted to T) with default weight type Int and unit weight.
UnivariateStatistic(T::Type, K::Int, I::Type, x, w)Construct from one sample x and one weight w with element type T, moment order K, and weight type I.
UnivariateStatistic(T::Type, K::Int, x::AbstractArray)Construct from an array of samples converted to T.
UnivariateStatistic(K::Int, x::AbstractArray)Construct from an array of samples with moment order K, inferring value type from x (integer arrays are promoted to Float64).
UnivariateStatistic(K::Int, x::AbstractArray, w::AbstractArray)Construct from arrays of samples and weights with moment order K.
UnivariateStatistic(T::Type, K::Int, I::Type, x::AbstractArray, w::AbstractArray)Construct from arrays of samples and weights.
UnivariateStatistic(K::Int)Construct an empty UnivariateStatistic of type Float64 and order K.
OnlineSampleStatistics.UnivariateStatistic — Method
Inner constructor rawmoments can be given as a vector or a NTuple
Base.empty! — Method
empty!(A::UnivariateStatistic)
Reset the UnivariateStatistic `A` to its initial state.Base.merge! — Method
merge!(A::IndependentStatistic, B::IndependentStatistic)Merge the statistics from independent statistic B into A, updating A in-place.
This operation combines the sample statistics from B into A by fitting A with the data represented by B. After merging, A will contain aggregated statistics from both sources.
Arguments
A::IndependentStatistic: The target statistic object to be updated (modified in-place)B::IndependentStatistic: The source statistic object to merge intoA
Returns
A::IndependentStatistic: The updated statistic object
Base.merge! — Method
merge!(A::UnivariateStatistic, B::UnivariateStatistic)Merges (inplace) the statistics from B into A in-place.
Example
A = UnivariateStatistic(2, [1.0, 0.5])
B = UnivariateStatistic(2, [2.0, 1.5])
merge!(A, B)
A ≈ UnivariateStatistic(2, [1.0, 0.5, 2.0, 1.5])Base.merge — Method
merge(A::IndependentStatistic, B::IndependentStatistic)Merge two independent statistics by combining their data.
Creates a copy of statistic A and fits it with the data from statistic B, returning a new merged statistic C.
Arguments
A::IndependentStatistic: The first independent statisticB::IndependentStatistic: The second independent statistic to merge intoA
Returns
C::IndependentStatistic: A new statistic that is the result of mergingAandB
See Also
merge!: In-place version of merge
Base.summary — Method
summary(A::IndependentStatistic)Return a compact one-line summary of the statistic.
Base.summary — Method
summary(A::UnivariateStatistic)Return a compact one-line summary of the statistic.
OnlineSampleStatistics.build_from_rawmoments — Method
UnivariateStatistic(K::Int, x::AbstractArray{T}) where {T<:Number}Constructs a UnivariateStatistic object storing the first K moments from the vector of samples x.
OnlineSampleStatistics.get_moments — Method
get_moments(x::AbstractArray{UnivariateStatistic}, k::Int)Retrieve the k-th moments from an array of UnivariateStatistic objects. Returns an array where each element corresponds to the k-th moment of the respective UnivariateStatistic in x.
OnlineSampleStatistics.get_moments — Method
get_moments(A::UnivariateStatistic, k) -> NumberCompute the k-th moment of a UnivariateStatistic A.
OnlineSampleStatistics.get_rawmoments — Method
get_rawmoments(x::AbstractArray{UnivariateStatistic}, k::Int)Retrieve the k-th raw moments from an array of UnivariateStatistic objects. Returns an array where each element corresponds to the k-th raw moment of the respective UnivariateStatistic in x.
OnlineSampleStatistics.get_rawmoments — Method
get_rawmoments(x::AbstractArray{<:UnivariateStatistic})Retrieve the raw moments from an array of UnivariateStatistic objects. Returns an array where each element corresponds to the raw moments of the respective UnivariateStatistic in x.
OnlineSampleStatistics.nonnegative — Method
nonnegative(x)Check if the input x is nonnegative (greater than or equal to zero).
OnlineSampleStatistics.order — Method
" order(A::UnivariateStatistic) Return the number of moments in a A.
Statistics.mean — Method
mean(A::UnivariateStatistic)Compute the sample mean of a A
Statistics.std — Method
std(A::UnivariateStatistic; corrected=true)Compute the sample standard deviation of a A, from its variance (corrected by default).
Statistics.std — Method
std(A::IndependentStatistic; corrected=true)Compute the sample standard deviation of a A, from its variance (corrected by default).
Statistics.var — Method
var(A::UnivariateStatistic; corrected=true)Compute the sample variance of a A. If corrected is true, the variance is corrected for bias. The unbias variance estimator is only available for an integer number of sample.
StatsAPI.fit! — Method
fit!(A::IndependentStatistic{T,N,K}, B::IndependentStatistic)Merge the accumulated statistics in B into A in-place. A must have compatible element type and size, and its number of moments K must be less than or equal to the one of B.
StatsAPI.fit! — Method
fit!(A::UnivariateStatistic{T}, y::T2) where {T, T2}Pushes a new samples y into the UnivariateStatistic A.
Throws
ArgumentError: If the type of elements inyis not compatible with the typeTofA.
StatsAPI.nobs — Method
nobs(A::UnivariateStatistic)Return the number of samples or the sum of weights in a A.
StatsAPI.weights — Method
weights(x::AbstractArray{UnivariateStatistic})Retrieves the weights from an array of UnivariateStatistic objects.
StatsAPI.weights — Method
weights(A::UnivariateStatistic)Return the sum of weights in a A.
Base.write — Method
write(file::FitsFile, hdr::AstroFITS.OptionalHeader,
stat::IndependentStatistic, stat_group_id::String)Write stat to file using stat_group_id. Throws ArgumentError if stat_group_id is already used by another statistic in the same FITS file.
Base.write — Method
write(file::FitsFile, hdr::AstroFITS.OptionalHeader, stat::IndependentStatistic)Write stat to file using a freshly generated unique group ID.
OnlineSampleStatistics.find_stat_group_ids — Method
find_stat_group_ids(fitsfile::FitsFile)Return unique statistic group IDs found in fitsfile. Only HDUs recognized by isa_stat_hdu and carrying the STAT-GROUP-ID keyword are considered.
OnlineSampleStatistics.find_stat_hdus — Method
find_stat_hdus(fitsfile::FitsFile, stat_group_id::String)Find all HDUs belonging to stat_group_id and return (moments_hdus, weights_hdu, T, N, K, W). Throws ArgumentError if required HDUs or metadata are missing/inconsistent.
OnlineSampleStatistics.isa_stat_hdu — Method
isa_stat_hdu(hdu)Return true if hdu is an image HDU tagged as an OnlineSampleStatistics HDU.
OnlineSampleStatisticsAstroFITSExt._generate_unique_stat_group_id — Method
_generate_unique_stat_group_id(file::FitsFile)Generate a random group ID that is not already present in file.