<?xml version="1.0" ?>
<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  xmlns="http://purl.org/rss/1.0/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel rdf:about="http://flr-project.org/bugs/">
    <title>FLR</title>
    <link>http://flr-project.org/bugs/</link>
    <description>FLcore bugs</description>
    <dc:date>2010-08-09T13:44:41Z</dc:date>
    <items>
      <rdf:Seq>
                <rdf:li rdf:resource="http://flr-project.org/bugs/index.php?do=details&amp;task_id=32" />
                <rdf:li rdf:resource="http://flr-project.org/bugs/index.php?do=details&amp;task_id=31" />
                <rdf:li rdf:resource="http://flr-project.org/bugs/index.php?do=details&amp;task_id=30" />
                <rdf:li rdf:resource="http://flr-project.org/bugs/index.php?do=details&amp;task_id=29" />
                <rdf:li rdf:resource="http://flr-project.org/bugs/index.php?do=details&amp;task_id=28" />
                <rdf:li rdf:resource="http://flr-project.org/bugs/index.php?do=details&amp;task_id=27" />
                <rdf:li rdf:resource="http://flr-project.org/bugs/index.php?do=details&amp;task_id=26" />
                <rdf:li rdf:resource="http://flr-project.org/bugs/index.php?do=details&amp;task_id=25" />
                <rdf:li rdf:resource="http://flr-project.org/bugs/index.php?do=details&amp;task_id=24" />
                <rdf:li rdf:resource="http://flr-project.org/bugs/index.php?do=details&amp;task_id=23" />
              </rdf:Seq>
    </items>
    		
  </channel>
    <item rdf:about="http://flr-project.org/bugs/index.php?do=details&amp;task_id=32">
    <title>FS#32: as.data.frame(FLQuants(m(ple4)))  name of data is &quot;missing&quot;  </title>
    <link>http://flr-project.org/bugs/index.php?do=details&amp;task_id=32</link>
    <dc:date>2010-08-09T13:44:41Z</dc:date>
    <dc:creator>Laurie Kell</dc:creator>
    <description>head(as.data.frame(FLQuants(m(ple4))))

name of data is &amp;quot;missing&amp;quot;</description>
    <content:encoded><![CDATA[head(as.data.frame(FLQuants(m(ple4))))<br />
<br />
name of data is &quot;missing&quot;<br />]]></content:encoded>
  </item>
    <item rdf:about="http://flr-project.org/bugs/index.php?do=details&amp;task_id=31">
    <title>FS#31: fixed in FLGrowth</title>
    <link>http://flr-project.org/bugs/index.php?do=details&amp;task_id=31</link>
    <dc:date>2010-07-31T11:08:39Z</dc:date>
    <dc:creator>Laurie Kell</dc:creator>
    <description>Looks like you cant fix parameters in FLGrowth

# class FLGrowth
setClass(&amp;#039;FLGrowth&amp;#039;, representation(&amp;#039;FLModel&amp;#039;,
   mass=&amp;#039;FLArray&amp;#039;))

# constructor
setGeneric(&amp;#039;FLGrowth&amp;#039;, function(model, ...)
  standardGeneric(&amp;#039;FLGrowth&amp;#039;))

setMethod(&amp;#039;FLGrowth&amp;#039;, signature(model=&amp;#039;ANY&amp;#039;),
   function(model, ...)
     return(FLModel(model, ..., class=&amp;#039;FLGrowth&amp;#039;)))

setMethod(&amp;#039;FLGrowth&amp;#039;, signature(model=&amp;#039;missing&amp;#039;),
 function(...)
  return(FLModel(formula(NULL), ..., class=&amp;#039;FLGrowth&amp;#039;)))

# example
data(ple4)

gro &amp;lt;- FLGrowth(mass~(Minf*(1-exp(-k*(age-t0))))^3, mass=FLCohort(stock.wt(ple4)))

gro &amp;lt;- fmle(gro, start=list(Minf=7, k=0.3, t0=0), fixed=list(Minf=7))
</description>
    <content:encoded><![CDATA[Looks like you cant fix parameters in FLGrowth<br />
<br />
# class FLGrowth<br />
setClass(&#039;FLGrowth&#039;, representation(&#039;FLModel&#039;,<br />
   mass=&#039;FLArray&#039;))<br />
<br />
# constructor<br />
setGeneric(&#039;FLGrowth&#039;, function(model, ...)<br />
  standardGeneric(&#039;FLGrowth&#039;))<br />
<br />
setMethod(&#039;FLGrowth&#039;, signature(model=&#039;ANY&#039;),<br />
   function(model, ...)<br />
     return(FLModel(model, ..., class=&#039;FLGrowth&#039;)))<br />
<br />
setMethod(&#039;FLGrowth&#039;, signature(model=&#039;missing&#039;),<br />
 function(...)<br />
  return(FLModel(formula(NULL), ..., class=&#039;FLGrowth&#039;)))<br />
<br />
# example<br />
data(ple4)<br />
<br />
gro &lt;- FLGrowth(mass~(Minf*(1-exp(-k*(age-t0))))^3, mass=FLCohort(stock.wt(ple4)))<br />
<br />
gro &lt;- fmle(gro, start=list(Minf=7, k=0.3, t0=0), fixed=list(Minf=7))<br />
<br />]]></content:encoded>
  </item>
    <item rdf:about="http://flr-project.org/bugs/index.php?do=details&amp;task_id=30">
    <title>FS#30: FLCohort constructor not fully functional</title>
    <link>http://flr-project.org/bugs/index.php?do=details&amp;task_id=30</link>
    <dc:date>2010-07-30T08:33:01Z</dc:date>
    <dc:creator>Laurie Kell</dc:creator>
    <description>This works

FLQuant(0:20,dimnames=list(age=0:20,year=1980:2010))

so why not?

FLCohort(0:20,dimnames=list(age=0:20,cohort=1980:2010))

various other things missing from FLCohort</description>
    <content:encoded><![CDATA[This works<br />
<br />
FLQuant(0:20,dimnames=list(age=0:20,year=1980:2010))<br />
<br />
so why not?<br />
<br />
FLCohort(0:20,dimnames=list(age=0:20,cohort=1980:2010))<br />
<br />
various other things missing from FLCohort]]></content:encoded>
  </item>
    <item rdf:about="http://flr-project.org/bugs/index.php?do=details&amp;task_id=29">
    <title>FS#29: ple4[&quot;10&quot;]</title>
    <link>http://flr-project.org/bugs/index.php?do=details&amp;task_id=29</link>
    <dc:date>2010-07-27T09:31:57Z</dc:date>
    <dc:creator>Laurie Kell</dc:creator>
    <description>this works

ple4[10]

but this fails

ple4[ac(10)]</description>
    <content:encoded><![CDATA[this works<br />
<br />
ple4[10]<br />
<br />
but this fails<br />
<br />
ple4[ac(10)]<br />]]></content:encoded>
  </item>
    <item rdf:about="http://flr-project.org/bugs/index.php?do=details&amp;task_id=28">
    <title>FS#28: FLPar bugs</title>
    <link>http://flr-project.org/bugs/index.php?do=details&amp;task_id=28</link>
    <dc:date>2010-07-26T15:33:38Z</dc:date>
    <dc:creator>Laurie Kell</dc:creator>
    <description>#I´m using Version: 2.3-644 and I´m having problems with FLPar.

#These dont appear to work but will be required for many applications

FLPar(c(Linf=238.6,K=0.185,t0=-1.404),params=c(&amp;quot;Linf&amp;quot;,&amp;quot;K&amp;quot;,&amp;quot;t0&amp;quot;),unit=c(&amp;quot;male&amp;quot;,&amp;quot;female&amp;quot;),iter=1)
FLPar(c(Linf=238.6,K=0.185,t0=-1.404),params=c(&amp;quot;Linf&amp;quot;,&amp;quot;K&amp;quot;,&amp;quot;t0&amp;quot;),season=1:4,iter=1)
FLPar(c(Linf=238.6,K=0.185,t0=-1.404),params=c(&amp;quot;Linf&amp;quot;,&amp;quot;K&amp;quot;,&amp;quot;t0&amp;quot;),areas=1:2,iter=1)


#This works

params  &amp;lt;-FLPar(array(c(Linf=238.6,K=0.185,t0=-1.404),c(3,2,4,1),list(params=c(&amp;quot;Linf&amp;quot;,&amp;quot;K&amp;quot;,&amp;quot;t0&amp;quot;),unit=c(&amp;quot;male&amp;quot;,&amp;quot;female&amp;quot;),season=1:4,iter=1)))

## but show is wrong
params
params@.Data

## this doesn´t work
params[&amp;quot;Linf&amp;quot;,&amp;quot;male&amp;quot;,,]&amp;lt;-params[&amp;quot;Linf&amp;quot;,&amp;quot;female&amp;quot;,,]*.75

## this does
params@.Data[&amp;quot;Linf&amp;quot;,&amp;quot;male&amp;quot;,,]&amp;lt;-params@.Data[&amp;quot;Linf&amp;quot;,&amp;quot;female&amp;quot;,,]*.75</description>
    <content:encoded><![CDATA[#I´m using Version: 2.3-644 and I´m having problems with FLPar.<br />
<br />
#These dont appear to work but will be required for many applications<br />
<br />
FLPar(c(Linf=238.6,K=0.185,t0=-1.404),params=c(&quot;Linf&quot;,&quot;K&quot;,&quot;t0&quot;),unit=c(&quot;male&quot;,&quot;female&quot;),iter=1)<br />
FLPar(c(Linf=238.6,K=0.185,t0=-1.404),params=c(&quot;Linf&quot;,&quot;K&quot;,&quot;t0&quot;),season=1:4,iter=1)<br />
FLPar(c(Linf=238.6,K=0.185,t0=-1.404),params=c(&quot;Linf&quot;,&quot;K&quot;,&quot;t0&quot;),areas=1:2,iter=1)<br />
<br />
<br />
#This works<br />
<br />
params  &lt;-FLPar(array(c(Linf=238.6,K=0.185,t0=-1.404),c(3,2,4,1),list(params=c(&quot;Linf&quot;,&quot;K&quot;,&quot;t0&quot;),unit=c(&quot;male&quot;,&quot;female&quot;),season=1:4,iter=1)))<br />
<br />
## but show is wrong<br />
params<br />
params@.Data<br />
<br />
## this doesn´t work<br />
params[&quot;Linf&quot;,&quot;male&quot;,,]&lt;-params[&quot;Linf&quot;,&quot;female&quot;,,]*.75<br />
<br />
## this does<br />
params@.Data[&quot;Linf&quot;,&quot;male&quot;,,]&lt;-params@.Data[&quot;Linf&quot;,&quot;female&quot;,,]*.75<br />]]></content:encoded>
  </item>
    <item rdf:about="http://flr-project.org/bugs/index.php?do=details&amp;task_id=27">
    <title>FS#27: as.data.frame(FLQuant) doesn´t return the same as as.data.frame(FLQuant)</title>
    <link>http://flr-project.org/bugs/index.php?do=details&amp;task_id=27</link>
    <dc:date>2010-07-26T10:14:42Z</dc:date>
    <dc:creator>Laurie Kell</dc:creator>
    <description>as.data.frame(FLQuant) doesn´t return the same as as.data.frame(FLQuant) as in FLQuants the data.frame returns factors, can we make these the same.

 mapply(function(x,y) class(y[x]), x=names(t.),y=as.data.frame(m(ple4)))
      age      year      unit    season      area      iter      data     qname
&amp;quot;numeric&amp;quot; &amp;quot;numeric&amp;quot;  &amp;quot;factor&amp;quot;  &amp;quot;factor&amp;quot;  &amp;quot;factor&amp;quot;  &amp;quot;factor&amp;quot; &amp;quot;numeric&amp;quot; &amp;quot;numeric&amp;quot;

mapply(function(x,y) class(y[x]), x=names(t.),y=as.data.frame(FLQuants(m(ple4))))
        age        year        unit      season        area        iter        data       qname
   &amp;quot;factor&amp;quot;   &amp;quot;numeric&amp;quot;    &amp;quot;factor&amp;quot;    &amp;quot;factor&amp;quot;    &amp;quot;factor&amp;quot;    &amp;quot;factor&amp;quot;   &amp;quot;numeric&amp;quot; &amp;quot;character&amp;quot;


If they have to be factors can we also make sure that for ages as years teh order matches the numeric order

Laurie</description>
    <content:encoded><![CDATA[as.data.frame(FLQuant) doesn´t return the same as as.data.frame(FLQuant) as in FLQuants the data.frame returns factors, can we make these the same.<br />
<br />
 mapply(function(x,y) class(y[x]), x=names(t.),y=as.data.frame(m(ple4)))<br />
      age      year      unit    season      area      iter      data     qname<br />
&quot;numeric&quot; &quot;numeric&quot;  &quot;factor&quot;  &quot;factor&quot;  &quot;factor&quot;  &quot;factor&quot; &quot;numeric&quot; &quot;numeric&quot;<br />
<br />
mapply(function(x,y) class(y[x]), x=names(t.),y=as.data.frame(FLQuants(m(ple4))))<br />
        age        year        unit      season        area        iter        data       qname<br />
   &quot;factor&quot;   &quot;numeric&quot;    &quot;factor&quot;    &quot;factor&quot;    &quot;factor&quot;    &quot;factor&quot;   &quot;numeric&quot; &quot;character&quot;<br />
<br />
<br />
If they have to be factors can we also make sure that for ages as years teh order matches the numeric order<br />
<br />
Laurie]]></content:encoded>
  </item>
    <item rdf:about="http://flr-project.org/bugs/index.php?do=details&amp;task_id=26">
    <title>FS#26: using mcf loses names</title>
    <link>http://flr-project.org/bugs/index.php?do=details&amp;task_id=26</link>
    <dc:date>2010-03-13T10:02:41Z</dc:date>
    <dc:creator>Laurie Kell</dc:creator>
    <description>using mcf loses names

 head(as.data.frame(FLQuants(m=m(ple4))))
    age year   unit season   area iter data qname
m.1   1 1957 unique    all unique    1  0.1     m
m.2   2 1957 unique    all unique    1  0.1     m
m.3   3 1957 unique    all unique    1  0.1     m
m.4   4 1957 unique    all unique    1  0.1     m
m.5   5 1957 unique    all unique    1  0.1     m
m.6   6 1957 unique    all unique    1  0.1     m
&amp;gt; head(as.data.frame(mcf(FLQuants(m=m(ple4)))))
     age year   unit season   area iter data qname
NA.1   1 1957 unique    all unique    1  0.1  &amp;lt;NA&amp;gt;
NA.2   2 1957 unique    all unique    1  0.1  &amp;lt;NA&amp;gt;
NA.3   3 1957 unique    all unique    1  0.1  &amp;lt;NA&amp;gt;
NA.4   4 1957 unique    all unique    1  0.1  &amp;lt;NA&amp;gt;
NA.5   5 1957 unique    all unique    1  0.1  &amp;lt;NA&amp;gt;
NA.6   6 1957 unique    all unique    1  0.1  &amp;lt;NA&amp;gt;</description>
    <content:encoded><![CDATA[using mcf loses names<br />
<br />
 head(as.data.frame(FLQuants(m=m(ple4))))<br />
    age year   unit season   area iter data qname<br />
m.1   1 1957 unique    all unique    1  0.1     m<br />
m.2   2 1957 unique    all unique    1  0.1     m<br />
m.3   3 1957 unique    all unique    1  0.1     m<br />
m.4   4 1957 unique    all unique    1  0.1     m<br />
m.5   5 1957 unique    all unique    1  0.1     m<br />
m.6   6 1957 unique    all unique    1  0.1     m<br />
&gt; head(as.data.frame(mcf(FLQuants(m=m(ple4)))))<br />
     age year   unit season   area iter data qname<br />
NA.1   1 1957 unique    all unique    1  0.1  &lt;NA&gt;<br />
NA.2   2 1957 unique    all unique    1  0.1  &lt;NA&gt;<br />
NA.3   3 1957 unique    all unique    1  0.1  &lt;NA&gt;<br />
NA.4   4 1957 unique    all unique    1  0.1  &lt;NA&gt;<br />
NA.5   5 1957 unique    all unique    1  0.1  &lt;NA&gt;<br />
NA.6   6 1957 unique    all unique    1  0.1  &lt;NA&gt;]]></content:encoded>
  </item>
    <item rdf:about="http://flr-project.org/bugs/index.php?do=details&amp;task_id=25">
    <title>FS#25: FLCohort; bugs and missing bits</title>
    <link>http://flr-project.org/bugs/index.php?do=details&amp;task_id=25</link>
    <dc:date>2010-02-17T09:15:57Z</dc:date>
    <dc:creator>Laurie Kell</dc:creator>
    <description>There are a few bugs in FLCohort that make it difficult to use i.e.

#1) There is no creater
flc   &amp;lt;-FLCohort(NA,dimnames=list(age=1:10,year=1980:2000,iter=1:100))

      # You can get round this by creating an FLQuant first but that is not what you need if you want to create year-class structure
      # e.g. fast/slow growing cohorts
      flc    &amp;lt;-FLCohort(FLQuant(NA,dimnames=list(age=1:10,year=1980:2000,iter=1:100)))
 
#2) You can´t create an FLQuant from an FLCohort
flq    &amp;lt;-FLQuant(flc)

      #You can work around this by creating a data.frame first
      df     &amp;lt;-as.data.frame(flc)
      df$year&amp;lt;-df$cohort+df$age

#3) but even though you have all the required columns in te data.frame you can´t create the FLQuant
flq     &amp;lt;-as.FLQuant(df)

      # You have to remove the redundant column, I don´t see why this be so. The redundant data should be ignored
      flq     &amp;lt;-as.FLQuant(df[,-2])
 
#4) There is no corresponding as.FLCohort
flc     &amp;lt;-as.FLCohort(df[,-8])

#5) You can´t create a data.frame from an FLCohort
dfc&amp;lt;-data.frame(flc)


We can correct this by implementing the corresponding methods

Laurie</description>
    <content:encoded><![CDATA[There are a few bugs in FLCohort that make it difficult to use i.e.<br />
<br />
#1) There is no creater<br />
flc   &lt;-FLCohort(NA,dimnames=list(age=1:10,year=1980:2000,iter=1:100))<br />
<br />
      # You can get round this by creating an FLQuant first but that is not what you need if you want to create year-class structure<br />
      # e.g. fast/slow growing cohorts<br />
      flc    &lt;-FLCohort(FLQuant(NA,dimnames=list(age=1:10,year=1980:2000,iter=1:100)))<br />
 <br />
#2) You can´t create an FLQuant from an FLCohort<br />
flq    &lt;-FLQuant(flc)<br />
<br />
      #You can work around this by creating a data.frame first<br />
      df     &lt;-as.data.frame(flc)<br />
      df$year&lt;-df$cohort+df$age<br />
<br />
#3) but even though you have all the required columns in te data.frame you can´t create the FLQuant<br />
flq     &lt;-as.FLQuant(df)<br />
<br />
      # You have to remove the redundant column, I don´t see why this be so. The redundant data should be ignored<br />
      flq     &lt;-as.FLQuant(df[,-2])<br />
 <br />
#4) There is no corresponding as.FLCohort<br />
flc     &lt;-as.FLCohort(df[,-8])<br />
<br />
#5) You can´t create a data.frame from an FLCohort<br />
dfc&lt;-data.frame(flc)<br />
<br />
<br />
We can correct this by implementing the corresponding methods<br />
<br />
Laurie]]></content:encoded>
  </item>
    <item rdf:about="http://flr-project.org/bugs/index.php?do=details&amp;task_id=24">
    <title>FS#24: Changes to FLSR to make it more robust and consistent</title>
    <link>http://flr-project.org/bugs/index.php?do=details&amp;task_id=24</link>
    <dc:date>2009-12-23T09:28:27Z</dc:date>
    <dc:creator>Laurie Kell</dc:creator>
    <description>Changes to FLSR to make it more robust and consistent

     1) Change algorithm for setting initial values in BH
     2) Add limits to segreg to ensure breakpoint doesn´t fall outside of the data
     3) Calculate sigma from the residuals rather than fitting it as part of the likelihood
     4) Add auto parscaling
     5) Change all likelihoods to lognormal or at least put a option to choose
     6) Ensure residuals are on the log scale if a log normal error model is used.
     7) turn sv2ab and ab2sv into methods
     8) check that steepness &amp;amp; virgin biomass options work across all classes

1,2,3 and 4 then Beverton and Holt, Ricker and segmented regression SRRs can be fitted to the ICES stock database. Otherwise fits can fail which can cause problems in that
parameters are wrong especially for Monte Carlo simulations.

Problems are due to FLSR simply not being able to find the solution, there are several reasons for this, poor initial values, going off into parameter space with a flat likelihood, different scales for parameters

In some methods normal log likelihood is used while in other the log normal, e.g. in bevholt.ar1() it is the log normal as this is needed to deal with AR1 processes, but you can fixed rho to 0 and you then have a standard normal likelihood but this may differ from bevholt()

Diagnostic plots are on the untransformed scale even when the error model is lognormal, this is because residuals are not on the log scale, this means that the QQ plots are wrong, the residual plots misleading and difficult to interpret and that passing FLSR objects to other methods (e.g. fwd for projection) liable to error.

Most of these suggestions have been coded up and are in FLBocadillio, main task is to check them and add to FLCore</description>
    <content:encoded><![CDATA[Changes to FLSR to make it more robust and consistent<br />
<br />
     1) Change algorithm for setting initial values in BH<br />
     2) Add limits to segreg to ensure breakpoint doesn´t fall outside of the data<br />
     3) Calculate sigma from the residuals rather than fitting it as part of the likelihood<br />
     4) Add auto parscaling<br />
     5) Change all likelihoods to lognormal or at least put a option to choose<br />
     6) Ensure residuals are on the log scale if a log normal error model is used.<br />
     7) turn sv2ab and ab2sv into methods<br />
     8) check that steepness &amp; virgin biomass options work across all classes<br />
<br />
1,2,3 and 4 then Beverton and Holt, Ricker and segmented regression SRRs can be fitted to the ICES stock database. Otherwise fits can fail which can cause problems in that<br />
parameters are wrong especially for Monte Carlo simulations.<br />
<br />
Problems are due to FLSR simply not being able to find the solution, there are several reasons for this, poor initial values, going off into parameter space with a flat likelihood, different scales for parameters<br />
<br />
In some methods normal log likelihood is used while in other the log normal, e.g. in bevholt.ar1() it is the log normal as this is needed to deal with AR1 processes, but you can fixed rho to 0 and you then have a standard normal likelihood but this may differ from bevholt()<br />
<br />
Diagnostic plots are on the untransformed scale even when the error model is lognormal, this is because residuals are not on the log scale, this means that the QQ plots are wrong, the residual plots misleading and difficult to interpret and that passing FLSR objects to other methods (e.g. fwd for projection) liable to error.<br />
<br />
Most of these suggestions have been coded up and are in FLBocadillio, main task is to check them and add to FLCore]]></content:encoded>
  </item>
    <item rdf:about="http://flr-project.org/bugs/index.php?do=details&amp;task_id=23">
    <title>FS#23: Iters</title>
    <link>http://flr-project.org/bugs/index.php?do=details&amp;task_id=23</link>
    <dc:date>2009-10-30T17:43:10Z</dc:date>
    <dc:creator>Laurie Kell</dc:creator>
    <description>1) Secondary classes don´t always work correctly when mixing iters as 1 
or n, for example having landings.sel with n iters in FLBRP means that 
landings.n must also have n iters. I had major problems in fwd() when 
working with FLStocks, FLBiols, FLMetiers, FLFleets, FLCatches and FLSRs 
and so created some validation code, found in FLCoreVarCon.R. I think it 
would be worthwhile either adding this to FLCore or creating some 
protocols for use in secondary packages.

I therefore propose we look at FLCoreVarCon.R in FLBRP and add it to FLCore as a generic routine 
for use in secondary packages</description>
    <content:encoded><![CDATA[1) Secondary classes don´t always work correctly when mixing iters as 1 <br />
or n, for example having landings.sel with n iters in FLBRP means that <br />
landings.n must also have n iters. I had major problems in fwd() when <br />
working with FLStocks, FLBiols, FLMetiers, FLFleets, FLCatches and FLSRs <br />
and so created some validation code, found in FLCoreVarCon.R. I think it <br />
would be worthwhile either adding this to FLCore or creating some <br />
protocols for use in secondary packages.<br />
<br />
I therefore propose we look at FLCoreVarCon.R in FLBRP and add it to FLCore as a generic routine <br />
for use in secondary packages<br />]]></content:encoded>
  </item>
  </rdf:RDF>
