deltas = 10^c(-1:-12)
df = data.frame(deltas)
df <- mutate(df, Num_H11 = -(
Gamma_log_like(optout_gamma$par - c(df$deltas, 0), X)
- 2 * Gamma_log_like(optout_gamma$par, X)
+ Gamma_log_like(optout_gamma$par + c(df$deltas, 0), X)) / (df$deltas^2)
)
In the above code, if I replace df$deltas
with a single delta value it all calculates correctly, but when i use a reference to a data frame column, the results are incorrect and I get the following warning:
longer object length is not a multiple of shorter object lengthlonger object length is not a multiple of shorter object length