lossGaussian: Loss Function

Description Usage Arguments Value Examples

View source: R/lossGaussian.R

Description

A loss function calculating the squared score of parameters and data sequence.

Usage

1
lossGaussian(theta, y)

Arguments

theta

Underlying parametes theta.

y

Data sequence generated from underlying distributions.

Value

Returns a squared loss.

Examples

1
2
3
4
5
6
7
8
#First generate data sequence with T=100, parameter space=[-10,10]
library(PFSMC)
data=datagenNoml(T=100,k=6,a=-10,b=10,sig=1)
y=data[[1]]; theta_t=data[[2]]
loss1=numeric(100)
for (i in 1:100)
{ loss1[i]=loss(theta_t[i],y[i]) }
loss1

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