Skip to content

Commit

Permalink
add one hidden variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jdtuck committed May 20, 2024
1 parent 64416b5 commit b749141
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions fdasrsf/fPCA.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,6 @@ def __init__(self, fdawarp):

def calc_fpca(
self,
no=3,
var_exp=0.99,
stds=np.arange(-1.0, 2.0),
id=None,
Expand All @@ -748,15 +747,13 @@ def calc_fpca(
This function calculates joint functional principal component analysis
on aligned data
:param no: number of components to extract (default = 3)
:param var_exp: compute no based on value percent variance explained
(default: None)
:param id: point to use for f(0) (default = midpoint)
:param stds: number of standard deviations along gedoesic to compute
(default = -1,0,1)
:param parallel: run in parallel (default = F)
:param cores: number of cores for parallel (default = -1 (all))
:type no: int
:type id: int
:type parallel: bool
:type cores: int
Expand Down Expand Up @@ -806,9 +803,7 @@ def calc_fpca(
mh = np.mean(hc, axis=1)

# geodesic paths
no1 = cz.shape[1]
if no >= no1:
no = no1
no = cz.shape[1]
q_pca = np.ndarray(shape=(M, Nstd, no), dtype=float)
f_pca = np.ndarray(shape=(M, Nstd, no), dtype=float)

Expand All @@ -833,6 +828,7 @@ def calc_fpca(

self.q_pca = q_pca
self.f_pca = f_pca
self.eigs = sz
self.latent = sz[0:no]
self.coef = cz[:, 0:no]
self.U_q = Psi_q
Expand Down Expand Up @@ -888,6 +884,8 @@ def project(self, f):
cz = Xi @ self.Uz

self.new_coef = cz
self.new_qn1 = qn1
self.new_h = h

return

Expand Down

0 comments on commit b749141

Please sign in to comment.