Hi,
i want use the gsl-solver lmsder for the follwing model:
fi = Yi - yi
Yi = log(gsl_cdf_gamma_Q(t,a,b)
i use a numerical approximation for the derivatives of a and b:
da = a*0,01
db = b*0,01
dfi/da = log(((gsl_cdf_gamma_Q(t,a+da,b)-gsl_cdf_gamma_Q(t,a-da,b))/2*da)
dfi/db = log(((gsl_cdf_gamma_Q(t,a,b+db)-gsl_cdf_gamma_Q(t,a,b-db))/2*db)
my problemes are:
1. solver calculate negative a and b values - negativ values are not allowed in
the gamma-distribution function
2. good starting values lead to good results but how can I determine good
starting values at runtime ?
for example - fitting for a particular dataset (have dertermined a, b with
common statistic software)
start values for a = 0.1 b = 3.0 result: a = 0.17874; b = 3.11659 ->
chisq/dof = 0.29 = perfect result
start for the same dataset with a = 0.1 b = 3.5 => a = -0.00151 b = 3.56884
- the iteration has not convergend yet
I tried the following solutions:
1. if a or b is negativ set value for fi to 0.0 in gamma_f - otherwise i have
to stop the iteration with a function
error-code
2. if a or b is negativ set value for Jacobian matrix J(i,j) to 0.0 in gamma_df
Can anybody help me ?
Thanks
johann
_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl