2
I have fitted many distributions to my data but I am facing difficulty in fitting Pearson type III distribution to the data. I also used plotdist function to find starting or initial values in order to fit the distribution using iterative method. The plots obtained from plotdist shows that the plot is a good fit to data at the given starting values of shape = 0.8, location = 0.4 and scale = 7.5.
But fitdist function does not work and give error. I also studied the problems and answers available on stack overflow regarding fitting of log Pearson Type III distribution and applied the code but then again I am facing problem in running fitdist function and getting error again. If fitdist function does not work then i can not calculate the values of AIC and BIC using gofstat function. AIC & BIC values are required to estimate best fit among different distributions.The data may be downloaded from the following link.
Blockquote
library(fitdistrplus)
library(PearsonDS)
library(readxl)
library(tidyverse)
library(here)
library(janitor)
# Load data-------------------------------
pvr <- read_excel(here("data", "pvr.xlsx"))
pvr <- pvr %>%
select(-starts_with("...")) %>%
clean_names(case = "snake")
# Fitting--------
fitnorm <- fitdist(pvr$headway,"norm")
fitgamma <- fitdist(pvr$headway, "gamma", lower = c(0, 0), start = list(rate = 0.05, shape = 1))
fitPIII <- fitdist(pvr$headway, "pearsonIII", lower = c(0, 0, 0), start=list(shape=0.8, location=0.4, scale=7.5))
The following error appears for pearsonIII distribution
Error in checkparamlist(arg_startfix$start.arg, arg_startfix$fix.arg, :
Some parameter names have no starting/fixed value: params.