[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: leasqr: error: fractional precisions: wrong dimensions
From: |
oxy |
Subject: |
Re: leasqr: error: fractional precisions: wrong dimensions |
Date: |
Tue, 5 Apr 2016 16:55:54 +0200 |
>> options.fract_prec=zeros (size (pin))';
>>
>> I transposed it see the '
>
> Well it fixed it for me so double check what you did.
>
weird! It realy does not fix the problem for me! Double checked!
Do u know how can i test for system differences which can be the
reason for that?
%===========================================================
% Appendix: codes which reproduce the error in my PC
% working with Octave, version 4.0.1, optim Version: 1.5.
% The only difference between both codes is the transposed
options.fract_prec
%===========================================================
% Code 1:
clear all
M=[
5.3900e-01 0.0000e+00
1.0600e+00 1.8838e-01
1.5730e+00 2.7787e-01
2.0900e+00 3.3691e-01
2.6070e+00 3.8265e-01
3.1240e+00 4.1204e-01
3.6410e+00 4.3912e-01
4.1580e+00 4.6368e-01
4.6750e+00 4.8223e-01
5.1920e+00 4.9765e-01
5.7080e+00 5.1288e-01
6.2250e+00 5.2316e-01
6.7420e+00 5.3964e-01
7.2590e+00 5.4866e-01
7.8070e+00 5.6333e-01
8.3240e+00 5.7266e-01
8.8410e+00 5.8163e-01
9.3580e+00 5.9472e-01
9.8750e+00 6.0218e-01
1.0392e+01 6.0394e-01
1.0959e+01 6.1534e-01
1.1473e+01 6.2155e-01
1.1990e+01 6.2744e-01
1.2507e+01 6.3283e-01
1.3023e+01 6.3878e-01
1.3540e+01 6.4856e-01
1.4061e+01 6.5112e-01
1.4574e+01 6.5670e-01
1.5091e+01 6.6284e-01
1.5608e+01 6.6585e-01
1.6125e+01 6.7262e-01
1.6642e+01 6.7582e-01
1.7159e+01 6.8428e-01
1.7676e+01 6.8691e-01
1.8193e+01 6.9230e-01
];
Mt=@(t,p) 1 - exp(-(p(1)*t).^p(2)) ;
pin=[0.1 0.6];
dp=0.001 * ones (size (pin));
stol=0.0000001;
niter=10000;
wts = (1/sqrt(M(:,2)))';
dFdp='dfdp';
options.fract_prec=zeros (size (pin));
options.bounds=[0.01 1e16; 0.1 2 ];
% The following fit renders: error: fractional precisions: wrong dimensions
[f, pfound, cvg, iter]=leasqr(M(:,1), M(:,2), pin, Mt, stol, niter
,wts, dp, dFdp, options)
%================================================================
% Code 2:
clear all
M=[
5.3900e-01 0.0000e+00
1.0600e+00 1.8838e-01
1.5730e+00 2.7787e-01
2.0900e+00 3.3691e-01
2.6070e+00 3.8265e-01
3.1240e+00 4.1204e-01
3.6410e+00 4.3912e-01
4.1580e+00 4.6368e-01
4.6750e+00 4.8223e-01
5.1920e+00 4.9765e-01
5.7080e+00 5.1288e-01
6.2250e+00 5.2316e-01
6.7420e+00 5.3964e-01
7.2590e+00 5.4866e-01
7.8070e+00 5.6333e-01
8.3240e+00 5.7266e-01
8.8410e+00 5.8163e-01
9.3580e+00 5.9472e-01
9.8750e+00 6.0218e-01
1.0392e+01 6.0394e-01
1.0959e+01 6.1534e-01
1.1473e+01 6.2155e-01
1.1990e+01 6.2744e-01
1.2507e+01 6.3283e-01
1.3023e+01 6.3878e-01
1.3540e+01 6.4856e-01
1.4061e+01 6.5112e-01
1.4574e+01 6.5670e-01
1.5091e+01 6.6284e-01
1.5608e+01 6.6585e-01
1.6125e+01 6.7262e-01
1.6642e+01 6.7582e-01
1.7159e+01 6.8428e-01
1.7676e+01 6.8691e-01
1.8193e+01 6.9230e-01
];
Mt=@(t,p) 1 - exp(-(p(1)*t).^p(2)) ;
pin=[0.1 0.6];
dp=0.001 * ones (size (pin));
stol=0.0000001;
niter=10000;
wts = (1/sqrt(M(:,2)))';
dFdp='dfdp';
options.fract_prec=zeros (size (pin))';
options.bounds=[0.01 1e16; 0.1 2 ];
% The following fit renders: error: fractional precisions: wrong dimensions
[f, pfound, cvg, iter]=leasqr(M(:,1), M(:,2), pin, Mt, stol, niter
,wts, dp, dFdp, options)