obj_fun {mbr}R Documentation

Objective function from parameters

Description

This is a wrapper for lsq_mb(). It first calculates hat, then calls lsq_mb(). This is used in optim(), so it returns a scalar.

Usage

obj_fun(beta, X, Y, lambda, mus, sigmas, log.seasons, log.ann, N, sInd)

Arguments

beta

Parameters

X

Inputs, must have columns of 1 added

Y

Observed Dry, Wet, and Annual log-transformed flows

lambda

Penalty weight.

mus

A vector of means, one for each target.

sigmas

A vector of the standard deviations, one for each target.

log.seasons

A vector containing the indices of the seasons that are log-transformed.

log.ann

TRUE if the annual reconstruction is log-transformed.

N

The number of targets (number of seasons plus one for the annual reconstruction).

sInd

Indices of the seasons, i.e, 1...N-1

Value

Objective function value


[Package mbr version 0.0.1 Index]