polynomial_transformation: constructs a polynomial transformation for use with functions...

Description Usage Arguments Details Value Author(s) Examples

View source: R/CorrectedVarianceEstimators.R

Description

When we are dealing with a transformation of the latent Poisson mean Lambda, we need various useful functions. This function computes the necessary functions for a polynomial, and returns a list of the required functions.

Usage

1

Arguments

coeffs

A vector of coefficents of the polynomial. The constant term should not be included.

Details

The coefficients of the polynomial should be given in order of decreasing degree, and should not include the constant term. For example "coeffs"=c(1,2,3) refers to the polynomial X^3+2*X^2+3*X. This function returns a list of functions for dealing with this transformation.

Value

f

evaluates the transformation

g

an estimator for the transformation of a latent Poisson mean

solve

computes the inverse transformation (often used for simulations)

CVar

an estimator for the conditional variance of g(X)

Author(s)

Toby Kenney tkenney@mathstat.dal.ca and Tianshu Huang

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
cubic<-polynomial_transformation(c(1,0,0))

X<-rpois(100,1.8^3)

gX<-X
varX<-X
for(i in 1:100){
gX[i]<-cubic$g(X[i])
varX[i]<-cubic$CVar(X)
}
mean(gX)
var(gX)
mean(varX)

PoissonPCA documentation built on Aug. 17, 2021, 5:09 p.m.