gadget_likelihood_component: Gadget likelihood components

Description Usage Arguments Details Examples

Description

Structures representing a component of a GADGET likelihood file.

Usage

1

Arguments

type

Type of group to create. One of penalty, understocking, catchstatistics, catchdistribution, stockdistribution.

...

Extra parameters for the group. See details.

Details

The arguments you can supply will depend on the the component you are creating. All will understand the following

name

A descriptive name for the component

weight

A numeric weighting

In addition, penalty understands:

data

A data.frame with 2 columns, "switch" and "power"

catchstatistics understands:

data_function

The function Gadget should use, by default guesses based on the function that generated data

data

A data.frame probably generated by mfdb_sample_meanlength_stddev

area

An mfdb_group of areas, taken from attr(data, "area") if not supplied

age

An mfdb_group of ages, taken from attr(data, "age") if not supplied

fleetnames

List of fleet names

stocknames

List of stock names

catchdistribution understands:

data_function

The function Gadget should use, by default uses sumofsquares

data_function_params

Extra parameters to supply to gadget, based on the function

aggregationlevel

TRUE or FALSE, defaults to FALSE

overconsumption

TRUE or FALSE, defaults to FALSE

epsilon

Numeric, defaults to 10

data

A data.frame probably generated by mfdb_sample_meanlength_stddev

area

An mfdb_group of areas, taken from attr(data, "area") if not supplied

age

An mfdb_group of ages, taken from attr(data, "age") if not supplied

length

An mfdb_group of lengths, taken from attr(data, "length") if not supplied

fleetnames

List of fleet names

stocknames

List of stock names

stockdistribution understands:

data_function

The function Gadget should use, by default uses sumofsquares

overconsumption

TRUE or FALSE, defaults to FALSE

epsilon

Numeric, defaults to 10

data

A data.frame probably generated by mfdb_sample_meanlength_stddev

area

An mfdb_group of areas, taken from attr(data, "area") if not supplied

age

An mfdb_group of ages, taken from attr(data, "age") if not supplied

length

An mfdb_group of lengths, taken from attr(data, "length") if not supplied

fleetnames

List of fleet names

stocknames

List of stock names

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Any example could be added to a file with the following:-
## Not run: 
gd <- gadget_directory('./out')
gadget_dir_write(gd, component)

## End(Not run)

# Create a penalty component
gadget_likelihood_component("penalty",
        name = "bounds",
        weight = "0.5",
        data = data.frame(
            switch = c("default"),
            power = c(2),
            stringsAsFactors = FALSE))

# Create an understocking component
gadget_likelihood_component("understocking", name ="understock")

sCervino/mfdb documentation built on May 18, 2019, 1:31 p.m.