Learn R Programming

Biolinv (version 0.1-3)

EM: Runs the EM algorithm.

Description

Attributes to the populations in an invasion time series a probability value of being of natural origin, as opposite of anthropogenic origin.

Usage

EM(dataset, randompoints, sigma, pi)

Arguments

dataset

the data frame to be analised (WGS84, colums order should be "year","lat","long","origin")

randompoints

data frame of 'y' and 'x' coordinates of random points (projected coordinate system)

sigma

starting value for the standard deviation of the natural dispersal kernel (assumed to be a half normal)

pi

starting value for the proportion of natural points in the dataset

Value

dataset argument with two additional colums. 'dist': distance from nearest point of natural origin or nearest anchor point (see Details); 'Pnat': probability of being of natural origin.

Examples

Run this code
# NOT RUN {
data('nzp')
data('frogs')
randp<- RPG(rpopn=1000, boundary=nzp, SP= 'random_frog')
frogsEM<- EM(dataset= frogs, randompoints= randp, sigma=6, pi=0.5)
# }

Run the code above in your browser using DataLab