Payoff function of a Solar Option

solarOption_payoff(R, K = 0, put = TRUE)

Arguments

R

Numeric, vector of values of solar radiation at maturity.

K

Numeric, scalar or vector of strikes.

put

Logical, when TRUE, the default, the function will return the output of a put payoff otherwise a call payoff. See the details.

Details

When put = TRUE, the function evaluate a put payoff: $$(K - R)^{+} = (K - R) 1_{K > R}$$ When put = TRUE, the function evaluate a call payoff: $$(R-K)^{+} = (R - K) 1_{R \ge K}$$

Note

Version 1.0.0.

Examples

# Put
solarOption_payoff(10, 9, put = TRUE)
#> [1] 0
solarOption_payoff(8, 9, put = TRUE)
#> [1] 1
# Call
solarOption_payoff(10, 9, put = FALSE)
#> [1] 1
solarOption_payoff(8, 9, put = FALSE)
#> [1] 0