Message Boards Message Boards

0
|
3751 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Estimating parameters of a stable distribution

Posted 2 years ago

Hi! I tried to estimated a stable distribution from the dataset hereunder.

don = {-0.03394489884326527`, -0.03394489884326527`, \
-0.03394489884326527`, 0.017575499123739236`, -0.02922087436589889`, 
  0.010555301952384558`, -0.0004591035505102574`, \
-0.010672854855081883`, -0.010672854855081883`, \
-0.010672854855081883`, -0.08128446482267304`, 
  0.0032508155059952823`, -0.02538460889511576`, \
-0.024967155569905922`, -0.03200434753397141`, -0.03200434753397141`, \
-0.03200434753397141`, 0.06752654532202125`, -0.05355714737031551`, 
  0.023927179959644322`, -0.01692677371352175`, 0.004213861657695463`,
   0.004213861657695463`, 0.004213861657695463`, 0.06477832885486146`,
   0.047395621108916`, -0.013796405278464848`, 
  0.017297775562395895`, -0.0156695124441822`, -0.0156695124441822`, \
-0.0156695124441822`, 0.015427766859393002`, -0.07003501198980705`, 
  0.022493946849797`, -0.010375566995092983`, 0.018904524972064116`, 
  0.018904524972064116`, 0.018904524972064116`, 0.010076845370000675`,
   0.007618949872832066`, -0.016456882934399578`, 
  0.007208123141758686`, 0.011401391548995866`, 0.011401391548995866`,
   0.011401391548995866`, -0.0253288097675204`, \
-0.058520237459744974`, -0.02375294625331719`, 0.017375496159210194`, 
  0.034068174572563635`, 0.034068174572563635`, 0.034068174572563635`,
   0.027290444945758614`, 
  0.04156935324646256`, -0.003750649699042637`, 
  0.037454954921030306`, -0.09162567061098696`, \
-0.09162567061098696`, -0.09162567061098696`, 0.10097428521409842`, 
  0.06268162221233843`, -0.010062863532103786`, \
-0.011450360453901243`, 0.023602452463382263`, 0.023602452463382263`, 
  0.023602452463382263`, 0.051080593533900966`, 0.013565832731434217`,
   0.0023202018721298267`, -0.02578344291194117`, \
-0.003982473432848802`, -0.003982473432848802`, \
-0.003982473432848802`, 0.021815347172571033`, 
  0.05031452199325336`, -0.006703957641941638`, \
-0.012443436269867542`, 0.0018818646288593615`, 
  0.0018818646288593615`, 
  0.0018818646288593615`, -0.029845016829764696`, 
  0.04160475193396266`, -0.005227759187617618`, 0.005939136002577116`,
   0.008100174424780083`, 0.008100174424780083`, 
  0.008100174424780083`, -0.011169013468163798`, \
-0.008258286074726324`, 
  0.012235814625092312`, -0.0219780557330319`, \
-0.018525610718695348`, -0.018525610718695348`, \
-0.018525610718695348`, 0.010313197133002959`, 
  0.01652889231101857`, -0.006807824169006668`, -0.00916036980725222`,
   0.005692639452927531`, 0.005692639452927531`, 
  0.005692639452927531`, -0.05865805690492846`, 0.030007756501598502`,
   0.047866401371804805`, 0.009191211435466534`, 
  0.009191211435466534`, 0.009191211435466534`, 0.009191211435466534`,
   0.012704204855465558`, -0.004374802694069071`, 
  0.006159405798702674`, 0.010398007713170057`, 0.010398007713170057`,
   0.010398007713170057`, 
  0.010398007713170057`, -0.005407391955942583`, \
-0.01425961090609437`, 0.05396061417482968`, 
  0.0075523767867888125`, -0.004829312771382072`, \
-0.004829312771382072`, -0.004829312771382072`, \
-0.011867336746311232`, 0.036002650842475184`, 
  0.03631654440886033`, -0.0032531650183932883`, 0.02381710046507902`,
   0.02381710046507902`, 0.02381710046507902`, 
  0.013162035573157968`, -0.007896429640234936`, 
  0.001261888587978409`, -0.004754391454896683`, \
-0.0015872621812589682`, -0.0015872621812589682`, \
-0.0015872621812589682`, -0.023724470246995304`, 
  0.038136912638033475`, -0.022044653284554773`, 
  0.009806991072314142`, -0.012167821949641078`, \
-0.012167821949641078`, -0.012167821949641078`, 0.029822985875977166`,
   0.022471874318293367`, 0.012297578413894355`, 
  0.013317501793784084`, 0.023974565929419284`, 0.023974565929419284`,
   0.023974565929419284`, 0.06432436525081472`, 0.`, 
  0.07081869836272542`, 0.0012540446542990394`, 
  0.0032500028610229492`, 0.0032500028610229492`, 
  0.0032500028610229492`, -0.0012515931374596837`, 
  0.0012500286102294922`, 
  0.01234572552595136`, -0.007212206652050459`, 0.009361938080480808`,
   0.009361938080480808`, 0.009361938080480808`, 
  0.00024628757015877857`, -0.006445221468641928`, 
  0.0032122588743909337`, 
  0.0004939133482378811`, -0.0032210139170059915`, \
-0.0032210139170059915`, -0.0032210139170059915`, 
  0.003702874076738646`, 0.0068643976356639125`, 
  0.014734268663654605`, -0.01272016831139334`, 
  0.0014655696538679252`, 0.0014655696538679252`, 
  0.0014655696538679252`, 
  0.0067929047282415875`, -0.0046307708131043636`, 
  0.0017031555365026954`, -0.0029282781303375826`, 
  0.0009751795927657461`, 0.0009751795927657461`, 
  0.0009751795927657461`, -0.010344900079711672`, \
-0.002469074462651643`, 
  0.0046693481580596325`, -0.000245803235037827`, \
-0.004940706922891259`, -0.004940706922891259`, \
-0.004940706922891259`, 
  0.00024695667411894057`, -0.0012363099455563766`, \
-0.0009901452866180843`, 
  0.0004947687115533803`, -0.0014866308960014083`, \
-0.0014866308960014083`, -0.0014866308960014083`, \
-0.0034808402625094177`, 0.007403802929277001`, 
  0.007349273541704096`, -0.00024502022965067265`, \
-0.00024502022965067265`, -0.00024502022965067265`, \
-0.00024502022965067265`, -0.00024502022965067265`, \
-0.008899820581918147`, 
  0.0004941574191833465`, -0.004218292963291941`, 
  0.0004959957860462927`, 0.0004959957860462927`, 
  0.0004959957860462927`, 0.0014858944534322119`, 0.`, 
  0.007618496501533813`, -0.004443260558482116`, 
  0.0022167055790065743`, 0.0022167055790065743`, 
  0.0022167055790065743`, 
  0.0019665430969144602`, -0.00394861644264421`, 
  0.0004933041663618312`, -0.00024671293544038965`, 0.`, 0.`, 0.`, 
  0.003442325858585361`, 0.002941918101143018`, 
  0.002201522729608241`, -0.003190187006766056`, \
-0.00270661397991699`, -0.00270661397991699`, -0.00270661397991699`, 
  0.000983212940151308`, -0.002217251660530477`, 
  0.004415041761553593`, -0.0027054000107892325`, \
-0.00024598462648870844`, -0.00024598462648870844`, \
-0.00024598462648870844`, 0.00877829222293795`, 0.009420298451695876`,
   0.0024096936510914803`, -0.0031423764032808975`, \
-0.01696171260034035`, -0.01696171260034035`, -0.01696171260034035`, 
  0.0024522385270853556`, 0.000735060688952018`, 
  0.00024496020944389947`, 0.00024501697600935783`, 
  0.0009786420816095091`, 0.0009786420816095091`, 
  0.0009786420816095091`, -0.001715678826793574`, \
-0.0009812830896425734`, -0.0029527764617041344`, \
-0.0009852677282126817`, -0.0004928178901589532`, \
-0.0004928178901589532`, -0.0004928178901589532`, \
-0.0004930608793812498`, 
  0.`, -0.00970874593139338`, -0.00970874593139338`, \
-0.0032467559533485603`, -0.0032467559533485603`, \
-0.0032467559533485603`, -0.001000046730041504`, 0.`, 0.`, 0.`, 0.`, 
  0.`, 0.`, 0.0004997139215246588`, -0.0004999637603759766`, 0.`, 0.`,
   0.0007493836435673616`, 0.0007493836435673616`, 
  0.0007493836435673616`, 0.`, -0.0004998388097305292`, 0.`, 0.`, 
  0.0004995890957115743`, 0.0004995890957115743`, 
  0.0004995890957115743`, -0.0007499456405639648`, 
  0.0002499194048652646`, -0.0002499818801879883`, 
  0.0029910477747560134`, -0.0027493518125115825`, \
-0.0027493518125115825`, -0.0027493518125115825`, 
  0.`, -0.0002499818801879883`, 0.`, 0.`, 0.0002499194048652646`, 
  0.0002499194048652646`, 0.0002499194048652646`, 0.`, 0.`, 0.`, 0.`, 
  0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 
  0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 
  0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 
  0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 
  0.`, 0.`, 0.`}

It seems impossible toe estimate the corresponding parameter : endless computation.

In[459]:= EstimatedDistribution[don, 
 StableDistribution[\[Alpha], \[Beta], \[Mu], \[Sigma]]]

Out[459]= $Aborted

Probably because an excess of zeroes? Deleting zeroes, it works more or less...

In[460]:= EstimatedDistribution[Select[don, # =!= 0. &], 
 StableDistribution[\[Alpha], \[Beta], \[Mu], \[Sigma]]]

During evaluation of In[460]:= FindMaximum::cvmit: Failed to converge to the requested accuracy or precision within 100 iterations.

Out[460]= StableDistribution[1, 1.01354, 0.128295, 0.0363144, \
0.00597755]

What should I do to process the whole dataset?

Thanks in advance, Claude

POSTED BY: Claude Mante
4 Replies
Posted 2 years ago

We might be talking about the same thing but using different terms. I wouldn't call what I did a "mixture model" but rather allowed for two kinds of data: censored data (i.e., the zeros) and (approximately) exact data.

POSTED BY: Jim Baldwin

Thanks Jim!

I didn't though to use a mixture model. Pretty long, but it works:

S = StableDistribution[\[Alpha], \[Beta], \[Mu], \[Sigma]] /. mle[[2]];
Print@Show[{Histogram[don, "FreedmanDiaconis", "PDF", 
     PlotRange -> All], 
    Plot[PDF[S][x], {x, Min@don, Max@don}, PlotStyle -> Cyan, 
     PlotRange -> All]}, Frame -> True, ImageSize -> Large];
POSTED BY: Claude Mante
Posted 2 years ago

Looking at the data there are no values (other than zero) between -0.00024496020944389947 and 0.00024496020944389947. If that is where all of the zero values originate, then one can construct the log of the likelihood and find the maximum likelihood estimates:

(* Number of zeros *)
n0 = Length[Select[don, # == 0 &]];

(* Non-zero data *)
d = Select[don, # != 0 &];

(* Log of the likelihood *)
logL = LogLikelihood[StableDistribution[\[Alpha], \[Beta], \[Mu], \[Sigma]], d] +
   n0 Log[CDF[StableDistribution[\[Alpha], \[Beta], \[Mu], \[Sigma]], 0.00024496020944389947`] - 
      CDF[StableDistribution[\[Alpha], \[Beta], \[Mu], \[Sigma]], -0.00024496020944389947`]];

(* Maximum likelihood estimates *)
mle = FindMaximum[{logL, 0 < \[Alpha] <= 2, -1 < \[Beta] <= 1, \[Sigma] > 0}, 
{{\[Alpha], 0.5}, {\[Beta], 0}, {\[Mu], -0.0007}, {\[Sigma], 0.0015}}]
(* {545.915, {\[Alpha] -> 0.520568, \[Beta] -> 0.0755309, \[Mu] -> -0.0000591986, \[Sigma] -> 0.00142462}} *)

One really needs estimates of precision but a bootstrap would take forever in this case and the usual approach of taking the second derivatives of the log of the likelihood doesn't appear promising. So I don't have an answer to that (yet).

POSTED BY: Jim Baldwin
Posted 2 years ago

Given the high precision of the non-zeros (both positive and negative), why do you have any zeros? Is there some domain near zero for which values in that domain are given the value zero?

I ask because the answer to "why are there zeros?" will dictate how to perform the estimation of the parameters. It concerns how the values were obtained in addition to what the values are.

In addition your data looks very "discrete" which the Stable distribution is not which calls into question the apparent high precision of the measurements. Are the numbers really integer counts divided by some real-valued constants? That's important, too, for determining how to estimate the parameters of a stable distribution (or even if one should do so in the first place).

POSTED BY: Jim Baldwin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract