getweights {LogConcDEAD}R Documentation

Find appropriate weights for likelihood calculations

Description

This function takes takes a matrix of (possibly binned) data and returns a matrix containing the distinct observations, and a vector of weights w as described below.

Usage

getweights(x)
lcd.getweights(x) 

Arguments

x a data matrix

Details

Given an n x d matrix x of points in R^d, this function removes duplicated observations, and counts the number of times each observation occurs. This is used to compute a vector w such that

w[i] = (number of times x[i,] is observed)/(total number of observations).

This function is called by mlelcd in order to compute the maximum likelihood estimator when the observed data values are not distinct. In this case, the log likelihood function is of the form

w_1 log f(X_1), ..., w_m log f(X_m),

where the sum is over distinct observations.

lcd.getweights is deprecated, but retained for compatibility with previous versions.

Value

xout A matrix containing the distinct rows of the input matrix x
w A real-valued vector of weights as described above

Author(s)

Madeleine Cule mlc40@cam.ac.uk

Robert Gramacy

Richard Samworth

See Also

mlelcd

Examples

## simple normal example

x <- matrix(rnorm(200),ncol=2)
tmp <- getweights(x)
lcd <- mlelcd(tmp$x,tmp$w)
plot(lcd,type="ic")

[Package LogConcDEAD version 1.3-3 Index]