normmix: Create a 2d mixture with normal components

Description Usage Arguments Value Author(s) See Also Examples

View source: R/normmix.R

Description

Constructor function for the normmix class. Creates a mixture in two dimensions with bivariate normal components. If the parameters lambda and window are set, this function will create an intensity surface object of class intensity_surface.

For examples see

http://faculty.missouri.edu/~micheasa/sppmix/sppmix_all_examples.html#normmix

The print function can be used on a normmix or intensity_surface object in order to display basic information.

The summary function can be used on a normmix or intensity_surface object in order to display additional information.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
normmix(ps, mus, sigmas, lambda = NULL, win = NULL, estimated = FALSE)

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

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

## S3 method for class 'normmix'
summary(object, ...)

## S3 method for class 'intensity_surface'
summary(object, ...)

Arguments

ps

Vector of component probabilities.

mus

A list where every element is a vector of length 2, defining the center of each component.

sigmas

A list where every element is a 2 by 2 covariance matrix, defining the covariance for each component.

lambda

Optional parameter denoting the average number of points over the window. If set along with the win parameter, the returned object will be an intensity surface.

win

Optional parameter for the window of observation, an object of type owin. Must be set together with lambda in order to create an intensity surface.

estimated

Logical variable to indicate that this is an estimated mixture not the true mixture surface. By default it is set to FALSE, but when using the function to define an mixture based on estimates of the parameters it should be set to TRUE.

x

An object of class normmix or intensity_surface.

...

Additional arguments for the S3 method.

object

An object of class normmix or intensity_surface.

Value

An object of class "normmix" containing the following components:

m

Number of components.

ps

Vector of component probabilities.

mus

List of mean vectors of the components.

sigmas

List of covariance matrices of the components.

lambda

Returned only if lambda is provided when calling normmix.

window

Returned only win is provided when calling normmix. This is an object of class owin.

estimated

Whether the normal mixture is estimated.

Author(s)

Yuchen Wang, Sakis Micheas

See Also

rnormmix for generating a mixture with random parameters.

Examples

1
2
3
4
5
6
7
8
mix1 <- normmix(ps = c(.3, .7), mus = list(c(0.2, 0.2), c(.8, .8)),
 sigmas = list(.01*diag(2), .01*diag(2)))
mix1
summary(mix1)
intsurf1 <- normmix(ps = c(.3, .7), mus = list(c(0.2, 0.2), c(.8, .8)),
 sigmas = list(.01*diag(2), .01*diag(2)), lambda = 100, win = spatstat::square(1))
intsurf1
summary(intsurf1)

sppmix documentation built on Jan. 13, 2021, 10:04 p.m.