Closed aa89113 closed 4 months ago
You need project back on the basis stored in obj.U
, that is the singular vectors. The coefficients are the scores.
@jdtuck many thanks for your reply. Performing
((obj.coef.T) @ (obj.U.T)) # n_curve_examples x n_points_per_curve
will project the scores obj.coef
on the eigenfunctions. However, this seems to be in the q
(?) domain.
I am interested on reconstructing the original dataset from principal components. This would be comparable to obj.beta
, but reconstructed from functional scores.
My end goal would be to compare the reconstructed data w/ original dataset.
Correct then transform them back to curves using q_to_curve
@jdtuck many thanks again for your help.
I did the following, but the output does not resemble the original curve, at all ...
reconst_curves_q = ((obj.coef.T) @ (obj.U.T)) # n_curve_examples x n_points_per_curve
reconst_curve_q_first =reconst_curves_q[0].reshape(2, -1) # 2 x n__points_per_curve
reconst_curve_first = cf.q_to_curve(reconst_curve_q_first)
My example is very similar to:
https://fdasrsf-python.readthedocs.io/en/latest/curve_example.html
Can you please help me?
Two things the PCA is done on a tangent space to the Hilbert Sphere, so you need to project back down to the sphere, then convert back to curves (q_to_curve
). Have you read the corresponding papers? See the function sample_shapes
for an example on how to do this.
Hello, I am trying to use SRVF framework and fs.fdacurve with planar curves. I was able to compute the functional principal components, using the following code:
However, I am not sure how can i reconstruct the original planar functions using functional principal scores stored in
obj.coef
. The goal would be to reconstruct the original shapes and after compute a reconstruction error metric Can you please help?