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

Again: Flexsurvspline: initial value in 'vmmin' is not finite #199

Open
Lee-xli opened this issue Nov 9, 2024 · 4 comments
Open

Again: Flexsurvspline: initial value in 'vmmin' is not finite #199

Lee-xli opened this issue Nov 9, 2024 · 4 comments

Comments

@Lee-xli
Copy link

Lee-xli commented Nov 9, 2024

Hi flexsurv,

Firstly, my apologies that this appears to be an old question, and I do not have a reprex example or a sharable dataset due to data-sharing agreements. The dataset has only four variables: treatment arm, linear predictor, status, and time. Total of 502 observations with 201 events.

The flexsurvspline command was:

Screenshot 2024-11-10 at 7 14 25 am

And I encountered the following error:

zero inits from xgb

I have reviewed past discussions and tried the following:

  • Investigated the time variable: no obvious outliers or implausible values were found.
  • Tried different knot positions.
  • Tried k value incrementally from 0 upwards. At k = 0 (Weibull model), the same error was encountered.

Unfortunately, all the above efforts failed.

What baffles me is that the error appears to be resolved by replacing the linear predictor variable with a different set of estimates (e.g., linear predictors from a different model). With this alternative linear predictor variable, the flexsurvspline function derived the same knot positions as before, but all gamma parameters now had non-zero initial values. How could this issue seemingly be resolved while the underlying survival information remained unchanged?

Could you please suggest areas where I might further investigate this issue?

Please let me know if my question requires any clarification.

Thank you very much in advance.

@chjackson
Copy link
Owner

So you can successfully fit a model for the same outcome but with a different predictor? That is not surprising - the heuristics used to generate initial values depend jointly on the outcome and the predictors.

If these heuristics fail, you can specify initial values explicitly through the inits argument to flexsurvspline. For example, you could try the estimates of gamma (and/or the estimated covariate effects) from the successful fit as initial values for the model that didn't work.

@Lee-xli
Copy link
Author

Lee-xli commented Nov 10, 2024

Thank you very much! Having inits from the successful fit indeed fixed the issue.
If I weren't so lucky to have a successful fit to guide me on the values (I tried randomly assigning initial values, but none worked), what other approaches would you recommend?

@chjackson
Copy link
Owner

For the effects of covariates in a proportional hazards model, you could just fit a standard Cox model. For the gamma parameters I don't know of any other approach other than the one the package uses already. I'll leave this issue open in case any readers have any better ideas.

@Lee-xli
Copy link
Author

Lee-xli commented Nov 10, 2024

Thank you very much again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants