Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fit with cdf of skew normal distriubtion

31 views
Skip to first unread message

Tom Pether

unread,
Sep 1, 2010, 6:27:39 AM9/1/10
to
Hi,

to am trying to fit the integral of the skew normal distribution to a
set of data. xhis is my fit function:

upperlimit[x_, y0_, p2_, a_] = p2 (1 - (x/y0)^(1/a));
f[x_, y0_, a_, p2_, s_, skew_, A_, b_, p_] :=
b - 2 A NIntegrate[
PDF[NormalDistribution[p, s], x] CDF[
NormalDistribution[p*skew, s], (skew*x)], {x, -100,
uperlimit[x, y0, p2, a]}, MaxPoints -> 200, MaxRecursion -> 6,
PrecisionGoal -> 4];

then i call the fit by

FitResult =
NonlinearModelFit[data, f[x, y0, a, p2, s, skew, A, b, p], init,
{index, t},
Weights -> weights, VarianceEstimatorFunction -> Automatic,
PrecisionGoal -> 4];

if i then want to get error estimates for the fit parameters by calling

FitResult["ParameterTable"]

i get the following error messages (and no error estimates):

General::stop: Further output of NIntegrate::nlim will be suppressed
during this calculation. >>

Function::slotn: Slot number 2 in
FittedModels`NonlinearFitDump`cnf[{T0,a,pc,s,skew},<<1>>,{},Sequence@@{WorkingPrecision->MachinePrecision}]/.FittedModels`NonlinearFitDump`cnf-><<36>>&
cannot be filled from (<<1>>)[##1]. >>

Function::slotn: Slot number 2 in
FittedModels`NonlinearFitDump`cnf[{T0,a,pc,s,skew},<<1>>,{},Sequence@@{WorkingPrecision->MachinePrecision}]/.FittedModels`NonlinearFitDump`cnf-><<36>>&
cannot be filled from (<<1>>)[##1]. >>

Power::infy: Infinite expression 1/0. encountered. >>

Power::infy: Infinite expression 1/0. encountered. >>

Power::infy: Infinite expression 1/0. encountered. >>

General::stop: Further output of Power::infy will be suppressed during
this calculation. >>

\[Infinity]::indet: Indeterminate expression 0. ComplexInfinity
encountered. >>

\[Infinity]::indet: Indeterminate expression 0. ComplexInfinity
encountered. >>

\[Infinity]::indet: Indeterminate expression 0. ComplexInfinity
encountered. >>

General::stop: Further output of \[Infinity]::indet will be suppressed
during this calculation. >>


does anybody have any idea how to fix this? if i do a fit with
CDF[NormalDistribution...] it works well. with my "self made" CDF f[] it
doesn't... i am stuck here. thanks in advance

tom

Ray Koopman

unread,
Sep 3, 2010, 6:06:52 AM9/3/10
to
On Sep 1, 3:27 am, Tom Pether <peth...@googlemail.com> wrote:
> Hi,
>
> to am trying to fit the integral of the skew normal distribution to a
> set of data. xhis is my fit function:

Why are you doing least-squares fitting to the cdf? Why not get
initial estimates by fitting the first three moments of the data,
and then use maximum likelihood to get better estimates?

0 new messages