[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-geo
Subject:    Re: [R-sig-Geo] adehabitatHR kernalBB batch processing
From:       Johannes Signer <j.m.signer () gmail ! com>
Date:       2013-03-21 22:13:34
Message-ID: CAC8qavtwv052W_azSUaHJFFE8NDyxAZraOUfe5Zyo8tdBdddyw () mail ! gmail ! com
[Download RAW message or body]

Maybe something like this helps:

library(adehabitatHR)
library(adehabitatLT)
data(puechabonsp)

loc <- puechabonsp$relocs

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))
tataall <- lapply(seq_along(ltraj), function(x) kernelbb(ltraj[x],
sig1=sig255[[x]]$sig1, sig2=sig255[[x]]$sig2, grid=100, byburst=T))



On Thu, Mar 21, 2013 at 8:45 PM, Philip Harrison <pharriso@uwaterloo.ca>wrote:

> 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
>
> ______________________________**_________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>



-- 

## ## Contact:
## Johannes Signer, MSc
## PhD-Candidate -- Wildlife Management
## Dept. of Forest Zoology & Forest Conservation
## University of Goettingen
## Buesgenweg 3 (room 85)
## 37077 Goettingen, Germany
## e: jmsigner@gmail.com
## p: +49 (0)551 39 3583
## m: +49 (0)176 61 962856
## skype: j.m.signer
## ##

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic