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

prior with multiple covariates doesn't seem to work #13

Closed
acannistra opened this issue Mar 24, 2017 · 5 comments
Closed

prior with multiple covariates doesn't seem to work #13

acannistra opened this issue Mar 24, 2017 · 5 comments

Comments

@acannistra
Copy link

acannistra commented Mar 24, 2017

From the documentation, we see that it is possible to provide a prior estimate of presence probability given a vector of environmental covariates, but trying this results in the following error:

Error in while (obj.old - obj > tol & it < itmax) { : 
  missing value where TRUE/FALSE needed

You can see our code (line 185) here.

The package works well otherwise, using priors on single environmental variables.

Any advice is appreciated.

@goldingn
Copy link
Owner

Hi Tony.

I'm a bit confused by your function. The prior argument has to be a function that takes a dataframe (of all covariates) and returns a vector of probability of presence for each row in the dataframe.

You use cbind, which returns either a matrix or dataframe, right?

Sorry if I missed something.

@acannistra
Copy link
Author

acannistra commented Mar 26, 2017

Oh, I see. For example, if we have environmental covariates A, B, and C, the prior function produces a single probability of presence given the three covariates, rather than a probability given each of the covariates individually? Would it be possible for you to give an example?

@goldingn
Copy link
Owner

That's correct. It's an a priori guess at the SDM function. There's an example here: https://github.com/goldingn/gp_sdm_paper/blob/master/figures/fig1_2.R#L63

@acannistra
Copy link
Author

Ok, great. Thanks for your help!

@goldingn
Copy link
Owner

No problem!

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