updateTheta: A function to update the initial values of the parameters,...

View source: R/initializeFRAN.r

update_thetaR Documentation

A function to update the initial values of the parameters, and a function to update an effects object.

Description

update_theta copies the final values of the parameter estimates for any matching selected effects from a sienaFit object to a Siena effects object.
update_specification includes in a Siena effects object a set of effects that are included in another effects object.
The functions update_theta and updateTheta are identical;
the same holds for update_specification and updateSpecification. The first of these names are preferred, the others are kept for backward compatibility.

Usage

## S3 method for class 'sienaEffects'
update_theta(x, prevAns, varName=NULL, ...)
## S3 method for class 'sienaEffects'
update_specification(x, effects.from,
         effects.extra=NULL, name.to=NULL, name.from=NULL, ...)

updateTheta(effects, prevAns, varName=NULL)
updateSpecification(effects.to, effects.from,
         effects.extra=NULL, name.to=NULL, name.from=NULL)

Arguments

x

Object of class sienaEffects.

prevAns

Object of class sienaFit as returned by siena07.

varName

Character string or vector of character strings; is this is not NULL, the update will only applied to this dependent variable / these dependent variables.

effects.to

Object of class sienaEffects.

effects.from

Object of class sienaEffects.

effects.extra

Object of class sienaEffects.

name.to

Character string, name of dependent variable in object.to.

name.from

Character string, name of dependent variable in object.from.

effects

Object of class sienaEffects.

...

Additional arguments, not used now.

Details

The initial values of any selected effects in the input effects object which match an effect estimated in prevAns will be updated by update_theta and set to the parameter estimates obtained in prevAns.
If the previous run was conditional, the estimated rate parameters for the dependent variable on which the run was conditioned are added to the final value of theta. If varName is not NULL, this update is restricted to effects for the dependent variable/s specified by varName.
By update_specification, the effects included in effects.from are also included in x (for update_specification) effects.to (for updateSpecification); if name.to and/or name.from is specified, this is restricted to effects for those dependent variables.
If effects.from contains interaction effects, the corresponding main effects will be looked for in effects.from; if they are not found there, they will be looked for in effects.extra. It is not guaranteed that this will be successful. For effects.extra, it is best to use an effects object constructed for the same data set as effects.from, and by the same version of RSiena.

Value

Updated effects object.

Note

Using update_theta explicitly before calling siena rather than using it via the argument prevAns of siena will not permit the use of the previous derivative matrix for option Dolby. In most cases, using siena with prevAns will therefore be more efficient; but sometimes the use of update_theta gives better results.

Author(s)

Ruth Ripley, Tom A.B. Snijders

References

See https://www.stats.ox.ac.uk/~snijders/siena/

See Also

siena, make_specification

Examples

## For updateTheta:
mynet1 <- as_dependent_rsiena(array(c(tmp3, tmp4), dim=c(32, 32, 2)))
mydata <- make_data_rsiena(mynet1)
myeff1 <- make_specification(mydata)
myeff1 <- set_effect(myeff1, transTrip)
myeff1 <- set_interaction(myeff1, list(recip, inPop))
myalgo <- set_algorithm_saom(nsub=1, n3=100, seed=1291)
(ans <- siena(mydata, effects=myeff1, control_algo=myalgo,
                                          batch=TRUE))
ans$theta
(myeff <- update_theta(myeff1, ans))
##
## For updateSpecification:
myeff2 <- make_specification(mydata)
myeff2 <- set_effect(myeff2, outAct)
update_specification(myeff2, myeff1)

RSiena documentation built on April 20, 2026, 5:07 p.m.