Giter Site home page Giter Site logo

spict's People

Contributors

alko989 avatar arni-magnusson avatar casperwberg avatar kaskr avatar mawp avatar tokami avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spict's Issues

plot(fit)

I just have a couple of suggestions for the function plot(fit)

Bottom-center panel: neither label tells me what biological pattern this is. Is it the seasonal production curve? As a novice user, I'm trying to check if the timing is right (Jan-Jan) based on my biological knowledge of the stock.

Center top and middle panel: both contain Ft/Fmsy. This seems like a waste of space/ink

Add more example data sets

It would be helpful to have example data sets with seasonal data, effort data, regime shifts, and time varying growth.

no likprof from fit.spict()

Function fit.spict() does not return result regarding likelihood profiles (likprof). The latter is needed from function likprof.spict().

current catch scenario

  • Should current catch scenario use observed or predicted catch observations?
  • Should current catch scenario use seasonal catches if available?

ERROR - Fitting issue

I've just updated my SPiCT version to the 1.2.8 and now my script is not working anymore.
When trying the line to fit (fit.spict) I obtained:
res <- fit.spict(inp)
Error in TMB::MakeADFun(data = datin, parameters = pl, random = inp$RE, :
Error when reading the variable: 'prioriqgamma'. Please check data and parameters.
In addition: Warning message:
In TMB::MakeADFun(data = datin, parameters = pl, random = inp$RE, :
Expected object. Got NULL.
Any idea please?

predictlogB function not returning expected value

https://github.com/mawp/spict/blob/befb52bb91daafa73a397d4f87c147d7323194e9/spict/src/spict.cpp#L27

Assuming:

B0 = 1/2
K = 1
m = 1/2
F = 0
dt = 1/2
sdb = 0
n = 2
gamma = n^(n/(n-1)) / (n-1) = 4

The function on line 27 evaluates to: -0.1931472 for log biomass 1/2 a time unit later.

The Fletcher form is here

dB/dt = gamma * m * B/K - gamma * m * (B/K)^n
= 2 * B - 2 * B^2

analytically integrates to

B(t) = exp(2 * t) / (c + exp(2 * t))

where

c = 1 / B0 - 1 = 1

For t = 1/2

B(1/2) = exp(1) / (1 + exp(1)) = 0.7310586

and

log(B(1/2)) = log(0.7310586) = -0.3132617

which differs from the function provided.

Compile failing for master with gcc 4.8.4

I am trying to install from github using

devtools::install_github("mawp/spict", subdir="spict")

using both CRAN's or github's version of TMB. I am getting messages about no matching call for ceil(). among others (see attached file)
install.txt

Trued with both gcc 4.8.4 (Ubuntu 14.04) and 4.9.2 (Ubuntu 16.04). Windows users with gcc 4.6.3 in Rtools appear to be able to compile it.

Bug in pred.catch

The line in the pred.catch function:
Flast <- get.par('logF', repin, exp=TRUE)[repin$inp$indpred[1], 2]
does not correct for seasonality. It should say:
Flast <- get.par('logFnotS', repin, exp=TRUE)[repin$inp$indpred[1], 2]

issue when installing SPiCT in Windows10

Hi there,

I had my computer back from new installation of windows10 software..
Since, no way I can install SPiCT with devtools or remotes command, nor with the unzipped folder...
I always have or an issue like this:

remotes::install_github("DTUAqua/spict/spict", ref = "5ae1381109890")
Erreur : Failed to install 'unknown package' from GitHub:
Timeout was reached: [api.github.com] Connection timed out after 10001 milliseconds

OR:

setwd("C:/Users/larivain/Desktop/spict-master")
source("install_windows.R")
Warning message:
In shell("make install") :
l'exécution de 'make install' a échoué avec le code d'erreur 2

Any idea please?
I have TMB and Rtools updated!

Thank you ..

`sumspict.priors` shows wrong mean, std of priors

... if they are set after check.inp.

This produces the wrong result:

library(spict)
inp <- pol$albacore
inp <- check.inp(inp)
inp$priors$logbkfrac <- c(log(1), 0.3, 1)
fit <- fit.spict(inp)
sumspict.priors(fit)
#                     mean std
# logn           0.6931472 2.0
# logalpha       0.0000000 2.0
# logbeta        0.0000000 2.0
# logbkfrac     -9.2103404 0.2 

Whereas this works as it should:

library(spict)
inp <- pol$albacore
inp$priors$logbkfrac <- c(log(1), 0.3, 1)
inp <- check.inp(inp)
fit <- fit.spict(inp)
sumspict.priors(fit)
#                    mean std
# logbkfrac     0.0000000 0.3
# logn          0.6931472 2.0
# logalpha      0.0000000 2.0
# logbeta       0.0000000 2.0

(help needed) More than 1 indice (LPUE) to analyse - Error MakeADFun for robust options

Hi again,
Now back to 1.2.7 version I am able to fit a 'simple case', which is a list with catch and one indice (thank you!)
BUT again a MakeADFun error (different this time) when trying what was working before in previous version of SPiCT, when inputing a list of indices (for example I am trying to fit a model for english channel's cuttlefish with LPUE series from french commercial boats & 2 LPUE series from UK, in october and november...).
Please have a look and if you can tell me how to fix it (or I definitely have an issue with the package):

fit.7de <- fit.spict(res.7de)
Error in TMB::MakeADFun(data = datin, parameters = pl, random = inp$RE, :
Error when reading the variable: 'robflagi'. Please check data and parameters.
In addition: Warning message:
In TMB::MakeADFun(data = datin, parameters = pl, random = inp$RE, :
Expected scalar. Got length=3

When checking all in your page, I found somathing about robust options:

res.7de$robflagi
[1] 0 0 0

Many thks

Correct git SHA code for local installations

When spict is installed from github using devtools, the GithubSHA1 in the DESCRIPTION is updated and shows the actual commit of the installed version.

For local installations with the Makefile, the GithubSHA1 that is in the DESCRIPTION file is the one from the one-before-last commit.

Possible solution
In get.version there should be a check if the installation is local/github/CRAN and show the version using:

  • local (mostly relevant for developing): git describe HEAD --tags | rev | sed 's/g-/./' | sed 's/-/+/' | rev
  • github: GithubSHA1 field in DESCRIPTION
  • CRAN: version number + "(CRAN)"

Forecast manage() error if inp$robflagc specified

Hello. I'm trying to build management scenarious for forecast following next approach:

data <- read.csv("input/data.csv")
# build data object to spict format
inp <- data %>%
  add_column(timeI = data$year) %>%
  rename(timeC = year, obsI = cpue, obsC = c) %>%
  as.list(.)
inp$robflagc = 1 # reduce extreme catch variations as noted in vignette 
inp <- check.inp(inp)
fit <- fit.spict(inp)
mng <- manage(fit)

and this code throw an error:

Error in optimHess(par.fixed, obj$fn, obj$gr) : 
  gradient in optim evaluated to length 1 not 10

The error happens only if robflagc=1 sets. Hope you have a time to fix it in future.

Error with plotspict.retro() function

Hi,

I have an error:
need finite 'ylim' values
when I try to do a plot with plotspict.retro() function.
My code:

# Retrospective Plots
    output$retro<- renderPlot({
      # Take dependency on action button
      if(input$runspict == 0) return()
      isolate({
        rep <- spict()
        retros <- retro(rep)
        if(!is.null(retros)){
          plotspict.retro(retros)
        }
      })
    })

Look forward for some tips.

Cheers !
George

plotspict.osar has wrong plot title

When multiple indices are used the plotspict.osar plots all indices but has title "Index 1 Bias p-val: x.xxx".

It should be "Index Bias p-val: x.xxx, y.yyy, z.zzz" with red/green colored values.

Maybe when called by plot.spictcls it should not have the info on bias.

Check that stdevfac* have mean 1

When a user scales the uncertainty of different time series, check.inp should check if stddevfac* vectors have mean of 1 and if not scale them (with a warning).

check.ini should be more user friendly

The results of check.ini should be directly easy to interpret.

One option is only to show the data.frame with the converged estimates so the user can directly see if there are differences.

Or it should return TRUE if the estimates are almost equal.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.