Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional Principal Component Analysis #40

Closed
1 task
sebffischer opened this issue Aug 3, 2023 · 2 comments · Fixed by #45
Closed
1 task

Functional Principal Component Analysis #40

sebffischer opened this issue Aug 3, 2023 · 2 comments · Fixed by #45
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@sebffischer
Copy link
Member

sebffischer commented Aug 3, 2023

besides the simple feature extraction through PipeOpFFS, another important method is functional PCA.

We can implement a PipeOpFPCA similar to PipeOpFFS that does a functional PCA.

I think the tfb_fpc function can be used here.

  • Add PipeOp to overview in readme
@m-muecke m-muecke self-assigned this Aug 8, 2023
@m-muecke m-muecke added the enhancement New feature or request label Aug 8, 2023
@m-muecke
Copy link
Member

@m-muecke m-muecke linked a pull request Aug 24, 2023 that will close this issue
@sebffischer sebffischer added this to the 0.1.0 milestone Nov 24, 2023
@fabian-s
Copy link

s.th like this should do the trick:

library(tf)
x <- tf_rgp(10)
x_pc <- tfb_fpc(x, pve= .9) # truncate PC decomp at 90% explained variance

# PC score vectors for each function are simply the basis coefficient vectors
# making up the object 
# (without the first one, which is always 1 for the global mean function)
extract_score_matrix <- function(f) {
  assert_class(f, "tfb_fpc")
  f |> unclass() |> sapply(\(x) x[-1]) |> t()
}
extract_score_matrix(x_pc) 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants