datagenNoml: Data Generating Function

Description Usage Arguments Value Examples

View source: R/datagennoml.R

Description

A function creating parameters with abrupt changes and sequential data generated by those parameters in Gaussian form.

Usage

1
datagenNoml(T, k, a, b, sig = 1)

Arguments

T

Index of time series data.

k

Number of abrupt changes

a

Parameter space, upper bound.

b

Parameter space, lower bound.

sig

Variance of normal distribution with 1 as default.

Value

Return 'theta_true' as ture underlying paramaeters and 'Y' as data sequence.

Examples

1
2
3
4
5
6
7
8
9
data=datagenNoml(T=1000,k=6,a=-10,b=10,sig=1)
y=data[[1]]
theta_t=data[[2]]
plot(data.frame(x=1:T,y=y),type='l',col='lightblue',
ylim=c(-10,10),ylab='Generate Data/True mean',xlab='time index')
par(new=TRUE)
plot(data.frame(x=1:T,y=theta_t),type='l',
col='red',ylim=c(-10,10),ylab='',xlab='',axes=F)
title(main="Normal Data Sequence")

azure10h/PFSMC documentation built on Feb. 5, 2020, 5:11 a.m.