Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/arima.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <cmath>
#include <span>
#include <vector>
#include <stdexcept>

#include <pybind11/numpy.h>
#include <pybind11/pybind11.h>
Expand Down Expand Up @@ -136,7 +137,13 @@ arima_css(const py::array_t<double> yv, const py::array_t<int32_t> armav,

py::array_t<double> residv(n);
const auto resid = make_span(residv);
if (static_cast<size_t>(ncond) > resid.size()) {
throw std::logic_error(
"Internal error: resid length must be >= ncond"
);
}
std::fill_n(resid.begin(), ncond, 0.0);

std::vector<double> w(y.begin(), y.end());

for (size_t _ = 0; _ < d; ++_) {
Expand Down