Class AALHazardBasedFunction

java.lang.Object
nz.org.riskscape.engine.function.BaseRealizableFunction
nz.org.riskscape.defaults.function.AALHazardBasedFunction
All Implemented Interfaces:
nz.org.riskscape.engine.rl.agg.AggregationFunction, nz.org.riskscape.engine.rl.RealizableFunction

public class AALHazardBasedFunction extends nz.org.riskscape.engine.function.BaseRealizableFunction implements nz.org.riskscape.engine.rl.agg.AggregationFunction

Calculates an AAL for a hazard-based probabilistic data. We have a series of x,y datapoints, representing the loss and EP (Exceedance Probability). The AAL is the area under the x,y "curve". NB: we just connect the data-points via a straight-line (i.e. piecewise linear data), which simplifies the AAL calculation.

For the AAL calculation we use x=EP, y=loss. This seems to produce better results, because the spacing between X datapoints is consistent. Whereas if we used x=loss, y=EP, if we get duplicate losses then we end up with a zero AAL for the duplicates (i.e. there's no area under the curve). Refer GL993 for more details.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     

    Nested classes/interfaces inherited from interface nz.org.riskscape.engine.rl.RealizableFunction

    nz.org.riskscape.engine.rl.RealizableFunction.MetadataIdentifiedRealizableFunction
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final com.google.common.collect.Range<Double>
     
     

    Fields inherited from class nz.org.riskscape.engine.function.BaseRealizableFunction

    arguments, returnType
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    nz.org.riskscape.engine.function.RiskscapeFunction
     
    nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.rl.agg.RealizedAggregateExpression>
    realize(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.engine.types.Type inputType, nz.org.riskscape.rl.ast.FunctionCall fc)
     
    nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.function.RiskscapeFunction>
    realize(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.rl.ast.FunctionCall fc, List<nz.org.riskscape.engine.types.Type> givenTypes)
     

    Methods inherited from class nz.org.riskscape.engine.function.BaseRealizableFunction

    build, builtin, getArguments, getReturnType, identified

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface nz.org.riskscape.engine.rl.agg.AggregationFunction

    getArguments, getReturnType
  • Field Details

  • Constructor Details

    • AALHazardBasedFunction

      public AALHazardBasedFunction()
  • Method Details

    • realize

      public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.function.RiskscapeFunction> realize(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.rl.ast.FunctionCall fc, List<nz.org.riskscape.engine.types.Type> givenTypes)
      Specified by:
      realize in interface nz.org.riskscape.engine.rl.RealizableFunction
      Overrides:
      realize in class nz.org.riskscape.engine.function.BaseRealizableFunction
    • asFunction

      public nz.org.riskscape.engine.function.RiskscapeFunction asFunction()
      Overrides:
      asFunction in class nz.org.riskscape.engine.function.BaseRealizableFunction
    • realize

      public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.rl.agg.RealizedAggregateExpression> realize(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.engine.types.Type inputType, nz.org.riskscape.rl.ast.FunctionCall fc)
      Specified by:
      realize in interface nz.org.riskscape.engine.rl.agg.AggregationFunction