pw2pn: pw2pn

Description Usage Arguments Value Examples

View source: R/pw2pn.R

Description

Transforming working parameters to natural parameters. Not intended to be run by the user (internal function, called by the functions nLogLike and fitMod).

Usage

1
pw2pn(N,parvect,stationary,sup)

Arguments

N

Integer, number of states.

parvect

Vector of working parameters.

stationary

Logical, determines whether the initial distribution of the Markov chain underlying the observed counts is the stationary distribution.

sup

Integer, determines the upper bound of the support of the state-dependent distributions.

Value

A list of natural parameters.

Examples

1
2
3
4
5
# transforming natural parameters to working paramters
parvect = pn2pw(N=2,probs=cbind(dpois(x=0:41,lambda=14),dpois(x=0:41,lambda=26)),
gamma=matrix(c(0.95,0.05,0.05,0.95),ncol=2),delta=NULL,stationary=TRUE)
# transforming working parameters to natural parameters
pw2pn(N=2,parvect=parvect,stationary=TRUE,sup=41)

Example output

$probs
              [,1]         [,2]
 [1,] 8.315287e-07 5.121200e-12
 [2,] 1.164140e-05 1.331512e-10
 [3,] 8.148981e-05 1.730966e-09
 [4,] 3.802858e-04 1.500170e-08
 [5,] 1.331000e-03 9.751106e-08
 [6,] 3.726801e-03 5.070575e-07
 [7,] 8.695869e-03 2.197249e-06
 [8,] 1.739174e-02 8.161211e-06
 [9,] 3.043554e-02 2.652394e-05
[10,] 4.734417e-02 7.662471e-05
[11,] 6.628184e-02 1.992242e-04
[12,] 8.435871e-02 4.708936e-04
[13,] 9.841849e-02 1.020270e-03
[14,] 1.059891e-01 2.040539e-03
[15,] 1.059891e-01 3.789573e-03
[16,] 9.892320e-02 6.568593e-03
[17,] 8.655780e-02 1.067396e-02
[18,] 7.128290e-02 1.632488e-02
[19,] 5.544225e-02 2.358039e-02
[20,] 4.085219e-02 3.226790e-02
[21,] 2.859653e-02 4.194827e-02
[22,] 1.906435e-02 5.193595e-02
[23,] 1.213186e-02 6.137885e-02
[24,] 7.384611e-03 6.938479e-02
[25,] 4.307690e-03 7.516686e-02
[26,] 2.412306e-03 7.817353e-02
[27,] 1.298934e-03 7.817353e-02
[28,] 6.735214e-04 7.527822e-02
[29,] 3.367607e-04 6.990120e-02
[30,] 1.625741e-04 6.267004e-02
[31,] 7.586793e-05 5.431404e-02
[32,] 3.426294e-05 4.555371e-02
[33,] 1.499004e-05 3.701239e-02
[34,] 6.359409e-06 2.916128e-02
[35,] 2.618580e-06 2.229980e-02
[36,] 1.047432e-06 1.656556e-02
[37,] 4.073347e-07 1.196402e-02
[38,] 1.541266e-07 8.407149e-03
[39,] 5.678350e-08 5.752260e-03
[40,] 2.038382e-08 3.834840e-03
[41,] 7.134337e-09 2.492646e-03
[42,] 2.436115e-09 1.580702e-03

$gamma
     [,1] [,2]
[1,] 0.95 0.05
[2,] 0.05 0.95

$delta
[1] 0.5 0.5

countHMM documentation built on May 2, 2019, 1:06 p.m.

Related to pw2pn in countHMM...