Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_observations() gives false data sufficiency #20

Open
jellevanzweden opened this issue Jan 18, 2019 · 1 comment
Open

check_observations() gives false data sufficiency #20

jellevanzweden opened this issue Jan 18, 2019 · 1 comment

Comments

@jellevanzweden
Copy link

Hi,

In my analyses of rural bird species, I came across the issue that, even though the function check_observations() tells me that I have enough data points to the model, the model run itself gives me an error. There are two separate errors, prumably related to using small datasets and/or short periods:

  1. Error: Model non-estimable due to excessive high beta values.
  2. Error: Data does not contain enough information to estimate model.

In the attached files, I illustrated the issue with similar data of three species: one that gives no errors, one that gives the first error, and one that gives the second error. Is it possible to make the function check_observations() tally with the data/observations/information that the model actually uses?

Cheers, Jelle

Data issues with rtrim.zip

@asierrl
Copy link

asierrl commented Jun 9, 2023

I faced the same problem. It seems to work for model 3, but for model 2 it fails even when there is a covariable level with no valid observations. Here a simple example:

sites <- c(1,2,2,3,3)
year <- c(1991, 1991, 1991, 1992, 1992)
habitat <- c(3,1,2,1,2) 
count <- as.integer(runif(5, min=14, max=100))
count[1]<- NA


df <- data.frame(sites, year, count, habitat)

df
sites year count habitat
1 1 1991 NA 3
2 2 1991 21 1
3 2 1991 27 2
4 3 1992 42 1
5 3 1992 27 2

check_observations(df, model=2, covars="habitat")

check_observations(df, model=2, covars="habitat")
$errors
list()
$sufficient
[1] TRUE

The rtrim manual states that "For model 2 with covariates there must be at least one observation for every value of each
covariate, at each time segment defined by the change points." However, in this case there is no count value for habitat = 3 and even so, the output says sufficient.
Is this a bug? Or are we missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants