Message-ID: <CAB8pepzStXGHLzb_oth6W=WOD+LE6kpSou0MpqfER3zvuGVy5A@mail.gmail.com>
Date: 2020-10-22T06:18:00Z
From: Abby Spurdle
Subject: Fitting Mixed Distributions in the fitdistrplus package
In-Reply-To: <CAAJc=rOu8TCTt-0nDq18gct84y4hy9if3yU2-WJT4bNaENuPEw@mail.gmail.com>
dmixgampar <- function (x, param1, param2, ...)
{
#compute density at x
<your code>
}
On Wed, Oct 21, 2020 at 8:03 PM Charles Thuo <tcmuigai at gmail.com> wrote:
>
> Dear Sirs,
>
> The below listed code fits a gamma and a pareto distribution to a data set
> danishuni. However the distributions are not appropriate to fit both tails
> of the data set hence a mixed distribution is required which has ben
> defined as "mixgampar"
> as shown below.
>
> library(fitdistrplus)
> x<- danishuni$Loss
> fgam<- fitdist(x,"gamma",lower=0)
> fpar<- fitdist(x,"pareto",start = list(shape=2,scale=2),lower=0)
> fmixgampar<- fitdist(x,"mixgampar",start =
> list(prob=1/2,nu=1,lambda=1,alpha=1,theta=1),lower=0)
> Error in fitdist(x, "mixgampar", start = list(prob = 1/2, nu = 1, lambda =
> 1, :
>
> The dmixgampar function must be defined
>
> Kindly assist to define the dmixgampar
>
> Charkes
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.