Learn R Programming

Rlda (version 0.2.6)

predict: Provide predictions to the Binomial entry.

Description

Takes a rlda object produced by rlda.binomial and produces a prediction from it.

Usage

# S3 method for rlda
predict(object, data, nclus=NA, burnin=0.1, places.round=0, ...)

Arguments

object

a rlda object as produced by rlda.binomial

data

Dataset used to make the predictions. Must have the same number of columns as the dataset used in the rlda.binomial.

nclus

Number of clusters to be used in the prediction. The default value is nclus=NA

burnin

a percentual of burn-in observations must be a number between 0 and 1. The default value is burnin=0.1

places.round

Number decimal places tob rounded. The default value is places.round=0

...

other arguments may be useful.

Details

Predicts the Gibbs Samping results and arguments.

See Also

rlda.binomial, rlda.bernoulli,rlda.multinomial

Examples

Run this code
# NOT RUN {
		library(Rlda)
		# Read the SP500 data
		data(sp500)
		# Create size
		spSize <- as.data.frame(matrix(100,
							  ncol = ncol(sp500),
							  nrow = nrow(sp500)))
		# Set seed
		set.seed(5874)
		# Hyperparameters for each prior distribution
		gamma  <- 0.01
		alpha0 <- 0.01
		alpha1 <- 0.01
		# Execute the LDA for the Binomial entry
		res <- rlda.binomial(data = sp500, pop = spSize, n_community = 10,
		alpha0 = alpha0, alpha1 = alpha1, gamma = gamma,
		n_gibbs = 500, ll_prior = TRUE, display_progress = TRUE)
		#Predict
		pred<- predict(res, sp500, nclus=3)
  
# }

Run the code above in your browser using DataLab