Learn R Programming

LS2W (version 1.3.6)

LS2Wsim.cddews: Simulate an LS2W process with underlying Daubechies wavelet.

Description

Simulates a realisation of an LS2W process of a given spectral structure for Daubechies wavelets.

Usage

# S3 method for cddews
LS2Wsim(spectrum,innov=rnorm,...)

Value

A simulated image matrix that will exhibit the spectral characteristics defined by spectrum.

Arguments

spectrum

True spectrum of class cddews which may be the output of cddews.

innov

The distribution of the innovations of the LS2W process. Defaults to the (unit) normal distribution.

...

Any other arguments passed into the innov function.

Author

Sarah L Taylor

Details

This function uses the provided spectral structure to simulate an LS2W process. The provided spectral structure should take positive values, any negative values will be set to zero by the function.

The process of simulation for Daubechies wavelets follows by firstly extracting the coefficients from the provided spectrum and squaring. They are then multiplied by random increments (from rnorm()) and an appropriate multiple of 4 (depending on the scale) which allows for the effect of basis averaging. After converting to the appropriate form (a wst2D object) the basis average is taken to give a realisation of an LS2W process.

See Also

HaarMontage

Examples

Run this code

#Generate an empty spectrum
#
Spectrum<-cddews(matrix(0,64,64),smooth=FALSE)
#
#Add power at the first scale, in the vertical direction
#
Spectrum$S[1,,]<-matrix(1,64,64)
#                                                          
# Simulate an LS2W process with this structure
#           
testimage<- LS2Wsim(Spectrum)
#
  

Run the code above in your browser using DataLab