FunctionalPCA, checkGradient, checkHessian