Re: [math] LevenbergMarquardtOptimizer unable to perform Q.R decomposition on the 107x2 jacobian matrix

2014-07-09 Thread Tritglorlee
What I am looking for is a mature and easy-to-integrate 2d qr code barcode
creating application that can be applied to java programming project to
produce a  java qr code barcode
 
.



--
View this message in context: 
http://apache-commons.680414.n4.nabble.com/math-LevenbergMarquardtOptimizer-unable-to-perform-Q-R-decomposition-on-the-107x2-jacobian-matrix-tp4654105p4665221.html
Sent from the Commons - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [math] LevenbergMarquardtOptimizer unable to perform Q.R decomposition on the 107x2 jacobian matrix

2013-10-02 Thread Gilles

Hi.

On Tue, 01 Oct 2013 15:47:11 +0200, Christian wrote:

Hello

I really need your help to get the LevenbergMarquardtOptimizer up and
running. Please see the attached compileable code.


[You seem to use two Commons Math versions (cf. "math" and "math3" in 
the
"import" statements). It's better to use one and the latest version 
when

posting here.]



No matter how I try to return the gradients an Exception will raise
... hmmm get stuck ...


Is it correct that coefficients "A", "B", "C1" and "C2" depends on
parameters "m" and "w"?
In the affirmative, shouldn't they contribute to the gradient?

Even if not, perhaps it is a wrong usage of the "DerivativeStructure".
It seems that the operations you apply on "f" won't produce the 
intended

function: e.g.
  f = f.add(B).multiply(tc-t).pow(m);
will produce
  ((A + B) * (tc - t))^m
not
  A + B * (tc - t)^m

Regards,
Gilles


[...]



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



[math] LevenbergMarquardtOptimizer unable to perform Q.R decomposition on the 107x2 jacobian matrix

2013-10-01 Thread Christian
sorry just jet realized the note: *Note:*please don't send patches or 
attachments to any of the mailing lists. Patches are best handled via 
theIssue Tracking 
system. 
Otherwise, please upload the file to a public server and include the URL 
in the mail.

so here is the url: http://snipt.org/Ahihj0


Hello

I really need your help to get the LevenbergMarquardtOptimizer up and 
running. Please see the attached compileable code.


No matter how I try to return the gradients an Exception will raise ... 
hmmm get stuck ...


Thanks
Christian

Stack:
run:
true
tc 2012.2765286077058
Test A,B,C1,C2 [501.2905381669908, 245.5260642192166, -212.706661273106, 
400.8921485235668]

Curve fitting ...
Exception in thread "main" 
org.apache.commons.math3.exception.ConvergenceException: illegal state: 
unable to perform Q.R decomposition on the 107x2 jacobian matrix
at 
org.apache.commons.math3.optim.nonlinear.vector.jacobian.LevenbergMarquardtOptimizer.qrDecomposition(LevenbergMarquardtOptimizer.java:884)
at 
org.apache.commons.math3.optim.nonlinear.vector.jacobian.LevenbergMarquardtOptimizer.doOptimize(LevenbergMarquardtOptimizer.java:331)
at 
org.apache.commons.math3.optim.nonlinear.vector.jacobian.LevenbergMarquardtOptimizer.doOptimize(LevenbergMarquardtOptimizer.java:113)
at 
org.apache.commons.math3.optim.BaseOptimizer.optimize(BaseOptimizer.java:143)
at 
org.apache.commons.math3.optim.BaseMultivariateOptimizer.optimize(BaseMultivariateOptimizer.java:66)
at 
org.apache.commons.math3.optim.nonlinear.vector.MultivariateVectorOptimizer.optimize(MultivariateVectorOptimizer.java:87)
at 
org.apache.commons.math3.optim.nonlinear.vector.JacobianMultivariateVectorOptimizer.optimize(JacobianMultivariateVectorOptimizer.java:83)
at 
org.apache.commons.math3.optim.nonlinear.vector.jacobian.AbstractLeastSquaresOptimizer.optimize(AbstractLeastSquaresOptimizer.java:197)
at 
org.apache.commons.math3.fitting.CurveFitter.fit(CurveFitter.java:172)
at 
org.apache.commons.math3.fitting.CurveFitter.fit(CurveFitter.java:136)
at 
tryout.Sornette2NoLogPriceLevenberg.main(Sornette2NoLogPriceLevenberg.java:62)

Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)




[math] LevenbergMarquardtOptimizer unable to perform Q.R decomposition on the 107x2 jacobian matrix

2013-10-01 Thread Christian

Hello

I really need your help to get the LevenbergMarquardtOptimizer up and 
running. Please see the attached compileable code.


No matter how I try to return the gradients an Exception will raise ... 
hmmm get stuck ...


Thanks
Christian

Stack:
run:
true
tc 2012.2765286077058
Test A,B,C1,C2 [501.2905381669908, 245.5260642192166, -212.706661273106, 
400.8921485235668]

Curve fitting ...
Exception in thread "main" 
org.apache.commons.math3.exception.ConvergenceException: illegal state: 
unable to perform Q.R decomposition on the 107x2 jacobian matrix
at 
org.apache.commons.math3.optim.nonlinear.vector.jacobian.LevenbergMarquardtOptimizer.qrDecomposition(LevenbergMarquardtOptimizer.java:884)
at 
org.apache.commons.math3.optim.nonlinear.vector.jacobian.LevenbergMarquardtOptimizer.doOptimize(LevenbergMarquardtOptimizer.java:331)
at 
org.apache.commons.math3.optim.nonlinear.vector.jacobian.LevenbergMarquardtOptimizer.doOptimize(LevenbergMarquardtOptimizer.java:113)
at 
org.apache.commons.math3.optim.BaseOptimizer.optimize(BaseOptimizer.java:143)
at 
org.apache.commons.math3.optim.BaseMultivariateOptimizer.optimize(BaseMultivariateOptimizer.java:66)
at 
org.apache.commons.math3.optim.nonlinear.vector.MultivariateVectorOptimizer.optimize(MultivariateVectorOptimizer.java:87)
at 
org.apache.commons.math3.optim.nonlinear.vector.JacobianMultivariateVectorOptimizer.optimize(JacobianMultivariateVectorOptimizer.java:83)
at 
org.apache.commons.math3.optim.nonlinear.vector.jacobian.AbstractLeastSquaresOptimizer.optimize(AbstractLeastSquaresOptimizer.java:197)
at 
org.apache.commons.math3.fitting.CurveFitter.fit(CurveFitter.java:172)
at 
org.apache.commons.math3.fitting.CurveFitter.fit(CurveFitter.java:136)
at 
tryout.Sornette2NoLogPriceLevenberg.main(Sornette2NoLogPriceLevenberg.java:62)

Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)


package tryout;

import java.sql.Date;
import java.util.Calendar;
import java.util.Arrays;
import org.apache.commons.math3.linear.Array2DRowRealMatrix;
import org.apache.commons.math3.linear.ArrayRealVector;
import org.apache.commons.math3.linear.DecompositionSolver;
import org.apache.commons.math3.linear.LUDecomposition;
import org.apache.commons.math3.linear.RealMatrix;
import org.apache.commons.math3.linear.RealVector;
import org.apache.commons.math.util.FastMath;
import org.apache.commons.math3.analysis.ParametricUnivariateFunction;
import org.apache.commons.math3.analysis.differentiation.DerivativeStructure;
import org.apache.commons.math3.fitting.CurveFitter;
import 
org.apache.commons.math3.optim.nonlinear.vector.jacobian.LevenbergMarquardtOptimizer;

import static org.apache.commons.math.util.FastMath.pow;
import static org.apache.commons.math.util.FastMath.cos;
import static org.apache.commons.math.util.FastMath.sin;

public class Sornette2NoLogPriceLevenberg {
static String[] T = new 
String[]{"2010-04-01","2010-04-05","2010-04-06","2010-04-07","2010-04-08","2010-04-09","2010-04-12","2010-04-13","2010-04-14","2010-04-15","2010-04-16","2010-04-19","2010-04-20","2010-04-21","2010-04-22","2010-04-23","2010-04-26","2010-04-27","2010-04-28","2010-04-29","2010-04-30","2010-05-03","2010-05-04","2010-05-05","2010-05-06","2010-05-07","2010-05-10","2010-05-11","2010-05-12","2010-05-13","2010-05-14","2010-05-18","2010-05-19","2010-05-20","2010-05-21","2010-05-24","2010-05-25","2010-05-26","2010-05-27","2010-05-28","2010-06-01","2010-06-02","2010-06-03","2010-06-04","2010-06-07","2010-06-08","2010-06-09","2010-06-10","2010-06-11","2010-06-14","2010-06-15","2010-06-16","2010-06-17","2010-06-18","2010-06-21","2010-06-22","2010-06-23","2010-06-24","2010-06-25","2010-06-28","2010-06-29","2010-06-30","2010-07-01","2010-07-02","2010-07-06","2010-07-07","2010-07-08","2010-07-09","2010-07-12","2010-07-13","2010-07-14","2010-07-15","2010-07-16","2010-07-19","2010-07-20","2010-07-21","2010-07-22","2010-07-23","2010-07-26","2010-07-27","2010-07-28","2010-07-29","2010-07-30","2010-08-02","2010-08-03","2010-08-04","2010-08-05","2010-08-06","2010-08-09","2010-08-10","2010-08-11","2010-08-12","2010-08-13","2010-08-16","2010-08-17","2010-08-18","2010-08-19","2010-08-20","2010-08-23","2010-08-24","2010-08-25","2010-08-26","2010-08-27","2010-08-30","2010-08-31","2010-09-01","2010-09-02","2010-09-03","2010-09-07","2010-09-08","2010-09-09","2010-09-10","2010-09-13","2010-09-14","2010-09-15","2010-09-16","2010-09-17","2010-09-20","2010-09-21","2010-09-22","2010-09-23","2010-09-24","2010-09-27","2010-09-28","2010-09-29","2010-09-30","2010-10-01","2010-10-04","2010-10-05","2010-10-06","2010-10-07","2010-10-08","2010-10-11","2010-10-12","2010-10-13","2010-10-14","2010-10-15","2010-10-18","2010-10-19","2010-10-20","2010-10-21","2010-10-22","2010-10-25","2010-10-26","2010-10-27","2010-10-28","2010-10-29","2010-11-01","2010-11-02","2010-11-03","2010-11-04","2010-11-05","2010-11-08","2010-11-09","2010-11-10","2010-11-11","2010-11-12","2010-11-15","2010-11-16