likelihood.seqtoone_normal {BayesFluxR}R Documentation

Use a Normal likelihood for a seq-to-one recurrent network


This creates a likelihood of the form

y_i \sim Normal(net(x_i), \sigma), i=1,...,N

Here x_i is a subsequence which will be fed through the recurrent network to obtain the final output net(x_i) = \hat{y}_i. Thus, if one has a single time series, and splits the single time series into subsequences of length K which are then used to predict the next output of the time series, then each x_i consists of K consecutive observations of the time series. In a sense one constraints the maximum memory length of the network this way.


likelihood.seqtoone_normal(chain, sig_prior)



Network structure obtained using link{Chain}


A prior distribution for sigma defined using Gamma, link{InverGamma}, Truncated, Normal


see likelihood.feedforward_normal


## Not run: 
  ## Needs previous call to `BayesFluxR_setup` which is time
  ## consuming and requires Julia and BayesFlux.jl
  BayesFluxR_setup(installJulia=TRUE, seed=123)
  net <- Chain(RNN(5, 1))
  like <- likelihood.seqtoone_normal(net, Gamma(2.0, 0.5))
  prior <- prior.gaussian(net, 0.5)
  init <- initialise.allsame(Normal(0, 0.5), like, prior)
  x <- array(rnorm(5*100*10), dim=c(10,5,100))
  y <- rnorm(100)
  bnn <- BNN(x, y, like, prior, init)

## End(Not run)

[Package BayesFluxR version 0.1.3 Index]