Skip to content

Fatal error with FeNmlm function #17

@marissachilds

Description

@marissachilds

Thanks for a really useful package.

One error I've encountered is FeNmlm crashing R with a fatal error. I can reproduce this behavior with the example below. Thanks in advance for any help.

library(dplyr)
library(magrittr)
library(fixest)

n_id = 800
n_year = 8
b_true = 1
a_true = 0.5
set.seed(1001)
test_df = data.frame(id = rep(1:n_id, n_year),
year = rep(1:n_year, each = n_id)) %>%
group_by(id) %>%
mutate(mu = rnorm(1, 0, 1)**2) %>% # generate id fixed effect
ungroup %>%
mutate(X = rnorm(n_yearn_id, 0, 1)**2, # random X
Z = rnorm(n_year
n_id, 0, 1)**2, # random Z
Y = rpois(n_yearn_id, mu(1 + b_true*X)^a_true)*Z) # outcome Y

feNmlm(Y ~ log(Z) + log(1 + X) | id,
data = test_df,
verbose = 1) # works perfectly

feNmlm(Y ~ log(Z) | id,
data = test_df,
NL.fml = ~ a*log(1 + X),
NL.start = list(a = 0.5),
verbose = 2) # reports that R encountered a fatal error and restarts`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions