psii: A generic function to produce a matrix of Legendre...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/psii.R

Description

The function creates an n times n matrix, each row of the matrix replicating Legendre polynomials for the corresponding value of the re-scaled age vector the length of which is n. This function is a subfunction of IDM.

Usage

1
psii(adjusted_age)

Arguments

adjusted_age

The vector of ages scaled to range from -1 to 1.

Details

For further details, see Kirkpatrick et al. 1990.

Value

A n times n matrix of Legendre polynomials, value replicated at each row being the polynomials at the corresponding age.

Author(s)

Anna Kuparinen and Mats Bj<f6>rklund

References

Kirkpatrick M, Lofsvold D, Bulmer M (1990) Analysis of the inheritance, selection and evolution of growth trajectories. Genetics 124:979-993.

See Also

IDM, IDM.bootCI

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# The function is defined as
function(adjusted_age){
n=length(adjusted_age)

adjust_temp=rep(adjusted_age,each=n)
j_temp=rep(0:(n-1),n)

psii_elements=rep(NA,n*n)
for(i in 1:(n*n)){
psii_elements[i]=p.function(j=j_temp[i],x=adjust_temp[i])
  }
psii_temp=matrix(psii_elements,byrow=T,nrow=n,ncol=n)
return(psii_temp)
  }

InfDim documentation built on May 1, 2019, 9:09 p.m.