Closed danielmork closed 1 week ago
On additional investigation, there may also be issues with the monotone tdlnm function. Changing model$class="monotone" did not resolve the issue. Please use branch 'hotfix_tdlnm_se_monotone' to explore problem and find solution
I am updating the monotone tdlnm cpp function for ctr->Y0 and ctr->Ystar as they replaced ctr->Y.
monotone tdlnm runs but still running into 'Error: std::bad_alloc' and 'segfault error'
It may be similar to the TDLNM issue we were having—that there is an input missing or incorrect passed from the dlmtree() function. Perhaps check back on these?
From: Seongwon Im @.> Date: Wednesday, May 15, 2024 at 11:34 To: danielmork/dlmtree @.> Cc: Daniel Mork @.>, Author @.> Subject: Re: [danielmork/dlmtree] monotone functionality (Issue #13)
monotone tdlnm runs but still running into 'Error: std::bad_alloc' and 'segfault error'
— Reply to this email directly, view it on GitHubhttps://github.com/danielmork/dlmtree/issues/13#issuecomment-2112873112, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AH7UA765FHFTQ6CQZFB2PADZCN6ANAVCNFSM6AAAAABHWWTNY6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJSHA3TGMJRGI. You are receiving this because you authored the thread.Message ID: @.***>
Updated monotone-TDLNM model. The ZINB flag was dropped while merging, causing the segfault error. Also updated model$shape to only be available for a single exposure case to avoid a warning from 'mean(tdlnm.exposure.se)' when tdlnm.exposure.se = NULL.
There is no place in dlmtree() that sets model$class = 'monotone', which is needed to call monotdlnm_cpp().
Lines 551 and 567 set model$class = 'monotone' when model$monotone is TRUE.
Got it! I was looking in the wrong branch. Thanks
Specifying dlm.type = "monotone" and shrinkage in dlmtree.R results in incorrect estimates. The original code set shrinkage to FALSE by default when monotone model is specified.
Also note that the scaling and centering of the fixed effect matrix (model$Z) of the original code of tdlnm.R are different to dlmtree.R so the estimates will be slightly different.
Setting dlm.type to 'monotone' does not result in a monotone ERC. I think this setting results in calling TDLNM, not Monotone TDLNM.