简体   繁体   English

寻找移位指数分布的起始值的问题

[英]Problem in finding starting values for shifted exponential distribution

I am trying to fit shifted exponential distribution to my data but fitdist function giving error of 100 and failing to estimate starting values.我试图将偏移指数分布拟合到我的数据中,但 fitdist 函数给出的误差为 100 并且无法估计起始值。 I also used plotdist function to find starting or initial values in order to fit the distribution and I have obtained the followings plots with parameters rate = 0.155 shift = 0.00001 after iteration process and even I used these values in fitdist as well.我还使用 plotdist 函数来查找起始值或初始值以拟合分布,并且在迭代过程后我获得了以下参数 rate = 0.155 shift = 0.00001 的图,甚至我在 fitdist 中也使用了这些值。 在此处输入图片说明 I used mledist function to calculate starting values of distribution parameters as well but it is also not working.我也使用 mledist 函数来计算分布参数的起始值,但它也不起作用。 I used fitdist function as well it gives the following error:我也使用了 fitdist 函数,它给出了以下错误:

Error in fitdist(x, "sexp", start = list(rate = 0.155, shift = 1e-05)) : the function mle failed to estimate the parameters, with the error code 100 fitdist(x, "sexp", start = list(rate = 0.155, shift = 1e-05)) 中的错误:函数 mle 未能估计参数,错误代码为 100

The code is as below:代码如下:

library(fitdistrplus)
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")

x <- pvr$headway
rate <- 0.155
shift <- 0.00001
dsexp <- function(x, rate, shift)
  dexp(x-shift, rate=rate)
psexp <- function(x, rate, shift)
  pexp(x-shift, rate=rate)
qsexp <- function(x, rate, shift)
  qexp(x-shift, rate=rate)

f12 <- fitdist(x, "sexp", start = list(rate=0.155, shift=0.00001), lower = c(0, -min(x)))

The data may be downloaded from the following link below:数据可从以下链接下载:

https://ptagovsa-my.sharepoint.com/:x:/g/personal/kkhan_tga_gov_sa/EfzCE5h0jexCkVw0Ak2S2_MBWf3WUywMd1izw41r0EsLeQ?e=EiqWDc https://ptagovsa-my.sharepoint.com/:x:/g/personal/kkhan_tga_gov_sa/EfzCE5h0jexCkVw0Ak2S2_MBWf3WUywMd1izw41r0EsLeQ?e=EiqWDc

Can anyone help me in this regard?任何人都可以在这方面帮助我吗?

The fitdist function uses mle method as default. fitdist 函数默认使用 mle 方法。 The code works just by changing the method from mle to mse or mge.该代码只需将方法从 mle 更改为 mse 或 mge。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM