Learn R Programming

vdg (version 1.1.3)

meanspv: Compute Mean Spherical SPV

Description

Computes the matrix of spherical region moments for a given model formula and a vector of radii, and uses this to calculate the mean spherical SPV for each of the radii. The function expmat calculates the matrix containing the exponents of each model factor within each model term as columns. Only simple formulae are allowed for. Only products of terms should be included in calls to I. The power operator ^ should be used instead of sqrt. Models should contain only monomial terms.

Usage

meanspv(formula, radii, FtF.inv, n)
expmat(formula)

Arguments

formula
model formula
radii
numeric vector or radii at which to calculate the matrix of spherical region moments
FtF.inv
inverse of F'F, where F is the design matrix
n
integer giving the number of design runs

Examples

Run this code
f1 <- formula(~ x1*x2)
expmat(f1)
f2 <- update(f1, ~ . + I(x1^2) + I(x2^2))
expmat(f2)
f3 <- update(f2, ~ . + I(x2^0.4))
expmat(f3)
f4 <- update(f3, ~ . + I(x1^2):I(x2^2))
expmat(f4)
f5 <- update(f4, ~ . + I(x1^3*x2^0.5))
expmat(f5)

Run the code above in your browser using DataLab