jmsigner / amt

37 stars 13 forks source link

TA for random steps when observed is NA #63

Open bsmity13 opened 2 years ago

bsmity13 commented 2 years ago

Step 1 has no turn angle because there is no previous step (ta_ = NA). However, the random steps paired with step 1 do have a turn angle. Demonstration:

deer %>% 
  steps_by_burst() %>% 
  random_steps(n_control = 3) %>% 
  print(n = 9, width = 100)

Problem would arise for first step of any burst. Problem might be that direction_p should be NA? Isn't that direction of the previous step?

jmsigner commented 2 years ago

Yes that's true, I did note this a few weeks ago. When fitting an iSSF with fit_issf() this is not a problem because survival::clogit() removes these strata. I did add a function remove_incomplete_strata() to deal with such cases.

If direction_p was NA, then we would lose these steps and in cases we are only interested in sl_ it doesn't matter. What do you think?