print.proposal: Print Method for proposal Objects

View source: R/proposal_info.R

print.proposalR Documentation

Print Method for proposal Objects

Description

The function displays detailed information about the proposal object created by STORS' build_proposal() or proposal_optimizer() functions. This includes the number of steps within the proposal, the range of values covered by the proposal, and the proposal's sampling efficiency. This information is crucial for understanding the structure and performance of the proposal in sampling processes.

Usage

## S3 method for class 'proposal'
print(x, ...)

Arguments

x

A list generated using STORS' build_proposal() or proposal_optimizer() functions.

...

Additional arguments passed to the print function.

Details

This method extends the generic print function for objects of class proposal. It prints the provided proposal's features such as the number of steps, steps limit, and efficiency.

Value

Prints a summary of the proposal's properties, but does not return any value.

Examples

# Define the density function, its logarithm,
#and its derivative for the standard normal distribution
modes_norm = 0
f_norm <- function(x) { 1 / sqrt(2 * pi) * exp(-0.5 * x^2) }
h_norm <- function(x) { log(f_norm(x)) }
h_prime_norm <- function(x) { -x }

# Build a dense proposal for the standard normal distribution
norm_proposal = build_proposal(lower = -Inf, upper = Inf, mode = modes_norm,
 f = f_norm, h = h_norm, h_prime = h_prime_norm, steps = 1000)

# Print the properties of the generated proposal

print(norm_proposal)

stors documentation built on April 3, 2025, 6:16 p.m.