Learn R Programming

texmex (version 2.4.9)

simulate.evmOpt: Simulate from a fitted evm object

Description

Simulate random numbers from a fitted evm object

Usage

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

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

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

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.

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.

Author

Paul Metcalfe, Harry Southworth

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.

See Also

evm

Examples

Run this code

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

Run the code above in your browser using DataLab