Learn R Programming

⚠️There's a newer version (0.1.1) of this package.Take me there.

metafolio (version 0.1.0)

Metapopulation simulations for conserving salmon through portfolio optimization

Description

The metafolio R package is a tool to simulate salmon metapopulations and apply financial portfolio optimization concepts. The package accompanies the paper 'Portfolio conservation of metapopulations under climate change'. See citation("metafolio").

Copy Link

Version

Install

install.packages('metafolio')

Monthly Downloads

764

Version

0.1.0

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

July 10th, 2014

Functions in metafolio (0.1.0)

get_quantile_contour

Get quantile contour
plot_efficient_portfolios

Basic plot of efficient portfolio and asset contributions
plot_rickers

Plot sample Ricker curves for each stock
meta_sim

Run a single metapopulation simulation.
get_port_vals

Get portfolio mean and variance values
thermal_curve_a

Create thermal tolerance curves.
my.axis

Add a pretty axis
CVaR

Conditional Value at Risk
optim_thermal

Optimize to find optimal max productivity Ricker a
get_efficient_frontier

Get the efficient frontier from mean and variance values
metafolio

metafolio: An R package to simulate metapopulations for portfolio optimization
run_cons_plans

Run conservation plans and return the portfolio mean and variance values
gg_color_hue

ggplot2-like colour scale in HCL space
is_quasi_ext

Return whether there was an instance of quasi extinction
create_asset_weights

Create an asset weights matrix
impl_error

Add implementation error
fit_ricker

Fit Ricker linear regression
thermal_area

Return desired squared deviation between desired area and actual area under a curve
generate_straying_matrix

Generate a matrix of straying proportions within a metapopulation
plot_correlation_between_returns

Plot correlation of returns (i.e. metapopulation abundance) across stocks.
VaR

Value at Risk
fastlm

Super fast linear regression
annotate

Add annotations to panel
get_conserv_plans_mv

Run simulation for conservation schemes
ricker

A simple Ricker model
metasim_base

Base-level metapopulation simulation function
est_beta_params

Get beta parameters from mean and variance
ricker_v_t

Ricker stock-recruit function with specified error
thermal_integration

Integrate thermal tolerance curves to get maximum Ricker a values
add_dens_polygon

Add a kernel density polygon
generate_env_ts

Create an environmental time series.
is_element

Check if x is an element of y.
count_quasi_exts

Take meta_sim output objects and count quasi extinctions
plot_sim_ts

Plot various time series from a simulation run
ricker_escapement

Assign a salmon escapement target based on a Ricker curve
monte_carlo_portfolios

Monte Carlo asset weights into portfolios
custom_bw

Custom bandwidth
plot_panel_lines

Standard matrix plot of values by stream for one panel:
plot_cons_plans

Plot conservation plans in mean-variance space
plot_sp_A_ts

Plot sample time series from a portfolio simulation