multiv_likelihood: The multivariate likelihood (log-likelihood) for a given set...

Description Usage Arguments Examples

View source: R/search_fun.R

Description

Returns a log-likelihood calculated from the climate data at one or more localities referenced against a set of climate PDFs.

Usage

1
multiv_likelihood(x, clim, dens, type, w = FALSE)

Arguments

x

A data.frame of climate values (i.e., extracted from the climate raster object)

clim

A raster object of climate data (matching x)

dens

A density object from vegdistmod::densform(), vegdistmod::and_fun(), or vegdistmod::or_fun();

type

Designate either ".gauss" or ".kde".

w

To weight or not to weight by coefficient of variation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
data(abies);
ext.abies = extraction(abies, climondbioclim, schema='raw', 
 rm.outlier=FALSE);
dens.abies = densform(ext.abies, climondbioclim);
for(i in 1:length(ext.abies[,1])){
  m = multiv_likelihood(ext.abies[i,6:length(ext.abies[1,])],
     climondbioclim, dens.abies, type = '.kde');
   ext.abies[i, 'prob'] = m[[1]];
}
print(ext.abies$prob)

## End(Not run)

rsh249/vegdistmod documentation built on May 28, 2019, 3:31 a.m.