Learn R Programming

loose.rock (version 1.2.0)

gen.synth.xdata: Generate xdata matrix with pre-determined covariance

Description

Covariance matrix is created using for each position cov.matrix[i,j] = rho^|i-j|

Usage

gen.synth.xdata(n.obs, n.vars, rho, my.mean = rep(0, n.vars))

Arguments

n.obs

number of observations

n.vars

number of variables

rho

value used to calculate rho^|i-j| . values between 1 and 0

my.mean

vector of mean variables

Value

a matrix of xdata

Examples

Run this code
# NOT RUN {
gen.synth.xdata(100, 8, .75)
gen.synth.xdata(1000, 5, .2)
cov(gen.synth.xdata(n.obs = 10, n.vars = 10, rho = .2))
# }

Run the code above in your browser using DataLab