Questions tagged [tweedie]

A family of probability distributions, which is a special case of exponential dispersion models.

41 questions
2
votes
1 answer

R codes for Tweedie Compound Poisson Gamma

I found the following R codes to fit a Tweedie Compound Poisson Gamma distribution. I have to fit it to my 399 claim amounts. I have seen the following R codes ptweedie.series(q, power, mu, phi) and dtweedie.series(y, power, mu, phi). However I fail…
user3309969
  • 55
  • 2
  • 6
1
vote
1 answer

Can glmmLasso be used with the Tweedie distribution?

I have a linear mixed effects model and I am trying to do variable selection. The model is testing the level of forest degradation in 1000 sampled points. Most points have no degradation, and so the dependent variable is highly skewed with many…
1
vote
0 answers

How to properly define GLM with Tweedie family in PySpark?

I'm trying to adapt the simple GLM example from the docs to use Tweedie: def create_fake_losses_data(self): df = self._spark.createDataFrame([ ("a", 100.0, 12, 1, Vectors.dense(0.0, 0.0)), ("b", 0.0, 24, 1, Vectors.dense(1.0,…
Evan Zamir
  • 8,059
  • 14
  • 56
  • 83
1
vote
1 answer

Is there a way to do a Regression in Catboost for a Gamma distributed response variable?

I'm working on an Insurance model and I'd like to run Severity and Frequency models using the Catboost gradient boosting algorithm. The problem is that according to the literature, a Severity model assumes a Gamma distributed response variable,…
1
vote
1 answer

Tweedie deviance loss function in lightGBM

I am using the Tweedie objective function with lightGBM and have some questions: What is the loss function that lightGBM uses for Tweedie? How does it deal with predictions that are 0 in value as the mean_tweedie_deviance in sklearn asserts…
Nik Berry
  • 11
  • 1
1
vote
1 answer

Creating R Squared function for CPLM package

For my graduate research I'm using the CPLM package (specifically the cpglmm function) to account for zero-inflated data (Tweedie compound Poisson distribution) in a data set looking at the effects of logging on breeding bird densities. This isn't a…
mwbarnes
  • 11
  • 5
1
vote
0 answers

General estimating equation with Tweedie distribution in R

Does anyone know if one can use a Tweedie distribution in a general estimating equation model in R? I tried using the following data: structure(list(focal = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,…
Erica
  • 125
  • 1
  • 2
  • 9
1
vote
0 answers

tweedie.profile in R

I am trying to estimate the value of the Tweedie p-index parameter using the tweedie.profile function in the tweedie package in R. An example of the function being used is given below model.out <- tweedie.profile( formula = y1~ x1+ x2+ x3+ x4-1, …
Zachary Luety
  • 19
  • 1
  • 8
0
votes
0 answers

How to view all outputs of a GLM?

I am using a Tweedie GLM to analyse the effect of sex and location on site fidelity for a mark-recapture study. The data is heavily zero inflated as a lot of the animals were not recaptured, therefore I believe that Tweedie is the best fit. Tweedie…
0
votes
0 answers

How do you calculate p-values for a scikit-learn model with a Tweedie Regressor?

I am using sci-kit learn to estimate the p-values of my GLM with a Tweedie link function. First, I estimate the p-values with statsmodels to see the values I should be matching to. Here is the result from statsmodels: Statsmodel Tweedie GLM…
Sue
  • 1
0
votes
1 answer

R markdown does not find a function

When I run a script in R, there is no error, and everything works. library(tweedie) data_tweedie <- glm(y ~ ., data = data, family = tweedie(var.power = data_tw$p.max, link.power = 0)) But when I knit the R markdown with the same r section,…
Yulia Kentieva
  • 641
  • 4
  • 13
0
votes
1 answer

How to set the dispersion parameter equal to one (phi=1) in Tweedie GLM using R Package

I want to fit a Tweedie GlM to a response variable but with a dispersion parameter (phi) set to 1 for all the records in my data. So all the parameters get estimated using Maximum Likelihood Estimator except for phi. Thank you.
Sara
  • 3
  • 2
0
votes
1 answer

How do you code a Tweedie distribution in JAGS/BUGS?

I'd like to run a model on a Tweedie distributed variable using JAGS through R. I know that JAGS doesn't have a Tweedie distribution as standard, but that it is possible to specify one as a compound Gamma/Poisson. Unfortunately I can't figure out…
kernowsam
  • 13
  • 2
0
votes
0 answers

R How to evaluate a single input variable coefficient in a glm

I have a R glm object and I want to evaluate the coefficient associate to a single input variable of a new data frame. Here is an example: library(statmod) data = tibble(X = c('a', 'b', 'c', 'd', 'e'), Z = c('a', 'c', 'c', 'c', 'a'), W = c(21:25),…
John E.
  • 137
  • 2
  • 10
0
votes
1 answer

How does tweedie nloglike in XGBoost relate to the actual nloglike?

When viewing the code for how XGBoost calculates the tweedie evaluation metric (tweedie-nloglik) we can see that it is calculated as: bst_float a = y * std::exp((1 - rho_) * std::log(p)) / (1 - rho_); bst_float b = std::exp((2 - rho_) * std::log(p))…
Harald123
  • 13
  • 3