plot.bmixt: Plot function for 'S3' class '"bmixt"'

Description Usage Arguments Author(s) See Also Examples

View source: R/bmixt.R

Description

Visualizes the results for function bmixt.

Usage

1
2
## S3 method for class 'bmixt'
plot( x, ... )

Arguments

x

An object of S3 class "bmixt", from function bmixt.

...

System reserved (no specific usage).

Author(s)

Reza Mohammadi a.mohammadi@uva.nl

See Also

bmixt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
# simulating data from mixture of Normal with 3 components
n      = 500
weight = c( 0.3, 0.5, 0.2 )
mean   = c( 0  , 10 , 3   )
sd     = c( 1  , 1  , 1   )
    
data = rmixnorm( n = n, weight = weight, mean = mean, sd = sd )

# plot for simulation data      
hist( data, prob = TRUE, nclass = 30, col = "gray" )
  
x           = seq( -20, 20, 0.05 )
densmixnorm = dmixnorm( x, weight, mean, sd )
      
lines( x, densmixnorm, lwd = 2 )  
    
# Runing bdmcmc algorithm for the above simulation data set      
bmixt.obj = bmixt( data, k = 3 )
    
plot( bmixt.obj ) 

## End(Not run)

bmixture documentation built on May 11, 2021, 5:08 p.m.