Skip to content

Commit

Permalink
center() to return the FEM expansion coefficients of the mean field, …
Browse files Browse the repository at this point in the history
…removed pointwise centering routine
  • Loading branch information
AlePalu committed Jan 23, 2024
1 parent adf30a0 commit aa697d2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 180,011 deletions.
9 changes: 1 addition & 8 deletions fdaPDE/models/functional/center.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,7 @@ CenterReturnType center(const DMatrix<double>& X, SmootherType_&& smoother, Cali
smoother.init();
smoother.solve();
// compute mean matrix and return
DMatrix<double> mean = smoother.fitted().replicate(1, X.rows()).transpose();
return {X - mean, mean};
}

// pointwise centering of the data matrix X
CenterReturnType center(const DMatrix<double>& X) {
DMatrix<double> mean = (X.colwise().sum().transpose() / X.rows()).replicate(1, X.rows()).transpose();
return {X - mean, mean};
return {X - smoother.fitted().replicate(1, X.rows()).transpose(), smoother.f()};
}

} // namespace models
Expand Down
Loading

0 comments on commit aa697d2

Please sign in to comment.