ssEst {BayesMassBal} | R Documentation |
Steady State Estimate
Description
Allows for the estimation of process steady state of a single stream for a process using flow rate data.
Usage
ssEst(y, BTE = c(100, 1000, 1), stationary = FALSE)
Arguments
y |
Vector of mass flow rate observations. Must be specified sequentially with |
BTE |
Numeric vector giving |
stationary |
Logical indicating if stationarity will be imposed when generating posterior draws. See Details. |
Details
The model of the following form is fit to the data:
Where and
indexes the time step.
A time series is stationary, and predictable, when . Stationarity can be enforced, using the argument setting
stationary = TRUE
. This setting utilizes the priors (0, 1000) truncated at (-1,1), and
(0,
var(y)*100
) for inference, producing a posterior distribution for constrained to be within (-1,1).
When fitting a model where stationarity is not enforced, the Jeffreys prior of is used.
The Jeffreys prior of is used for all inference of
A stationary time series will have an expected value of:
Samples of this expectation are included in the output if stationary = TRUE
or if none of the samples of lie outside of (-1,1).
The output list is a BMB
object, passing the output to plot.BayesMassBal
allows for observation of the results.
Value
Returns a list of outputs
samples |
List of vectors containing posterior draws of model parameters |
stationary |
Logical indicating the setting of the |
y |
Vector of observations initially passed to the |
type |
Character string giving details of the model fit. Primarily included for use with |
Examples
## Generating Data
y <- rep(NA, times = 21)
y[1] <- 0
mu <- 3
alpha <- 0.3
sig <- 2
for(i in 2:21){
y[i] <- mu + alpha*y[i-1] + rnorm(1)*sig
}
## Generating draws of model parameters
fit <- ssEst(y, BTE = c(100,500,1))