dens: Density for Parameterized MVN Mixtures

Description Usage Arguments Value See Also Examples

View source: R/densityMclust.R

Description

Computes densities of observations in parameterized MVN mixtures.

Usage

1
dens(modelName, data, logarithm = FALSE, parameters, warn=NULL, ...)

Arguments

modelName

A character string indicating the model. The help file for mclustModelNames describes the available models.

data

A numeric vector, matrix, or data frame of observations. Categorical variables are not allowed. If a matrix or data frame, rows correspond to observations and columns correspond to variables.

logarithm

A logical value indicating whether or not the logarithm of the component densities should be returned. The default is to return the component densities, obtained from the log component densities by exponentiation.

parameters

The parameters of the model:

pro

The vector of mixing proportions for the components of the mixture.

mean

The mean for each component. If there is more than one component, this is a matrix whose kth column is the mean of the kth component of the mixture model.

variance

A list of variance parameters for the model. The components of this list depend on the model specification. See the help file for mclustVariance for details.

warn

A logical value indicating whether or not a warning should be issued when computations fail. The default is warn=FALSE.

...

Catches unused arguments in indirect or list calls via do.call.

Value

A numeric vector whose ith component is the density of the ith observation in data in the MVN mixture specified by parameters.

See Also

cdens, mclust.options, do.call

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
faithfulModel <- Mclust(faithful)
Dens <- dens(modelName = faithfulModel$modelName, data = faithful,
             parameters = faithfulModel$parameters)
Dens

## alternative call
do.call("dens", faithfulModel)
## End(Not run)

Example output

Package 'mclust' version 5.3
Type 'citation("mclust")' for citing this R package in publications.
           1            2            3            4            5            6 
0.0124452630 0.0251103330 0.0040511683 0.0138957841 0.0377770101 0.0002543504 
           7            8            9           10           11           12 
0.0203107055 0.0040978409 0.0303489590 0.0316101199 0.0277551985 0.0134044293 
          13           14           15           16           17           18 
0.0353807152 0.0126442831 0.0342641889 0.0276813224 0.0053231930 0.0236917532 
          19           20           21           22           23           24 
0.0106371305 0.0396811737 0.0238465507 0.0126442831 0.0069876287 0.0003868686 
          25           26           27           28           29           30 
0.0201700886 0.0067565468 0.0350684137 0.0259030141 0.0222189732 0.0466820849 
          31           32           33           34           35           36 
0.0200562319 0.0384362135 0.0013975655 0.0263294298 0.0176696617 0.0334660466 
          37           38           39           40           41           42 
0.0188188607 0.0178819851 0.0163359026 0.0111393903 0.0460930661 0.0227955938 
          43           44           45           46           47           48 
0.0411825038 0.0136911166 0.0156815924 0.0011624864 0.0010848438 0.0338519338 
          49           50           51           52           53           54 
0.0408865394 0.0252902092 0.0088008861 0.0128147254 0.0277551985 0.0178819851 
          55           56           57           58           59           60 
0.0195412584 0.0162564391 0.0103932388 0.0015849034 0.0330802436 0.0435775023 
          61           62           63           64           65           66 
0.0240571929 0.0421307152 0.0149798004 0.0238606889 0.0124808947 0.0055604922 
          67           68           69           70           71           72 
0.0334603589 0.0256817760 0.0064756531 0.0085521562 0.0225165968 0.0334648223 
          73           74           75           76           77           78 
0.0452557220 0.0106754648 0.0132811290 0.0015218106 0.0218921391 0.0376213678 
          79           80           81           82           83           84 
0.0217156912 0.0067565468 0.0247073331 0.0425915775 0.0084775390 0.0017406432 
          85           86           87           88           89           90 
0.0168617350 0.0091341370 0.0227238464 0.0469617391 0.0139334843 0.0103205479 
          91           92           93           94           95           96 
0.0222898736 0.0091689248 0.0251086236 0.0149808355 0.0059605339 0.0157859796 
          97           98           99          100          101          102 
0.0356058978 0.0181838259 0.0276246179 0.0143349760 0.0070558503 0.0178108474 
         103          104          105          106          107          108 
0.0204677557 0.0456027665 0.0255176411 0.0155180490 0.0329309095 0.0238190979 
         109          110          111          112          113          114 
0.0169611999 0.0130056372 0.0125667030 0.0205687590 0.0091111824 0.0466511095 
         115          116          117          118          119          120 
0.0086958156 0.0404026290 0.0118723416 0.0363438712 0.0153446173 0.0247921151 
         121          122          123          124          125          126 
0.0027744023 0.0062146273 0.0357371066 0.0334648223 0.0227013143 0.0160589468 
         127          128          129          130          131          132 
0.0096540658 0.0477853724 0.0258225554 0.0138420819 0.0095728636 0.0270865778 
         133          134          135          136          137          138 
0.0007295485 0.0124434909 0.0119884708 0.0455263721 0.0283443318 0.0113100921 
         139          140          141          142          143          144 
0.0354880687 0.0179747600 0.0374051862 0.0212619731 0.0469879727 0.0125340287 
         145          146          147          148          149          150 
0.0345550981 0.0246303260 0.0386497224 0.0229703387 0.0004878624 0.0254959451 
         151          152          153          154          155          156 
0.0026745329 0.0251828986 0.0051753098 0.0432169489 0.0082776785 0.0082640770 
         157          158          159          160          161          162 
0.0484741325 0.0011340190 0.0254959451 0.0039143691 0.0051969415 0.0153979049 
         163          164          165          166          167          168 
0.0290202812 0.0218025163 0.0021333792 0.0270690991 0.0092238522 0.0063009960 
         169          170          171          172          173          174 
0.0323838481 0.0054556278 0.0231880636 0.0334585275 0.0319010356 0.0019841594 
         175          176          177          178          179          180 
0.0324773102 0.0446040632 0.0169052279 0.0068102050 0.0129670482 0.0221426280 
         181          182          183          184          185          186 
0.0304064697 0.0319010356 0.0331746425 0.0118158470 0.0302435424 0.0435267365 
         187          188          189          190          191          192 
0.0189989306 0.0119884708 0.0440810609 0.0319887525 0.0228078895 0.0222590411 
         193          194          195          196          197          198 
0.0111863292 0.0198105316 0.0243559194 0.0374051862 0.0012268146 0.0394263900 
         199          200          201          202          203          204 
0.0189034210 0.0288825422 0.0234073349 0.0436856532 0.0031741263 0.0303361309 
         205          206          207          208          209          210 
0.0350030661 0.0110901008 0.0394387182 0.0117355288 0.0233744232 0.0456027665 
         211          212          213          214          215          216 
0.0005926757 0.0317680917 0.0220930287 0.0195492593 0.0008704371 0.0316782155 
         217          218          219          220          221          222 
0.0125692512 0.0032624266 0.0360897214 0.0283563235 0.0251086236 0.0377458440 
         223          224          225          226          227          228 
0.0209506292 0.0274430828 0.0259508307 0.0311916892 0.0290960283 0.0391990788 
         229          230          231          232          233          234 
0.0083478446 0.0425997153 0.0084197568 0.0127419915 0.0169765637 0.0179649164 
         235          236          237          238          239          240 
0.0122569484 0.0313676854 0.0290493237 0.0371564801 0.0243257893 0.0080122550 
         241          242          243          244          245          246 
0.0252332221 0.0046457890 0.0113100921 0.0002760795 0.0369106518 0.0160280020 
         247          248          249          250          251          252 
0.0334585275 0.0446853220 0.0034539520 0.0248699096 0.0299026176 0.0451264687 
         253          254          255          256          257          258 
0.0107960978 0.0169052279 0.0092476503 0.0194602373 0.0106534040 0.0451264687 
         259          260          261          262          263          264 
0.0346670726 0.0417397511 0.0193095211 0.0419666045 0.0205617231 0.0331746425 
         265          266          267          268          269          270 
0.0047832977 0.0206266008 0.0115494154 0.0291554823 0.0086211689 0.0114550953 
         271          272 
0.0117384618 0.0228131636 
           1            2            3            4            5            6 
0.0124452630 0.0251103330 0.0040511683 0.0138957841 0.0377770101 0.0002543504 
           7            8            9           10           11           12 
0.0203107055 0.0040978409 0.0303489590 0.0316101199 0.0277551985 0.0134044293 
          13           14           15           16           17           18 
0.0353807152 0.0126442831 0.0342641889 0.0276813224 0.0053231930 0.0236917532 
          19           20           21           22           23           24 
0.0106371305 0.0396811737 0.0238465507 0.0126442831 0.0069876287 0.0003868686 
          25           26           27           28           29           30 
0.0201700886 0.0067565468 0.0350684137 0.0259030141 0.0222189732 0.0466820849 
          31           32           33           34           35           36 
0.0200562319 0.0384362135 0.0013975655 0.0263294298 0.0176696617 0.0334660466 
          37           38           39           40           41           42 
0.0188188607 0.0178819851 0.0163359026 0.0111393903 0.0460930661 0.0227955938 
          43           44           45           46           47           48 
0.0411825038 0.0136911166 0.0156815924 0.0011624864 0.0010848438 0.0338519338 
          49           50           51           52           53           54 
0.0408865394 0.0252902092 0.0088008861 0.0128147254 0.0277551985 0.0178819851 
          55           56           57           58           59           60 
0.0195412584 0.0162564391 0.0103932388 0.0015849034 0.0330802436 0.0435775023 
          61           62           63           64           65           66 
0.0240571929 0.0421307152 0.0149798004 0.0238606889 0.0124808947 0.0055604922 
          67           68           69           70           71           72 
0.0334603589 0.0256817760 0.0064756531 0.0085521562 0.0225165968 0.0334648223 
          73           74           75           76           77           78 
0.0452557220 0.0106754648 0.0132811290 0.0015218106 0.0218921391 0.0376213678 
          79           80           81           82           83           84 
0.0217156912 0.0067565468 0.0247073331 0.0425915775 0.0084775390 0.0017406432 
          85           86           87           88           89           90 
0.0168617350 0.0091341370 0.0227238464 0.0469617391 0.0139334843 0.0103205479 
          91           92           93           94           95           96 
0.0222898736 0.0091689248 0.0251086236 0.0149808355 0.0059605339 0.0157859796 
          97           98           99          100          101          102 
0.0356058978 0.0181838259 0.0276246179 0.0143349760 0.0070558503 0.0178108474 
         103          104          105          106          107          108 
0.0204677557 0.0456027665 0.0255176411 0.0155180490 0.0329309095 0.0238190979 
         109          110          111          112          113          114 
0.0169611999 0.0130056372 0.0125667030 0.0205687590 0.0091111824 0.0466511095 
         115          116          117          118          119          120 
0.0086958156 0.0404026290 0.0118723416 0.0363438712 0.0153446173 0.0247921151 
         121          122          123          124          125          126 
0.0027744023 0.0062146273 0.0357371066 0.0334648223 0.0227013143 0.0160589468 
         127          128          129          130          131          132 
0.0096540658 0.0477853724 0.0258225554 0.0138420819 0.0095728636 0.0270865778 
         133          134          135          136          137          138 
0.0007295485 0.0124434909 0.0119884708 0.0455263721 0.0283443318 0.0113100921 
         139          140          141          142          143          144 
0.0354880687 0.0179747600 0.0374051862 0.0212619731 0.0469879727 0.0125340287 
         145          146          147          148          149          150 
0.0345550981 0.0246303260 0.0386497224 0.0229703387 0.0004878624 0.0254959451 
         151          152          153          154          155          156 
0.0026745329 0.0251828986 0.0051753098 0.0432169489 0.0082776785 0.0082640770 
         157          158          159          160          161          162 
0.0484741325 0.0011340190 0.0254959451 0.0039143691 0.0051969415 0.0153979049 
         163          164          165          166          167          168 
0.0290202812 0.0218025163 0.0021333792 0.0270690991 0.0092238522 0.0063009960 
         169          170          171          172          173          174 
0.0323838481 0.0054556278 0.0231880636 0.0334585275 0.0319010356 0.0019841594 
         175          176          177          178          179          180 
0.0324773102 0.0446040632 0.0169052279 0.0068102050 0.0129670482 0.0221426280 
         181          182          183          184          185          186 
0.0304064697 0.0319010356 0.0331746425 0.0118158470 0.0302435424 0.0435267365 
         187          188          189          190          191          192 
0.0189989306 0.0119884708 0.0440810609 0.0319887525 0.0228078895 0.0222590411 
         193          194          195          196          197          198 
0.0111863292 0.0198105316 0.0243559194 0.0374051862 0.0012268146 0.0394263900 
         199          200          201          202          203          204 
0.0189034210 0.0288825422 0.0234073349 0.0436856532 0.0031741263 0.0303361309 
         205          206          207          208          209          210 
0.0350030661 0.0110901008 0.0394387182 0.0117355288 0.0233744232 0.0456027665 
         211          212          213          214          215          216 
0.0005926757 0.0317680917 0.0220930287 0.0195492593 0.0008704371 0.0316782155 
         217          218          219          220          221          222 
0.0125692512 0.0032624266 0.0360897214 0.0283563235 0.0251086236 0.0377458440 
         223          224          225          226          227          228 
0.0209506292 0.0274430828 0.0259508307 0.0311916892 0.0290960283 0.0391990788 
         229          230          231          232          233          234 
0.0083478446 0.0425997153 0.0084197568 0.0127419915 0.0169765637 0.0179649164 
         235          236          237          238          239          240 
0.0122569484 0.0313676854 0.0290493237 0.0371564801 0.0243257893 0.0080122550 
         241          242          243          244          245          246 
0.0252332221 0.0046457890 0.0113100921 0.0002760795 0.0369106518 0.0160280020 
         247          248          249          250          251          252 
0.0334585275 0.0446853220 0.0034539520 0.0248699096 0.0299026176 0.0451264687 
         253          254          255          256          257          258 
0.0107960978 0.0169052279 0.0092476503 0.0194602373 0.0106534040 0.0451264687 
         259          260          261          262          263          264 
0.0346670726 0.0417397511 0.0193095211 0.0419666045 0.0205617231 0.0331746425 
         265          266          267          268          269          270 
0.0047832977 0.0206266008 0.0115494154 0.0291554823 0.0086211689 0.0114550953 
         271          272 
0.0117384618 0.0228131636 

mclust documentation built on Nov. 22, 2017, 5:05 p.m.