help mata runningprod()-------------------------------------------------------------------------------

Title

runningprod()-- Running product of vector

Syntax

numeric vectorrunningprod(numeric vector x[,missing])where optional argument

missingis areal scalarthat determines how missing values inxare treated.

Description

runningprod(x)returns a vector of the same dimension asxcontaining the running product ofx. By default, missing values turn the product to missing.

RemarksThe running product of (2, 4, 6) is (2, 8, 48).

All functions return the same type as the argument, real if argument is real, complex if complex.

Conformability

runningprod(x,missing):x:r x1 or 1xcmissing: 1x1 (optional)result:r x1 or 1xc

DiagnosticsIf

missingis not specified, missing values turn the product to missing. Specifyingmissingas 1 specifies that missing values inxare to be treated as 1, and so on.

We would like to thank Nick Cox for his useful advicesAuthorFederico Belotti Faculty of Economics Department of Financial and Quantitative Economics Tor Vergata University federico.belotti@uniroma2.it

Silvio Daidone Health Policy team Centre for Health Economics The University of York

Also seeManual:

[M-5] runningsum()Help:

[M-5] sum();[M-4] mathematical,[M-4] utility