w2n: Scaling function: working to natural parameters

Description Usage Arguments Value Examples

View source: R/w2n.R

Description

Scales each parameter from the set of real numbers, back to its natural interval. Used during the optimization of the log-likelihood.

Usage

1
w2n(wpar, bounds, parSize, nbStates, nbCovs, estAngleMean, stationary)

Arguments

wpar

Vector of state-dependent distributions unconstrained parameters.

bounds

Matrix with 2 columns and as many rows as there are elements in wpar. Each row contains the lower and upper bound for the correponding parameter.

parSize

Vector of two values: number of parameters of the step length distribution, number of parameters of the turning angle distribution.

nbStates

The number of states of the HMM.

nbCovs

The number of covariates.

estAngleMean

TRUE if the angle mean is estimated, FALSE otherwise.

stationary

FALSE if there are covariates. If TRUE, the initial distribution is considered equal to the stationary distribution. Default: FALSE.

Value

A list of:

stepPar

Matrix of natural parameters of the step length distribution

anglePar

Matrix of natural parameters of the turning angle distribution

beta

Matrix of regression coefficients of the transition probabilities

delta

Initial distribution

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
nbStates <- 3
nbCovs <- 2
par <- c(0.001,0.999,0.5,0.001,1500.3,7.1)
parSize <- c(1,1)
bounds <- matrix(c(0,1,0,1,0,1,
                   0,Inf,0,Inf,0,Inf),
                 byrow=TRUE,ncol=2)
beta <- matrix(rnorm(18),ncol=6,nrow=3)
delta <- c(0.6,0.3,0.1)
wpar <- n2w(par,bounds,beta,delta,nbStates,FALSE)
print(w2n(wpar,bounds,parSize,nbStates,nbCovs,estAngleMean=FALSE,stationary=FALSE))

## End(Not run)

TheoMichelot/moveHMM documentation built on Sept. 28, 2018, 11:06 a.m.