Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gdm.transform fail if geo = TRUE and i-splines for geographic distance are all zero #47

Copy link
Copy link
@dinilu

Description

@dinilu
Issue body actions

I think this lines (#52-54) in the gdm.transform function introduce an error in the result:

if (geo) {
   predInd <- c(1, 2, predInd[-1] + 1)
}

The error appear when geo = TRUE but geographic distance has all values in the i-spline equal to zero. Then, predInd doesn't include the geographic term and removing the first element remove one of the environmental variables from the output. I guess a potential solution is to check whether geographic distance knots has all zero value and then not to remove the first element from predInd.

      if (geo) {
        if(sum(model$coefficients[1:model$splines[1]]) == 0){
          predInd <- c(1, 2, predInd + 1)
        } else {
          predInd <- c(1, 2, predInd[-1] + 1)
        }
      }
Reactions are currently unavailable

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.