createSimuData: Simulate aggregated data

Description Usage Arguments Value Examples

View source: R/simuFunctions.R

Description

Simulate aggregated data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
createSimuData(
  B1 = 4,
  B2 = 6,
  nRep = 20,
  market = NULL,
  market_range = 5:25,
  sigPar = 1/c(2, 2, 2, 4, 4, 4),
  tauPar = rep(0, 6),
  corPar = 1/c(4, 4, 4, 6, 6, 6),
  nu1 = NULL,
  nu2 = NULL,
  tmp_bt1 = NULL,
  tmp_bt2 = NULL,
  beta1 = 0,
  beta2 = 0,
  seed = NULL,
  tempPar = 0
)

Arguments

B1

Number of groups from cluster 1

B2

Number of groups from cluster 2

nRep

Number of replicates

market

Optional. Insert the market as a data frame with the columns 'group', 'type' and 'num'

market_range

If market not inserted, the range to be sampled

sigPar

Parameters of sigma: vector of length 3

tauPar

Parameters of tau: vector of length 3

corPar

Parameters of correlation: vector of length 3

nu1

Functional of variance for cluster 1 (must be of length N)

nu2

Functional of variance for cluster 2 (must be of length N)

tmp_bt1

Beta parameters for winter temperature simulation. Must be of size 5*J*nRep. If NULL, rnorm(5*J*nRep,sd=2) will be used

tmp_bt2

Beta parameters for summer temperature simulation. Must be of size 5*J*nRep. If NULL, rnorm(5*J*nRep,sd=2) will be used

seed

Optional. Seed to be used for simulation

tempPar

Default:1. If you do not want temperature effect, set temPar=0

Value

Return a data frame with nRep replicates and 3 types of consumer observed in 48 times. Parameters and market are returned as attributes.

Examples

1
2
dd = createSimuData()
dd = createSimuData(B1=4, B2=8)

gabrielfranco89/aggrmodel documentation built on June 1, 2020, 8:57 a.m.