Curve fitting result from random sampling test doesn't make sense

3 Ansichten (letzte 30 Tage)
Inso
Inso am 17 Jan. 2018
Bearbeitet: Inso am 17 Jan. 2018
Background: I'm designing a sampling test to observe the relationship between sample lifetime and the stress(temperature). The test, basicly, is to apply some acceleration tests under different temperatures(T) to samples and then collect the life data, and fit the curve of life and T.
Problem: What I want to know is the influence of the observation points (temperatures for the tests) on the curve fitting results.So I made a random sampling test using Matlab. The outline of the test is simple: 1.Generate random life data under diffrerent Ts(2 fixed, 1 variable) from an exsiting curve 2. Fit the data back to get the curve parameters and compare them with the exsiting ones, and also calculate the varaiation. 3. Use the data from the 2 fixed Ts as the control group to see influence of the Variable T.
The code:
clc;
clear;
p=[0.6,3e3];
modelarn=@(p,x)exp(-p(1)+p(2)./(x+273)); % existing curve
T(1)=100;T(2)=200; % 2 fixed temperatures
startingvals=[0.6 3e3];
aa=100:200;
for a=1:length(aa)
for j=1:100
for i=1:3
T(3)=aa(a); % variable temperature
pps(i)=modelarn(p,T(i));
rnd(i,:)=normrnd(pps(i),0.8*pps(i),1,8); % generate random life data
wbl_para(i,:)=normfit(rnd(i,:)); % fit the data distribution
end
model_para(j,:)=nlinfit(T(1:3),wbl_para(1:3,1)',modelarn,startingvals); % fit the curve
model_para1(j,:)=nlinfit(T(1:2),wbl_para(1:2,1)',modelarn,startingvals); % use T(1),T(2) as control group
end
ratio_n(a)=mean(model_para(:,2))/p(2)-1; % comparison
std_n(a)=std(model_para(:,2));
ratio_n1(a)=mean(model_para1(:,2))/p(2)-1;
std_n1(a)=std(model_para1(:,2));
end
figure(1); % plot the results
plot(aa,abs(ratio_n),aa,abs(ratio_n1));
figure(2)
plot(aa, std_n,aa, std_n1);
And as can be seen from the results (the X axis is the variable T and the Y axis is standard deviation),the Std of the fitted curve parameter peaks around 105 and is much higher than the control group's mostly. The accuracy figure is similar (not shown). So the problem is that why the fitting results become worse when there are more observation points? The result doesn't make sense. Thank u very much,

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!