# Fitting Data to Grafted Distribution

• I
person123
TL;DR Summary
I want to fit a normal-Weibull grafted distribution to a set of data.
I have a set of data (representing the strength distribution of samples), and I would like to fit a normal-Weibull grafted distribution. To the left of a specified graft point, the distribution is Weibull, and to the right it's normal. At the graft point, the value and the first derivative are equal on the two sides.

I'm currently using MATLAB to fit the data. Parameter ##a## and ##b## for the Weibull distribution are selected, and the values for ##\mu## and ##\sigma## for the normal distribution are solved for using the two constraints. The square error between the data and the distribution is computed. ##a## and ##b## are adjusted to minimize the error.

This approach for the first several iterations is effective. However, at some values for ##a## and ##b##, solving for ##\mu## and ##\sigma## returns no value, causing the iterations to end in an error (I tried avoiding this by ignoring the empty result, but it fails to converge when I do this).

Is there a way of adjusting parameters which would guarantee a grafted distribution regardless the values the parameters take? Is there an alternative approach?

Thank you!

## Answers and Replies

Science Advisor
Homework Helper
It is not clear to me that such a graft always exists to arbitrary precision. Why do you expect this to work?

FactChecker
person123
It is not clear to me that such a graft always exists to arbitrary precision. Why do you expect this to work?
The quick answer is that I've seen previous papers fit grafted distributions to data.

I imagine I'm sometimes not getting a solution because there are cases where the graft doesn't exist for certain values of ##a## and ##b##. However, I'm just trying to find a grafted distribution which fits the data most closely.

Science Advisor
Gold Member
It just seems that it would take a lot of luck to have both the function values equal and the derivatives equal at the same point. But maybe I am missing something that makes it possible.

hutchphd
Science Advisor
Homework Helper
Are you doing this arbitrarily to get a smooth curve ? How do you choose the crossover point? Seems an odd thig to do to me, in addition to my previous reservations.
So after you fit these curves (assuming it "works") what do you use this for?

FactChecker
person123
It just seems that it would take a lot of luck to have both the function values equal and the derivatives equal at the same point. But maybe I am missing something that makes it possible.

Depending on the values of ##a## and ##b##, it is sometimes possible. For example, if you set (I just chose these values randomly):
$$a=1$$$$b=2$$$$x_g=1.5$$

you get:
$$\mu=3.7098...$$$$\sigma=1.2167...$$

Are you doing this arbitrarily to get a smooth curve ?
"Smooth" in that the value and its first derivative are equal at that point.

How do you choose the crossover point?
Hopefully when the CDF is plotted on "Weibullian" paper (where the y-axis is ##\ln(-\ln(1-y))##) the point where the data shifts from a straight line would be the grafting point (where the distribution changes from Weibull to normal).

So after you fit these curves (assuming it "works") what do you use this for?
The data I'm fitting is the strength distribution from molecular simulations. The parameters from the fit will be compared to previous experimental work.

Science Advisor
Summary:: I want to fit a normal-Weibull grafted distribution to a set of data.

Parameter ##a## and ##b## for the Weibull distribution are selected, and the values for ##\mu## and ##\sigma## for the normal distribution are solved for using the two constraints.
What the algorithm does is unclear. It isn't clear how the algorithm determines the "crossover" point. It isn't clear how ##a## and ##b## are selected. (An interesting question is whether there can be situations where the same set given set of parameters ##a,b,c,d## works with two different crossover points.) In mathematics, "constrained optimization" is a vast topic. Are you using a MATLAB function that implements a well known algorithm?

As far as I can determine, "grafted distribution" is not a standard term from mathematical statistics. The only places I find it used online is in an engineering paper https://ascelibrary.org/doi/abs/10.1061/(ASCE)EM.1943-7889.0000396?src=recsys

The put the general idea of fitting a "grafted distribution" to data in standard mathematical terms, it involves fitting "splines" to data. That type of fitting requires using members of some family of curves whose values and derivatives match where the curves join.

The notion of doing a least squares fit of a probability distribution to data is ambiguous. We could do a least squares fit of a probability density function to data if we have a lot of data. However, the more usual situation is that we fit a cumulative probability distribution to a cumulative histogram of data.

If we specify an arbitrary family of probability distributions ##\mathbb{F}## , we cannot be sure that one of distributions provides the best least squares error fit to data. It may be that different members of the family give the same least squares fit.

My guess is that you aren't worried about the mathematical technicalities. You want a fit that pleases you subjectively.

Last edited: