View source: R/mixture_methods.R
density | R Documentation |
Compute density for a fitted mixture model.
density(object, newdata)
object |
a fitted mixture model of |
newdata |
data of n objects (vectors, matrices) that can be wrapped by one of |
a length-n vector of class labels.
# ---------------------------------------------------- # # FIT A MODEL & APPLY THE METHOD # ---------------------------------------------------- # # Load the 'city' data and wrap as 'riemobj' data(cities) locations = cities$cartesian embed2 = array(0,c(60,2)) for (i in 1:60){ embed2[i,] = sphere.xyz2geo(locations[i,]) } # Fit a model k3 = moSN(locations, k=3) # Evaluate newdensity = density(k3, locations)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.