Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parameter estimates for tidy_burr() #333

Closed
spsanderson opened this issue Jan 11, 2023 · 0 comments
Closed

parameter estimates for tidy_burr() #333

spsanderson opened this issue Jan 11, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@spsanderson
Copy link
Owner

library(TidyDensity)

data <- tidy_burr(.shape1 = 1, .shape2 = 2, .rate = 3)$y

blik <- function(theta,x){
  c <- exp(theta[1])
  k <- exp(theta[2])
  mu <- 0
  sigma <- exp(theta[3])
  bll <- actuar::dburr(x, c, k, mu, sigma)
  return(-sum(log(bll)))  
}

brmod <- optim(c(.shape1 = 0, 
                 .shape2 = 0, 
                 .scale = 0), 
               fn = blik,
               x = data)
> exp(brmod$par)
  .shape1   .shape2    .scale 
1.0130505 2.0605886 0.2967962 
@spsanderson spsanderson added the enhancement New feature or request label Jan 11, 2023
@spsanderson spsanderson self-assigned this Jan 11, 2023
@spsanderson spsanderson added this to the TidyDensity 1.2.5 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant