NLreg.jl
NLreg.NLregModel — TypeNLregModel{T<:AbstractFloat}A representation of a nonlinear regression model. The important fields are
data: aTables.RowTableof data valuesysym: the name of the response variable indata, as aSymbolmodel: a function of two arguments - parameters and data - both asNamedTuplesparref: aRef{R} where {R<:NamedTuple}containing the current parameter valuesoptsum: aNamedTupleof information on the optimization
StatsBase generics with methods for NLregModel
StatsBase.coef — Functioncoef(obj::StatisticalModel)Return the coefficients of the model.
StatsBase.coefnames — Functioncoefnames(obj::StatisticalModel)Return the names of the coefficients.
StatsBase.coeftable — Functioncoeftable(obj::StatisticalModel; level::Real=0.95)Return a table of class CoefTable with coefficients and related statistics. level determines the level for confidence intervals (by default, 95%).
StatsBase.dof_residual — Functiondof_residual(obj::RegressionModel)Return the residual degrees of freedom of the model.
StatsBase.fit — Functionfit(Histogram, data[, weight][, edges]; closed=:left, nbins)Fit a histogram to data.
Arguments
data: either a vector (for a 1-dimensional histogram), or a tuple of vectors of equal length (for an n-dimensional histogram).weight: an optionalAbstractWeights(of the same length as the data vectors), denoting the weight each observation contributes to the bin. If no weight vector is supplied, each observation has weight 1.edges: a vector (typically anAbstractRangeobject), or tuple of vectors, that gives the edges of the bins along each dimension. If no edges are provided, these are determined from the data.
Keyword arguments
closed: if:left(the default), the bin intervals are left-closed [a,b); if:right, intervals are right-closed (a,b].nbins: if noedgesargument is supplied, the approximate number of bins to use along each dimension (can be either a single integer, or a tuple of integers).
Examples
# Univariate
h = fit(Histogram, rand(100))
h = fit(Histogram, rand(100), 0:0.1:1.0)
h = fit(Histogram, rand(100), nbins=10)
h = fit(Histogram, rand(100), weights(rand(100)), 0:0.1:1.0)
h = fit(Histogram, [20], 0:20:100)
h = fit(Histogram, [20], 0:20:100, closed=:right)
# Multivariate
h = fit(Histogram, (rand(100),rand(100)))
h = fit(Histogram, (rand(100),rand(100)),nbins=10)Fit a statistical model.
fit(ZScoreTransform, X; dims=nothing, center=true, scale=true)Fit standardization parameters to vector or matrix X and return a ZScoreTransform transformation object.
Keyword arguments
dims: if1fit standardization parameters in column-wise fashion; if2fit in row-wise fashion. The default isnothing, which is equivalent todims=2with a deprecation warning.center: iftrue(the default) center data so that its mean is zero.scale: iftrue(the default) scale the data so that its variance is equal to one.
Examples
julia> using StatsBase
julia> X = [0.0 -0.5 0.5; 0.0 1.0 2.0]
2×3 Array{Float64,2}:
0.0 -0.5 0.5
0.0 1.0 2.0
julia> dt = fit(ZScoreTransform, X, dims=2)
ZScoreTransform{Float64}(2, 2, [0.0, 1.0], [0.5, 1.0])
julia> StatsBase.transform(dt, X)
2×3 Array{Float64,2}:
0.0 -1.0 1.0
-1.0 0.0 1.0fit(UnitRangeTransform, X; dims=nothing, unit=true)Fit a scaling parameters to vector or matrix X and return a UnitRangeTransform transformation object.
Keyword arguments
dims: if1fit standardization parameters in column-wise fashion;
if 2 fit in row-wise fashion. The default is nothing.
unit: iftrue(the default) shift the minimum data to zero.
Examples
julia> using StatsBase
julia> X = [0.0 -0.5 0.5; 0.0 1.0 2.0]
2×3 Array{Float64,2}:
0.0 -0.5 0.5
0.0 1.0 2.0
julia> dt = fit(UnitRangeTransform, X, dims=2)
UnitRangeTransform{Float64}(2, 2, true, [-0.5, 0.0], [1.0, 0.5])
julia> StatsBase.transform(dt, X)
2×3 Array{Float64,2}:
0.5 0.0 1.0
0.0 0.5 1.0StatsBase.fit! — FunctionFit a statistical model in-place.
StatsBase.fitted — Functionfitted(obj::RegressionModel)Return the fitted values of the model.
StatsBase.nobs — Functionnobs(obj::StatisticalModel)Return the number of independent observations on which the model was fitted. Be careful when using this information, as the definition of an independent observation may vary depending on the model, on the format used to pass the data, on the sampling plan (if specified), etc.
StatsBase.residuals — Functionresiduals(obj::RegressionModel)Return the residuals of the model.
StatsBase.response — Functionresponse(obj::RegressionModel)Return the model response (a.k.a. the dependent variable).
StatsBase.rss — Functionrss(obj::StatisticalModel)Return the residual sum of squares.
StatsBase.stderror — Functionstderror(obj::StatisticalModel)Return the standard errors for the coefficients of the model.
StatsBase.vcov — Functionvcov(obj::StatisticalModel)Return the variance-covariance matrix for the coefficients of the model.