CanadianWeather | R Documentation |
Daily temperature and precipitation at 35 different locations in Canada averaged over 1960 to 1994.
Data from fda
package.
data(CanadianWeather)
A list containing 5 elements:
tempav: a matrix of dimensions (365, 35) giving the average temperature in degrees celsius for each day of the year.
precav: a matrix of dimensions (365, 35) giving the average rainfall in millimeters for each day of the year.
time: sequence from 1 to 365.
coordinates: a matrix giving 'N.latitude' and 'W.longitude' for each place.
region: Which of 4 climate zones contain each place: Atlantic, Pacific, Continental, Arctic.
Ramsay, James O., and Silverman, Bernard W. (2006), Functional Data Analysis, 2nd ed., Springer, New York.
Ramsay, James O., and Silverman, Bernard W. (2002), Applied Functional Data Analysis, Springer, New York
Other data:
prostate
,
simData
,
titanic
data(CanadianWeather)
# convert functional to MixtComp format
dat <- list(
tempav = apply(
CanadianWeather$tempav, 2,
function(x) createFunctional(CanadianWeather$time, x)
),
precav = apply(
CanadianWeather$precav, 2,
function(x) createFunctional(CanadianWeather$time, x)
)
)
# create model with 4 subregressions ans 2 coefficients per regression
model <- list(
tempav = list(type = "Func_CS", paramStr = "nSub: 4, nCoeff: 2"),
precav = list(type = "Func_CS", paramStr = "nSub: 4, nCoeff: 2")
)
# create algo
algo <- createAlgo()
# run clustering
resLearn <- mixtCompLearn(dat, model, algo, nClass = 2:4, criterion = "ICL", nRun = 3, nCore = 1)
summary(resLearn)
plot(resLearn)
getPartition(resLearn)
getTik(resLearn, log = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.