MATLAB: Weighted lsqcurvefit, applying weight to the start of curve

lsqcurvefitMATLAB and Simulink Student Suiteregressionweights

I am writing code to fit different analytic models of a simple compression test.
I have been using lsqcurvefit and got a good first attempt result.
First_Fit.jpg
The problem with the lsqcurvefit (I think) is that it tries for the best possible solution, which is great in most cases. But for me the most important parts of the fitting would be the first half of the curve, divergence afterwards isn't too bad. I have looked into trying to include weighting to the fit, but the documentation I have looked at was more weighting towards the number of measurements rather than difference.
To clarify, being off by 5 at a value of 500 (1% in the middle of the curve) is not as important as being off by 5 at a value of 10 (50% at the start of the curve). As can be seen in my attempt there is agreement in the middle of the curve, but not at either ends. I would like to try and weight the fitting to the first half of the curve, or try a LSQ method that works by a mean % deviation from the curve rather than absolute deviation.
I hope that made sense! I've attached my code.
data = xlsread('C_P_1.xlsx'); % two columns of data
a = 133; % area of surface mm^2
Area = pi*a^2;
xdata = data(:,1);
ydata = data(:,2);
plot(xdata,ydata)
L = 1 - xdata./100;
%Analytic Function
fun = @(W,xdata) -Area.*(2.*W(1).*((L.^2) - 1./L) - 2.*W(2).*((1./L.^2) - L));
%starting guess
Wguess = [-0.081,0.086];
[W,fminres] = lsqcurvefit(fun,Wguess,xdata,ydata)

Best Answer

One option would be to create a weighting vector defined for example as:
Wgt = 1./(xdata + q);
where ‘q’ is defined as some constant that keeps ’Wgt’ within reasonable limits. The weighting vector can be anything you want.