楼主: oliyiyi
91790 2410

【latex版】水贴   [推广有奖]

751
oliyiyi 发表于 2015-8-28 09:08:18
We consider the problem of recovery of an unknown multivariate signal $f$ observed in a $d$-dimensional Gaussian white noise model of intensity $\varepsilon$. We assume that $f$ belongs to a class of smooth functions ${\cal F}^d\subset L_2([0,1]^d)$ and has an additive sparse structure determined by the parameter $s$, the number of non-zero univariate components contributing to $f$. We are interested in the case when $d=d_\varepsilon \to \infty$ as $\varepsilon \to 0$ and the parameter $s$ stays "small" relative to $d$. With these assumptions, the recovery problem in hand becomes that of determining which sparse additive components are non-zero. Attempting to reconstruct most non-zero components of $f$, but not all of them, we arrive at the problem of almost full variable selection in high-dimensional regression. For two different choices of ${\cal F}^d$, we establish conditions under which almost full variable selection is possible, and provide a procedure that gives almost full variable selection. The procedure does the best (in the asymptotically minimax sense) in selecting most non-zero components of $f$. Moreover, it is adaptive in the parameter $s$.

752
oliyiyi 发表于 2015-8-28 09:13:46
We study graphons as a non-parametric generalization of stochastic block models, and show how to obtain compactly represented estimators for sparse networks in this framework. Our algorithms and analysis go beyond previous work in several ways. First, we relax the usual boundedness assumption for the generating graphon and instead treat arbitrary integrable graphons, so that we can handle networks with long tails in their degree distributions. Second, again motivated by real-world applications, we relax the usual assumption that the graphon is defined on the unit interval, to allow latent position graphs where the latent positions live in a more general space, and we characterize identifiability for these graphons and their underlying position spaces.

We analyze three algorithms. The first is a least squares algorithm, which gives an approximation we prove to be consistent for all square-integrable graphons, with errors expressed in terms of the best possible stochastic block model approximation to the generating graphon. Next, we analyze a generalization based on the cut norm, which works for any integrable graphon (not necessarily square-integrable). Finally, we show that clustering based on degrees works whenever the underlying degree distribution is absolutely continuous with respect to Lebesgue measure. Unlike the previous two algorithms, this third one runs in polynomial time.

753
oliyiyi 发表于 2015-8-29 17:37:02
library(tm)library(SnowballC)library(wordcloud)jeopQ <- read.csv('JEOPARDY_CSV.csv', stringsAsFactors = FALSE)
缺少币币的网友请访问有奖回帖集合
https://bbs.pinggu.org/thread-3990750-1-1.html

754
oliyiyi 发表于 2015-8-29 17:38:32
(This article was first published on Thinking inside the box , and kindly contributed to R-bloggers) A pure maintenance release 0.1.3 of the RcppDE package arrived on CRAN yesterday. RcppDE is a "port" of DEoptim, a popular package for derivative-free optimisation using differential optimization,...

755
oliyiyi 发表于 2015-8-29 17:39:11
(This article was first published on Working With Data » R, and kindly contributed to R-bloggers) This entry is part 17 of 17 in the series Using R Sometimes it is useful to write a wrapper function for an existing function. In this short example we demonstrate how to grab the list of arguments...

756
oliyiyi 发表于 2015-8-29 17:53:47
美国国家卫生研究院一项新研究显示,Omega-3补充剂并不能延缓老年人的认知衰退。国家卫生研究院进行的一项新研究却找到迄今最有力的证据证明,Omega-3补充剂对阿尔茨海默症和其他认知衰退问题没有效果。科学家用5年时间对4000名老年人进行了跟踪研究,结果鱼油根本没有任何用。

757
oliyiyi 发表于 2015-8-29 18:13:02
我们不提供人格教育、历史教育、理想教育

758
oliyiyi 发表于 2015-8-29 18:26:13
Lists are a data type in R that are perhaps a bit daunting at first, but soon become amazingly useful. They are especially wonderful once you combine them with the powers of the apply() functions. This post will be part 1 of a two-part series on the uses of lists. In this post, we will discuss the basics - how to create lists, manipulate them, describe them, and convert them. In part 2, we’ll see how using lapply() and sapply() on lists can really improve your R coding.

Constructing a list

Let’s start with what lists are and how to construct them. A list is a data structure that can hold any number of any types of other data structures. If you have vector, a dataframe, and a character object, you can put all of those into one list object like so:

# create three different classes of objects
vec <- 1:4
df <- data.frame(y = c(1:3), x = c("m", "m", "f"))
char <- "Hello!"

# add all three objects to one list using list() function
list1 <- list(vec, df, char)

# print list
list1
## [[1]]
## [1] 1 2 3 4
##
## [[2]]
##   y x
## 1 1 m
## 2 2 m
## 3 3 f
##
## [[3]]
## [1] "Hello!"
We can also turn an object into a list by using the as.list() function. Notice how every element of the vector becomes a different component of the list.

# coerce vector into a list
as.list(vec)
## [[1]]
## [1] 1
##
## [[2]]
## [1] 2
##
## [[3]]
## [1] 3
##
## [[4]]
## [1] 4
Manipulating a list

We can put names on the components of a list using the names() function. This is useful for extracting components. We could have also named the components when we created the list. See below:
# name the components of the list
names(list1) <- c("Numbers", "Some.data", "Letters")
list1
## $Numbers
## [1] 1 2 3 4
##
## $Some.data
##   y x
## 1 1 m
## 2 2 m
## 3 3 f
##
## $Letters
## [1] "Hello!"
# could have named them when we created list
another.list <- list(Numbers = vec, Letters = char)
Extract components from a list (many ways): the first is using the [[ ]] operator (notice two brackets, not just one). Note that we can use the single [ ] operator on a list, but it will return a list rather than the data structure that is the component of the list, which is normally not what we would want to do. See what I mean here:
# extract 3rd component using [[]] -> this returns a *string*
list1[[3]]
## [1] "Hello!"
# print a list containing the 3rd component -> this returns a *list*
list1[3]
## $Letters
## [1] "Hello!"
It is also possible to extract components using the component’s name as we see below. Again, be careful about the [ ] vs [[ ]] operator in the second way. You need the [[ ]] to return the data structure of the component.

# extract 3rd component using $
list1$Letters
## [1] "Hello!"
# extract 3rd component using [[ ]] and the name of the component
list1[["Letters"]]
## [1] "Hello!"
Subsetting a list - use the single [ ] operator and c() to choose the components
# subset the first and third components
list1[c(1, 3)]
## $Numbers
## [1] 1 2 3 4
##
## $Letters
## [1] "Hello!"
We can also add a new component to the list or replace a component using the $ or [[ ]] operators. This time I’ll add a linear model to the list (remember we can put anything into a list).
# add new component to existing list using $
list1$newthing <- lm(y ~ x, data = df)

# add a new component to existing list using [[ ]]
list1[[5]] <- "new component"
Finally, we can delete a component of a list by setting it equal to NULL.
# delete a component of existing list
list1$Letters <- NULL
list1
## $Numbers
## [1] 1 2 3 4
##
## $Some.data
##   y x
## 1 1 m
## 2 2 m
## 3 3 f
##
## $newthing
##
## Call:
## lm(formula = y ~ x, data = df)
##
## Coefficients:
## (Intercept)           xm  
##         3.0         -1.5  
##
##
## [[4]]
## [1] "new component"
The Letters component is gone, so there are now only 4. Notice how the 4th component doesn’t have a name because we didn’t assign it one when we added it in.

More extracting: If we want to extract the dataframe we have in the list, and just look at it’s first row, we would do list1[[2]][1,]. This code would take the second component in the list using the [[ ]] operator (which is the dataframe) and once it has the dataframe, it subsets the first row and all columns using only the [ ] operator since that is what is used to subset dataframes (or matrices).

For help on subsetting matrices and dataframes, check out this post.

# extract first row of dataframe that is in a list
list1[[2]][1, ]
##   y x
## 1 1 m
Describing a list

To describe a list, we may want to know the following:

the class of the list (which is a list class!) and the class of the first component of the list.
# describe class of the whole list
class(list1)
## [1] "list"
# describe the class of the first component of the list
class(list1[[1]])
## [1] "integer"
the number of components in the list - use the length function()
# find out how many components are in the list
length(list1)
## [1] 4
a short summary of each component in the list - use str(). (I take out the model because the output is really long)
# take out the model from list and then show summary of what's in the list
list1$newthing <- NULL
str(list1)
## List of 3
##  $ Numbers  : int [1:4] 1 2 3 4
##  $ Some.data:'data.frame':   3 obs. of  2 variables:
##   ..$ y: int [1:3] 1 2 3
##   ..$ x: Factor w/ 2 levels "f","m": 2 2 1
##  $          : chr "new component"
Now we can combine these functions to append a component to the end of the list, by assigning it to the length of the list plus 1:
# construct new list of two components
new.list <- list(vec, char)

# notice that it has two components
length(new.list)
## [1] 2
# append a component to the end and print
new.list[[length(new.list) + 1]] <- "Appended"

new.list
## [[1]]
## [1] 1 2 3 4
##
## [[2]]
## [1] "Hello!"
##
## [[3]]
## [1] "Appended"
Notice you could keep doing this as the length is now 3. You could also use the $ operator to name a new component and that would append it at the end, as we saw above.

Initializing a list

To initialize a list to a certain number of null components, we use the vector function like this:

# initialize list to have 3 null components and print
list2 <- vector("list", 3)
list2
## [[1]]
## NULL
##
## [[2]]
## NULL
##
## [[3]]
## NULL
Converting a list into matrix or dataframe

Finally, we can convert a list into a matrix, dataframe, or vector in a number of different ways. The first, most basic way is to use unlist(), which just turns the whole list into one long vector:

# convert to one long string - use unlist
unlist(list1)
##        Numbers1        Numbers2        Numbers3        Numbers4
##             "1"             "2"             "3"             "4"
##    Some.data.y1    Some.data.y2    Some.data.y3    Some.data.x1
##             "1"             "2"             "3"             "2"
##    Some.data.x2    Some.data.x3                 
##             "2"             "1" "new component"
But often we have matrices or dataframes as components of a list and we would like to combind them or stack them into one dataframe. The following shows the two good ways I’ve found to do this (from this StackOverflow page) using ldply() from the plyr package or rbind().

First, we create a list of matrices and then convert the list of matrices into a dataframe.

#create list of matrices and print
mat.list <- list(mat1=matrix(c(1,2,3,4), nrow=2), mat2=matrix(c(5,6,7,8), nrow=2))
mat.list
## $mat1
##      [,1] [,2]
## [1,]    1    3
## [2,]    2    4
##
## $mat2
##      [,1] [,2]
## [1,]    5    7
## [2,]    6    8
#convert to data frame
#1. use ldply
require(plyr)
ldply(mat.list, data.frame)
##    .id X1 X2
## 1 mat1  1  3
## 2 mat1  2  4
## 3 mat2  5  7
## 4 mat2  6  8
#2. use rbind
do.call(rbind.data.frame, mat.list)
##        V1 V2
## mat1.1  1  3
## mat1.2  2  4
## mat2.1  5  7
## mat2.2  6  8
Get ready for part 2 next time, when we’ll see what we can use lists for and why we should use them at all.

759
oliyiyi 发表于 2015-8-30 13:03:10
  logical, integer, double, complex, character, or raw.

760
oliyiyi 发表于 2015-8-30 13:29:12
The TABULATE procedure displays descriptive statistics in tabular format, using some or all of the variables in a data set. You can create a variety of tables ranging from simple to highly customized.

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-3-1 05:40