Take a k-order polynomial approximation of a multivariate \(\phi(xi,xj)\) where both xi and xj are vectors of length l. This expansion involves l pairwise polynomial expansions using polyexp(). The expansion excludes terms that are solely in the first variable term because coefficients on them are not identified.

polyexp_mul(xi, xj, k)

Arguments

xi

vector of first variable terms

xj

vector of second variable terms

k

order of polynomial approximation

Value

vector of length \(l*k(k+1)/2\)

Examples

set.seed(2); xi=stats::runif(3); xj=stats::runif(3); polyexp_mul(xi,xj,2)
#> [1] 0.16805192 0.02824145 0.03106982 0.94383934 0.89083270 0.66292825 0.94347496 #> [8] 0.89014500 0.54091904