Description Usage Arguments Value References Examples
Fit a Probit Tensor Factorization Model
1 2 |
X |
response data, which is a three-way array of size n by n by k |
k |
number of relations |
n |
number of entities |
r |
decomposition rank |
max_iter |
max number of iterations |
tol |
tolerance of absolute change in likelihood |
tol_M |
tolerance of absolute change in the M step |
iter_M_max |
max number of iterations for M step |
print_option |
whether print loss for each iteration or not |
fitted parameters
@references Ye Liu, 2021. Computational Methods for Complex Models with Latent Structure. PhD thesis with link at https://repository.lib.ncsu.edu/bitstream/handle/1840.20/37507/etd.pdf?sequence=1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | n <- 20
k <- 10
r <- 3
p <- c(n, n, k)
X <- array(rnorm(prod(p)),dim=p)
X_binary <- ifelse(X < -1.5,1,0)
X_binary_with_missing <- X_binary
num_missing <- 200
missing_index <- data.frame(x1=sample(1:n,num_missing,replace=TRUE),
x2=sample(1:n,num_missing,replace=TRUE),
x3=sample(1:k,num_missing,replace=TRUE))
for(i in 1:num_missing){
X_binary[missing_index[i,1],
missing_index[i,2],
missing_index[i,3]] <- NA
}
result <- ptf(X_binary_with_missing,k,n,r,print_option=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.