Learn R Programming

LogConcDEAD (version 1.2-0)

lcd.getweights: Given a matrix of data, find how many times each occurs

Description

This function takes takes a matrix of binned data and returns a matrix containing the distinct observations and a vector of weights

Usage

lcd.getweights(x)

Arguments

x
a data matrix

Value

  • xThe distinct rows of the input matrix
  • wWeights: row $i$ appears $w_i$ times

Details

This function is very simple: if we have some data where not all the observations are distinct (due to e.g. finite precision observation), we can construct a vector of weights for use in computing the maximum likelihood estimator.

Examples

Run this code
## simple normal example
set.seed(101)
x <- matrix(rnorm(200),ncol=2)
tmp <- lcd.getweights(x)
out <- lcd.mle(tmp$x,tmp$w)
plot(out,itype="ic")

Run the code above in your browser using DataLab