1 #ifndef STAN_MATH_PRIM_MAT_FUN_AUTOCOVARIANCE_HPP 2 #define STAN_MATH_PRIM_MAT_FUN_AUTOCOVARIANCE_HPP 38 for (
size_t i = 0; i < y.size(); i++) {
63 template <
typename T,
typename DerivedA,
typename DerivedB>
65 Eigen::MatrixBase<DerivedB>& acov, Eigen::FFT<T>& fft) {
67 acov = acov.array() * (y.array() - y.mean()).
square().sum() / y.size();
92 const Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, 1> > y_map(&y[0], N);
93 Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, 1> > acov_map(&acov[0], N);
113 template <
typename T,
typename DerivedA,
typename DerivedB>
115 Eigen::MatrixBase<DerivedB>& acov) {
Independent (input) and dependent (output) variables for gradients.
fvar< T > square(const fvar< T > &x)
boost::math::tools::promote_args< T >::type variance(const std::vector< T > &v)
Returns the sample variance (divide by length - 1) of the coefficients in the specified standard vect...
void autocovariance(const std::vector< T > &y, std::vector< T > &acov, Eigen::FFT< T > &fft)
Write autocovariance estimates for every lag for the specified input sequence into the specified resu...
void autocorrelation(const std::vector< T > &y, std::vector< T > &ac, Eigen::FFT< T > &fft)
Write autocorrelation estimates for every lag for the specified input sequence into the specified res...