utils_EM {kfino} | R Documentation |
utils_EM a function to estimate the parameters 'm_0' , 'mm', 'pp' through an Expectation-Maximization (EM) method
Description
utils_EM a function to estimate the parameters 'm_0' , 'mm', 'pp' through an Expectation-Maximization (EM) method
Usage
utils_EM(param, kappaOpt, Y, Tps, N, scalingC)
Arguments
param |
list, see initial parameter list in |
kappaOpt |
numeric, truncation setting for initial parameters' optimization, default 7 |
Y |
character, name of the numeric variable to predict in the data.frame datain |
Tps |
character, time column name in the data.frame datain, a numeric vector. Tvar can be expressed as a proportion of day in seconds |
N |
numeric, length of the numeric vector of Y values |
scalingC |
numeric, scaling constant. To be changed if the function is not able to calculate the likelihood because the number of data is large |
Details
utils_EM is a tool function used in the main kfino_fit
function. It uses the same input parameter list than the main function.
Value
a list:
- m0
numeric, optimized m0
- mm
numeric, optimized mm
- pp
numeric, optimized pp
- likelihood
numeric, the calculated likelihood
Examples
set.seed(1234)
Y<-rnorm(n=10,mean=50,4)
Tps<-seq(1,10)
N=10
param2<-list(m0=41,
mm=45,
pp=0.5,
aa=0.001,
expertMin=30,
expertMax=75,
sigma2_m0=1,
sigma2_mm=0.05,
sigma2_pp=5,
K=2,
seqp=seq(0.5,0.7,0.1))
print(Y)
utils_EM(param=param2,kappaOpt=7,Y=Y,Tps=Tps,N=N,scalingC=6)