simulate.evmOpt: Simulate from a fitted evm object

View source: R/simulate.R

simulate.evmOptR Documentation

Simulate from a fitted evm object

Description

Simulate random numbers from a fitted evm object

Usage

## S3 method for class 'evmOpt'
simulate(object, nsim = 1, seed = NULL, param = NULL, ...)

## S3 method for class 'evmSim'
simulate(object, nsim = 1, seed = NULL, ...)

## S3 method for class 'evmBoot'
simulate(object, nsim = 1, seed = NULL, ...)

Arguments

object

A fitted evm object having class 'evmOpt', 'evmSim' or 'evmBoot'.

nsim

The number of simulations to perform. Defaults to nsim=1. A single simulation involves simulating a new set of responses from the data that was provided to evm (after thresholding if thresholding is performed.)

seed

An integer to be passed to set.seed. Defaults to seed=NULL.

param

Parameters to use in the random number generator. Defaults to param=NULL in which case the parameters from the fitted model are used. For simulate.evmSim and simulate.evmBoot, this argument is not available and the simulated parameters or replicates are used.

...

Unused.

Details

For simulate.evmSim and simulate.evmBoot, the parameters from the Markov chains or bootstrap replicates are randomly permuted prior to each set of simulated responses being computed. In this way, reusing the same set of values is avoided.

Value

If nsim=1, a vector or random numbers simulated from the fitted model object. If nsim > 1, a matrix with each column being a set of simulated responses.

Author(s)

Paul Metcalfe, Harry Southworth

See Also

evm

Examples


mod <- evm(rain, qu=.95)
hist(simulate(mod, 100))


harrysouthworth/texmex documentation built on March 8, 2024, 7:50 p.m.