Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • s2dv s2dv
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 17
    • Issues 17
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Earth SciencesEarth Sciences
  • s2dvs2dv
  • Issues
  • #103
Closed
Open
Issue created Jun 20, 2023 by Carlos Delgado Torres@cdelgadoMaintainer

Criterion for NAs

Hi @aho and @erifarov,

This is not urgent, but @nperez and I think it could be an useful development for the future.

Sometimes we want to exclude the NA values for skill metrics computation, and other times we want the functions to return NA if there are NAs in the data. One intermediate option is to compute the skill metrics if the fraction of available data (i.e. fraction of no-NA values) is above a threshold.

I developed a few lines for this some time ago. I'm pasting them here for the future:

# compute skill if there are less than 40% NAs in the data
f_NAs <- 0.4
good_values <- !is.na(exp) & !is.na(obs)

if (f_NAs <= sum(good_values)/length(obs)){

  exp <- exp[good_values]
  obs <- obs[good_values]

  skill <- ...

} else {

  skill <- NA

}

Best regards,
Carlos

Assignee
Assign to
Time tracking