Hi all, I've been searching the documentation and the Mathworks Community for a while now and haven't found quite what I need (or maybe I have but haven't realized it yet). Basically, I would like to fit a non-linear model to some data I have.
I have the following non-linear model (analytic approximation to a step function, where "erf" is the error function): y = a * { 1 + erf [ b * ( x + c ) ] } + d . I can fit this model to my data without issue (I've been using the "fit" function in conjunction with a custom fittype …should I use another?). What I would like to do now, however, is to include a known uncertainty value in my fitting procedure (the uncertainty is a constant…extracted from the 95% error in the noise value prior to the step-change in my data). How can I include this known, constant-valued measurement uncertainty in the fitting and not have the fit only do its regression based on minimizing error between the data and the curve it generates, but rather to consider this measurement uncertainty value as well?
My first thought was to use a weighting matrix, but since the measurement uncertainty is constant, I think weighting isn't used for that (I'm not a stats expert, so please correct me if I'm wrong here).
Best Answer