stan.multiply: Function to replicate multiplication in Stan

Description Usage Arguments Details Value Examples

Description

Function to replicate multiplication in Stan

Usage

1
x %stan*% y

Arguments

x

First term in product

y

Second term in product

Details

Accepts arguments x and y. If either is a singleton, returns the value of x*y (in R notation). If both arguments are matrices or vectors, returns x

Value

Returns an object of the same type as the base

Examples

1
2
3
4
5
6
7
8
X <- matrix(1:9, nrow = 3)
b <- c(4, 5, 6)

(3 + 2) * X %stan*% (5 * b)
#      [,1]
# [1,] 1650
# [2,] 2025
# [3,] 2400

tkmckenzie/ikde documentation built on May 13, 2019, 9:53 p.m.