Learn R Programming

sgdGMF (version 1.0)

simulate.sgdgmf: Simulate method for GMF models

Description

Simulate new data from a fitted generalized matrix factorization models

Usage

# S3 method for sgdgmf
simulate(object, ..., nsim = 1)

Value

An 3-fold array containing the simulated data.

Arguments

object

an object of class sgdgmf

...

further arguments passed to or from other methods

nsim

number of samples

Examples

Run this code
# Load the sgdGMF package
library(sgdGMF)

# Generate data from a Poisson model
data = sim.gmf.data(n = 100, m = 20, ncomp = 5, family = poisson())

# Fit a GMF model
gmf = sgdgmf.fit(data$Y, ncomp = 3, family = poisson())

# Simulate new data from a GMF model
str(simulate(gmf))

Run the code above in your browser using DataLab