rhor.clust {nnspat} | R Documentation |
Generation of Points with Clusters along the Horizontal Axis
Description
An object of class "Clusters"
.
Generates n
2D points with k
(k \ge 2
) clusters along the horizontal axis
where about n/k
points belongs to each cluster.
If distribution="uniform"
, the points are uniformly generated in their square
supports where one square is the unit square (i.e., with vertices (0,0), (1,0), (1,1),(0,1)
), and
the others are d
units shifted horizontally from each other so that their lower end vertices are
(j-1)+(j-1) d
for j=1,2,\ldots,k
.
If distribution="bvnormal"
, the points are generated from the bivariate normal distribution with means equal to the
centers of the above squares (i.e., for each cluster with mean=(j+(j-1)d-1/2,1/2) for j=1,2,\ldots,k
and the covariance matrix sd I_2
, where I_2
is the 2 \times 2
identity matrix.
Notice that the clusters are more separated, i.e., generated data indicates more clear clusters as d
increases
in either direction with d=0
indicating one cluster in the data. For a fixed d
, when distribution="bvnormal"
,
the clustering gets stronger if the variance of each component, sd^2
, gets smaller, and clustering gets weaker
as the variance of each component gets larger where default is sd=1/6
.
Usage
rhor.clust(n, k, d, sd = 1/6, distribution = c("uniform", "bvnormal"))
Arguments
n |
A positive integer representing the number of points to be generated from all the clusters |
k |
A positive integer representing the number of clusters to be generated |
d |
Horizontal shift indicating the level of clustering in the data. Larger absolute values in either direction (i.e., positive or negative) would yield stronger clustering. |
sd |
The standard deviation of the components of the bivariate normal distribution with default |
distribution |
The argument determining the distribution of each cluster. Takes on values |
Value
A list
with the elements
type |
The type of the clustering pattern |
parameters |
The number of clusters, |
gen.points |
The output set of generated points from the |
desc.pat |
Description of the clustering pattern |
mtitle |
The |
num.points |
The number of generated points. |
xlimit , ylimit |
The possible ranges of the |
Author(s)
Elvan Ceyhan
See Also
Examples
n<-100; #try also n<-50; or n<-1000;
d<-.5 #try also -.5,.75, 1
k<-3 #try also 5
#data generation
Xdat<-rhor.clust(n,k,d)
Xdat
summary(Xdat)
plot(Xdat,asp=1)
plot(Xdat)
#data generation (bvnormal)
n<-100; #try also n<-50; n<-1000;
d<-.1 #try also -.1, .75, 1
k<-3 #try also 5
Xdat<-rhor.clust(n,k,d,distr="bvnormal") #try also Xdat<-rhor.clust(n,k,d,sd=.15,distr="bvnormal")
Xdat
summary(Xdat)
plot(Xdat,asp=1)
plot(Xdat)