[FLR-list] FLSR sigma2

Iago MOSQUEIRA (JRC) iago.mosqueira-sanchez at jrc.ec.europa.eu
Thu Aug 8 13:35:58 CEST 2013


On 08/08/2013 12:19 PM, Clara Ulrich wrote:
> Hi all, 
> 
> I feel that my FLR brain is smelting away, I just do not use it enough anymore to keep a sharp up-to-date knowledge ;-( And indeed, trying to re-run some 2 years old from R2.8.1 I get some bugs of course. 
> 
> Is there nothing like a sigma2 in the FLSR parameters anymore? Is this stored something else?
> 
> Thanks
> Clara

Hi,

But FLRing is like cycling, never to be forgotten...

The formulation of the likelihood that has been used for the last 2-3
years does not have sigma2 as an estimated parameter, but is instead
calculated, as it was just a nuisance parameter that made life more
dificult forn the optimizer

> getMethod('loglAR1', c('FLQuant', 'FLQuant'))


Method Definition:

function (obs, hat, ...)
{
    .local <- function (obs, hat, rho = 0)
    {
        n <- dim(obs)[2]
        rsdl <- (obs[, -1] - rho * obs[, -n] - hat[, -1] + rho *
            hat[, -n])
        s2 <- sum(rsdl^2, na.rm = T)
        s1 <- s2
        if (!all(is.na(rsdl[, 1])))
            s1 <- s1 + (1 - rho^2) * (obs[, 1] - hat[, 1])^2
        sigma2 <- sigma(obs, hat)^2
        n <- length(obs[!is.na(obs)])
        sigma2.a <- (1 - rho^2) * sigma2
        res <- (log(1/(2 * pi)) - n * log(sigma2.a) + log(1 -
            rho^2) - s1/(2 * sigma2.a))/2
        if (!is.finite(res))
            res <- -1e+100
        return(res)
    }
    .local(obs, hat, ...)
}
<environment: namespace:FLCore>

which class sigma()

> getMethod('sigma', c('FLArray'))
Method Definition:

function (object, ...)
{
    .local <- function (object, hat = rep(0, length(object)))
    {
        if (all(is.na(hat)))
            return(Inf)
        SS <- sum((object - hat)^2, na.rm = TRUE)
        return((SS/length(hat[!is.na(hat)]))^0.5)
    }
    .local(object, ...)
}
<environment: namespace:FLCore>

Signatures:
        object
target  "FLArray"
defined "FLArray"

which calculates it from SS.


Iago



-- 
Dr Iago Mosqueira

European Commission – Joint Research Center
Institute for the Protection and Security of the Citizen (IPSC)
Maritime Affairs Unit FISHREG – Scientific Support to Fisheries
TP 051, Via Enrico Fermi 2749
I-21027 Ispra (VA), Italy

Office : +39 0332 785413
Fax: +39 0332 789658

iago.mosqueira at jrc.ec.europa.eu

http://fishreg.jrc.ec.europa.eu/home



More information about the flr-list mailing list