You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to raise a concern regarding the fitted values (and subsequent residuals) calculated by demography::lca. If chooseperiod is set to TRUE in the original function call then the fitted values of the output will always be in terms of log death rates - regardless of the restype (response type) parameter specified.
A snippet from the relevant R code below illustrates the issue. If chooseperiod is set to TRUE then the function uses the specified break method to identify the appropriate fitting period - it returns a LCA model of the corresponding period but with chooseperiod set to FALSE. Under both break methods, the response type parameter is not inherited from the original function call and will therefore assume its default value - log death rates. This creates an inconsistency in the nature of the fitted values (and residuals) returned versus those specified in the model. This is particularly problematic if users of this package want to compare in-sample values between various models - not in terms of log death rates.
Fortunately, this issue only affects in-sample values. All of the forecasting and comparison functions within the package will be based on out-sample data and ignore the in-sample residuals. Furthermore, the solution would appear to be as simple as adding the response type parameter to the models returned - so that it is inherited from the original function call.
This is the first instance of this issue that I encountered and hopefully the last. However, I would recommend revising the parameter specification of all recursive functions so that they are consistent with the original function call.
I hope I explained my concern well enough. Please let me know if I can provide any additional information to clarify my concern.
Regards
The text was updated successfully, but these errors were encountered:
Hi Prof. Hyndman
I want to raise a concern regarding the fitted values (and subsequent residuals) calculated by
demography::lca
. Ifchooseperiod
is set to TRUE in the original function call then the fitted values of the output will always be in terms of log death rates - regardless of therestype
(response type) parameter specified.A snippet from the relevant R code below illustrates the issue. If
chooseperiod
is set to TRUE then the function uses the specified break method to identify the appropriate fitting period - it returns a LCA model of the corresponding period but withchooseperiod
set to FALSE. Under both break methods, the response type parameter is not inherited from the original function call and will therefore assume its default value - log death rates. This creates an inconsistency in the nature of the fitted values (and residuals) returned versus those specified in the model. This is particularly problematic if users of this package want to compare in-sample values between various models - not in terms of log death rates.Fortunately, this issue only affects in-sample values. All of the forecasting and comparison functions within the package will be based on out-sample data and ignore the in-sample residuals. Furthermore, the solution would appear to be as simple as adding the response type parameter to the models returned - so that it is inherited from the original function call.
This is the first instance of this issue that I encountered and hopefully the last. However, I would recommend revising the parameter specification of all recursive functions so that they are consistent with the original function call.
I hope I explained my concern well enough. Please let me know if I can provide any additional information to clarify my concern.
Regards
The text was updated successfully, but these errors were encountered: