Description Usage Arguments Value Author(s) See Also Examples
View source: R/simulateNetwork.R
This function generates a random network with structure changepoints (or takes one as input) and simulated data from it using a regression model.
1 2 3 4 |
l |
Length of the time series. |
min_phase_length |
Minimum segment length. |
k_bar |
Maximum number of changepoints. |
q |
Number of nodes. |
lambda_2 |
Average number of parents for each node in the network (parameter for a Poisson distribution). |
noise |
Standard deviation of the Gaussian observation noise. Can be constant, or segment specific (in which case the number of changepoints needs to be fixed and the noise needs to be a vector of the same length). |
net |
Input network, can be |
lambda_3 |
Average number of structure changes between two segments (parameter for a Poisson distribution). |
spacing |
|
gauss_weights |
|
same |
|
changes |
|
fixed |
|
cps |
Changepoint locations (if they are fixed). |
saveFile |
If not |
A list with elements:
sim_data |
A matrix of length NumNodes by NumTimepoints containing the simulated data from the regression model. |
epsilon |
Changepoint vector. |
k |
Number of changepoints. |
network |
The network, a list of length NumSegs, where each element is a NumNodes by NumNodes matrix. |
noise |
The standard deviation of the applied Gaussian noise. |
Frank Dondelinger
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Generate random network and simulate data with default parameters
dataset = simulateNetwork()
# Generate random network and simulate data with an average of
# 1 change per node among network segments
dataset = simulateNetwork(lambda_3=1)
# Generate random network and simulate data with an average of
# 1 change per node among network segments and standard deviation
# of the Gaussian observation noise 0.5
dataset = simulateNetwork(lambda_3=1, noise=0.5)
# Generate random network with default parameters
network = generateNetwork()
# Simulate data using generated network
dataset = simulateNetwork(net=network)
# Generate random network with 4 changepoints and 15 nodes,
# with changepoints distributed over a timeseries of length 50
network = generateNetwork(l=50, q=15, fixed=TRUE, k_bar=4)
# Simulate data of length 50 using generated network
dataset = simulateNetwork(net=network)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.