@langestefan I should clarify that I wasn’t referring specifically to the packages mentioned, but speaking more generally: I can’t just add dependencies simply because they exist. Every dependency introduces long-term maintenance risks, so I’m careful about what I include.
I’m also not undermining the importance of Optim.jl — it’s a great package. But in this particular use case, it didn’t perform as well as needed. More broadly, time series forecasting in Julia is still not a mature area, and sometimes it requires specialized tools. That’s exactly what Durbyn.jl is trying to provide. For example, in the R ecosystem, tsibble was developed specifically for time series even though tibble and data frames already existed - because the needs were different.
Without tsibble, the tidy forecasting framework (Fable) in R simply wouldn’t have been possible.
Similarly, why should I bring in GLM.jl just to compute OLS residuals, when I can simply do:
β = X \ y
fitted = X * β
residuals = y - fitted
function ols(y, X)
β = X \ y
fitted = X * β
residuals = y - fitted
n, p = size(X)
df_residual = n - p
σ2 = sum(residuals .^ 2) / df_residual
XtX = X' * X
cov_β = σ2 * inv(XtX)
se = sqrt.(diag(cov_β))
return OlsFit(β, fitted, residuals, σ2, cov_β, se, df_residual)
end
and wrap that in a lightweight function called ols? That avoids adding a heavy dependency while still providing the functionality needed.
I’m a bit puzzled by the criticism here. For my use case I just need a very small, labeled matrix container—row/column names with shape checks—nothing like the full feature set of DataFrames.jl. Pulling in DataFrames for this would add a heavy dependency which Duryn doesn’t need.
struct NamedMatrix{T}
data::Matrix{T}
rownames::Union{Vector{String},Nothing}
colnames::Vector{String}
function NamedMatrix{T}(data::Matrix{T},
rownames::Union{Vector{String},Nothing},
colnames::Vector{String}) where {T}
if rownames !== nothing && size(data,1) != length(rownames)
error("Row names do not match number of rows")
end
if size(data,2) != length(colnames)
error("Col names do not match number of columns")
end
new{T}(data, rownames, colnames)
end
end