PNHP / Regional_SDM

Methods and collaboration for Species Distribution Modeling among Heritage Programs
3 stars 0 forks source link

"Use_A" may not be be working in 2_attributePoints.R #19

Closed ChristopherTracey closed 6 years ago

ChristopherTracey commented 6 years ago

I had to change the 0's to 1's in the sql database to get the model to run. It seems like the code is not ignoring these values.

dnbucklin commented 6 years ago

use_A in the sqlite database is meant to define a set of "base" variables to use in every run (they need to be set to 1).

To not include certain base variable(s) from a model run, list them by name in the argument remove_vars.

To include non-base variables (ones marked use_A = 0), list them by name in the argument add_vars. This was set up for the terrestrial models and now is added to the aquatic as of eca7f6879.

ChristopherTracey commented 6 years ago

Oh... somehow I thought the “A” stood for ‘aquatic’. Maybe I was deep in the weeds and couldn’t see the context.

I’ll look at it again.

dnbucklin commented 6 years ago

Sorry, I should have explained a bit more. You're right 'A' does stand for Aquatic and represents the modeling type (group) for that species. This comes from the lkpSpecies table - each species is assign a letter in their MODTYPE column (which in turn is linked to lkpModtype). Only variables marked use_[MODTYPE] = 1 in the lkpEnvVars[Aqua] table are used by default for that species.

For the aquatic species, the only "group" we've used so far was just "A" (aquatic). So there is a use_A column right now in lkpEnvVarsAqua, but can/would need to be added if a new MODTYPE was used.

This format allows for defining a "base" group of variables for a specific MODTYPE (e.g. we used this for Bats, shoreline species, etc).