[R-sig-Geo] adehabitatHR kernalBB batch processing
Philip Harrison
pharriso at uwaterloo.ca
Thu Mar 21 20:45:59 CET 2013
Hi
I am attempting to use the kernalBB function from adehabitatHR. Now it
works just fine with just one fish, however I have quite a number of
fish and would like to run the analysis on all the fish in one
go-while maintaining individual sig 1 estimates. See below for example
coding...
library(adehabitatHR)
library(adehabitatLT)
data(puechabonsp)
loc$DT <-as.POSIXct(strptime(loc$Date, format='%y%m%d' ))
ltraj <- as.ltraj(coordinates(loc), loc$DT, id = loc$Name, burst = loc$Name,
+ typeII = TRUE)
sig255<-liker(ltraj, sig2 = 255, rangesig1 = c(0, 1000))
*****************************************
Maximization of the log-likelihood for parameter
sig1 of brownian bridge
Brock : Sig1 = 2.002 Sig2 = 255
Calou : Sig1 = 0 Sig2 = 255
Chou : Sig1 = 1.001 Sig2 = 255
Jean : Sig1 = 2.002 Sig2 = 255
##so now I would like to run the kernalBB on all 4 fish individually.
##so i tried...
> tataall <- kernelbb(ltraj, sig1 = sig255, sig2 = 255, grid = 100,byburst=T)
#Error in sig1^2 : non-numeric argument to binary operator
##I dont have a great deal of experience working with list formats-
can anyone ##assist me in calling the relevent sig 1 for each fish?
#now if I know I can used a fixed sig 1 for all fine ie
> tataall <- kernelbb(ltraj, sig1 = 1, sig2 = 255, grid = 100,byburst=T)
##I am sure it is something stupid and easy....
##I see that when you do a similar thing for the D function in the BRB
function it seems to work fine (I assume that this is using differing
D levels for each fish..)
vv2<- BRB.likD(ltraj, Dr=c(1,50000), Tmax = 5*(24*60*60) + 1, Lmin = 0.1)
testud <-BRB(ltraj, D =vv2, Tmax =5*(24*60*60) + 1, Lmin =0.1, hmin = 100)
finally, I notice that we get some zero sig 1 values both in my
dataset and in the example of Calou. Is this an issue?
Thanks for any help
Phil H.
p.s. im running
R version 2.15.2 (2012-10-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
adehabitatHR_0.4.2 adehabitatLT_0.3.6
More information about the R-sig-Geo
mailing list