I want to solve a PCA based fitting problem and want to regularize the PCA parameters.
Suppose the number of observations is m,the number of theta is n. I use w1 and w2 to weight the two terms. the formula is:
w1/(2m) *sum_i(||f(xi,yi, theta||^2) + w2/n *||theta||^2
Where these {(xi,yi)} are observations and theta are shape parameters
The weight w1 and w2 is fixed, so we should divided by m.
I chosed w1 and w2 for m=50 by experiment, when I add more observations (some may be noisy),that is become larger, the result become bad and resulted shape is the mean shape although the theta are not zeros.
What's the problem?
I also used the bounds constrained non-linear least squares without parameter regularization,it seems works. But it is very very slow compared to matlab's lsqlin. Why ceres -solver so slow than matlab (matlab is 30X faster than ceres-solver)?