pc2p0: Computation of starting points of curves of the field

View source: R/field_common.R

pc2p0R Documentation

Computation of starting points of curves of the field

Description

Given the output of DeltaB2pc_cat3logit() or DeltaB2pc_ord3logit(), the coordinates of points on the edge are computed for each curve of the field of points given in input.

Usage

pc2p0(pc, DeltaB, edge = 0.01, flink)

pc2p0_single(pc, DeltaB, w, edge, flink)

Arguments

pc

list of ternary coordinates, as returned by DeltaB2pc_cat3logit() or DeltaB2pc_ord3logit(). Function pc2p0_single accepts only a single point (that is a numeric vector of length three).

DeltaB

either a matrix Δ^TB\in\textbf{R}^{1\times 2} or a vector of length 2, if the model is categorical; otherwise a matrix Δ^TB\in\textbf{R}^{1\times 1} or a numeric, if the model is ordinal.

edge

width of the border of the ternary plot.

flink

named list of two functions: linkfun and linkinv. The former is the link function, whereas the latter is its inverse.

Value

A named list with two components:

status

a character always equal to "p0" (see section Value of DeltaB2pc()).

pp

a list of ternary coordinates.

Examples

library(magrittr)
# For the categorical logit model
depoDeltaB <- c(0.05, 0.08)
plot3logit:::DeltaB2pc_cat3logit(depoDeltaB) %>%
  plot3logit:::pc2p0(depoDeltaB, flink = list(
    linkfun = plot3logit:::linkfun_cat3logit,
    linkinv = plot3logit:::linkinv_cat3logit))

# For the ordinal logit model
depoDeltaB <- 0.08
depoalpha <- c(-0.4, 0.4)
plot3logit:::DeltaB2pc_ord3logit(depoDeltaB, depoalpha) %>%
  plot3logit:::pc2p0(depoDeltaB, flink = list(
    linkfun = function(x) plot3logit:::linkfun_ord3logit(x, depoalpha),
    linkinv = function(x) plot3logit:::linkinv_ord3logit(x, depoalpha)))


plot3logit documentation built on July 19, 2022, 9:07 a.m.