MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

simple question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105202] simple question
  • From: Francisco Gutierrez <fgutiers2002 at yahoo.com>
  • Date: Tue, 24 Nov 2009 05:48:51 -0500 (EST)

Dear List:
I have the following list:
ejemplo1={{1,0,2,2,0},{0,1,1,1,2},{2,0,0,1,1},{1,1,0,2,2},{1,0,2,0,1},{2,2,0,1,1},{2,1,1,1,2},{0,1,1,0,1}};
I want to group it, so that the sublists of ejemplo1 that have identical values at positions 4 and 5 are gathered together. So I did the following code:
Split[ Sort[ejemplo1,#1[[4]]>=#2[[4]] && #1[[5]]>=#2[[5]] &],Take[#1,{4,5}]==Take[#2,{4,5}]&]
 
Works! The output in effect is:
{{{1,1,0,2,2}},{{0,1,1,1,2},{2,1,1,1,2}},{{2,0,0,1,1},{2,2,0,1,1}},{{1,0,2,0,1},{0,1,1,0,1}},{{1,0,2,2,0}}},
precisely what I wanted.
 
Now, how can I create a function for the general case (instead of fixed positions 4 and 5, an arbitrary number of positions that act as "gathering parameter")?
Fg

--- On Mon, 11/23/09, Petri T=F6tterman <petri.totterman at hanken.fi> wrote:


From: Petri T=F6tterman <petri.totterman at hanken.fi>
Subject: [mg105202] [mg105180] ML estimators for Box-Cox Extreme Value distribution
To: mathgroup at smc.vnet.net
Date: Monday, November 23, 2009, 6:53 AM


Dear all,

I have a set of data, and I want to fit a distribution on this data. I
am particularily interested in the Box-Cox General Extreme Value
distribution, for which I have the CDF and PDF:
---
BoxCoxGEVDistribution /:

   CDF[BoxCoxGEVDistribution[\[Mu]_, \[Sigma]_, \[Xi]_, \[Phi]_], x_]:=
    1 + (((Exp[-(1 + \[Xi] ( (x - \
\[Mu])/\[Sigma]))^(-1/\[Xi])])^\[Phi]) - 1)/\[Phi];

BoxCoxGEVDistribution /:

   PDF[BoxCoxGEVDistribution[\[Mu]_, \[Sigma]_, \[Xi]_, \[Phi]_], x_]=
    D[CDF[BoxCoxGEVDistribution[\[Mu], \[Sigma], \[Xi], \[Phi]], x],
    x];
---

I do also have a Log likelihood function from (Bali, 2007):

---
LLdBoxCoxGEV[\[Mu]_, \[Sigma]_, \[Xi]_, \[Phi]_, M_] :=
   Module[{k = Length[M]}, -k Log[\[Sigma]] -
     k ((1 + \[Xi])/\[Xi]) Sum[
       Log[1 + \[Xi] ((M[[i]] - \[Mu])/\[Sigma])], {i, 1, k}] -
     k \[Phi] Sum[(1 + \[Xi] ((M[[i]] - \[Mu])/\[Sigma]))^(-(
        1/\[Xi])), {i, 1, k}] ];
---

Obviously, \[Mu]_, \[Sigma]_, \[Xi]_, \[Phi]_ are parameters which I
need to estimate, and M is a list of values from the dataset,
exceeding a predefined limit.

I would be grateful for advice, how should I continue to find the
Maximum Likelihood estimators for this distribution, using Mathematica?

Best regards,
/petri


  • Prev by Date: Re: Is it possible to make NIntegrate faster?
  • Next by Date: Re: More Efficient Method
  • Previous by thread: Re: Solving systems of differential equations
  • Next by thread: Re: simple question