a_j_round: Inverse rounding function: usual rounding + bounds

View source: R/helper_functions.R

a_j_roundR Documentation

Inverse rounding function: usual rounding + bounds

Description

Define the intervals associated with y = j based on the midpoint rounding. The function returns -Inf for j < y_min and Inf for j > y_max, where y_min and y_max are a known bounds on the data y (if specified). Negative values are allowed.

Usage

a_j_round(j, y_min = -Inf, y_max = Inf)

Arguments

j

the integer-valued input(s)

y_min

a fixed and known lower bound for all observations; default is -Inf

y_max

a fixed and known upper bound for all observations; default is Inf

Value

The (lower) interval endpoint(s) associated with j.

Examples

# Standard cases:
a_j_round(0)
a_j_round(20)

# Boundary cases:
a_j_round(0, y_min = 1)
a_j_round(20.5, y_max = 15)


drkowal/rSTAR documentation built on July 5, 2023, 2:18 p.m.